Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pypocketfft
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Reinecke
pypocketfft
Commits
ee5193a5
Commit
ee5193a5
authored
Jul 20, 2019
by
Peter Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant "ortho" parameter from python interface
parent
8bbee24d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
pypocketfft.cc
pypocketfft.cc
+11
-13
test.py
test.py
+6
-6
No files found.
pypocketfft.cc
View file @
ee5193a5
...
...
@@ -227,7 +227,7 @@ py::array r2r_fftpack(const py::array &in, const py::object &axes_,
}
template
<
typename
T
>
py
::
array
dct_internal
(
const
py
::
array
&
in
,
const
py
::
object
&
axes_
,
int
type
,
int
inorm
,
bool
ortho
,
py
::
object
&
out_
,
const
py
::
object
&
axes_
,
int
type
,
int
inorm
,
py
::
object
&
out_
,
size_t
nthreads
)
{
auto
axes
=
makeaxes
(
in
,
axes_
);
...
...
@@ -239,10 +239,9 @@ template<typename T> py::array dct_internal(const py::array &in,
auto
d_out
=
reinterpret_cast
<
T
*>
(
res
.
mutable_data
());
{
py
::
gil_scoped_release
release
;
// override
if
(
ortho
)
inorm
=
1
;
T
fct
=
(
type
==
1
)
?
norm_fct
<
T
>
(
inorm
,
dims
,
axes
,
2
,
-
1
)
:
norm_fct
<
T
>
(
inorm
,
dims
,
axes
,
2
);
bool
ortho
=
inorm
==
1
;
pocketfft
::
dct
(
dims
,
s_in
,
s_out
,
axes
,
type
,
d_in
,
d_out
,
fct
,
ortho
,
nthreads
);
}
...
...
@@ -250,15 +249,15 @@ template<typename T> py::array dct_internal(const py::array &in,
}
py
::
array
dct
(
const
py
::
array
&
in
,
int
type
,
const
py
::
object
&
axes_
,
int
inorm
,
bool
ortho
,
py
::
object
&
out_
,
size_t
nthreads
)
int
inorm
,
py
::
object
&
out_
,
size_t
nthreads
)
{
if
((
type
<
1
)
||
(
type
>
4
))
throw
invalid_argument
(
"invalid DCT type"
);
DISPATCH
(
in
,
f64
,
f32
,
flong
,
dct_internal
,
(
in
,
axes_
,
type
,
inorm
,
o
rtho
,
out_
,
nthreads
))
DISPATCH
(
in
,
f64
,
f32
,
flong
,
dct_internal
,
(
in
,
axes_
,
type
,
inorm
,
o
ut_
,
nthreads
))
}
template
<
typename
T
>
py
::
array
dst_internal
(
const
py
::
array
&
in
,
const
py
::
object
&
axes_
,
int
type
,
int
inorm
,
bool
ortho
,
py
::
object
&
out_
,
const
py
::
object
&
axes_
,
int
type
,
int
inorm
,
py
::
object
&
out_
,
size_t
nthreads
)
{
auto
axes
=
makeaxes
(
in
,
axes_
);
...
...
@@ -270,10 +269,9 @@ template<typename T> py::array dst_internal(const py::array &in,
auto
d_out
=
reinterpret_cast
<
T
*>
(
res
.
mutable_data
());
{
py
::
gil_scoped_release
release
;
// override
if
(
ortho
)
inorm
=
1
;
T
fct
=
(
type
==
1
)
?
norm_fct
<
T
>
(
inorm
,
dims
,
axes
,
2
,
1
)
:
norm_fct
<
T
>
(
inorm
,
dims
,
axes
,
2
);
bool
ortho
=
inorm
==
1
;
pocketfft
::
dst
(
dims
,
s_in
,
s_out
,
axes
,
type
,
d_in
,
d_out
,
fct
,
ortho
,
nthreads
);
}
...
...
@@ -281,10 +279,10 @@ template<typename T> py::array dst_internal(const py::array &in,
}
py
::
array
dst
(
const
py
::
array
&
in
,
int
type
,
const
py
::
object
&
axes_
,
int
inorm
,
bool
ortho
,
py
::
object
&
out_
,
size_t
nthreads
)
int
inorm
,
py
::
object
&
out_
,
size_t
nthreads
)
{
if
((
type
<
1
)
||
(
type
>
4
))
throw
invalid_argument
(
"invalid DST type"
);
DISPATCH
(
in
,
f64
,
f32
,
flong
,
dst_internal
,
(
in
,
axes_
,
type
,
inorm
,
ortho
,
DISPATCH
(
in
,
f64
,
f32
,
flong
,
dst_internal
,
(
in
,
axes_
,
type
,
inorm
,
out_
,
nthreads
))
}
...
...
@@ -669,7 +667,7 @@ PYBIND11_MODULE(pypocketfft, m)
m
.
def
(
"genuine_hartley"
,
genuine_hartley
,
genuine_hartley_DS
,
"a"
_a
,
"axes"
_a
=
None
,
"inorm"
_a
=
0
,
"out"
_a
=
None
,
"nthreads"
_a
=
1
);
m
.
def
(
"dct"
,
dct
,
dct_DS
,
"a"
_a
,
"type"
_a
,
"axes"
_a
=
None
,
"inorm"
_a
=
0
,
"o
rtho"
_a
=
false
,
"o
ut"
_a
=
None
,
"nthreads"
_a
=
1
);
"out"
_a
=
None
,
"nthreads"
_a
=
1
);
m
.
def
(
"dst"
,
dst
,
dst_DS
,
"a"
_a
,
"type"
_a
,
"axes"
_a
=
None
,
"inorm"
_a
=
0
,
"o
rtho"
_a
=
false
,
"o
ut"
_a
=
None
,
"nthreads"
_a
=
1
);
"out"
_a
=
None
,
"nthreads"
_a
=
1
);
}
test.py
View file @
ee5193a5
...
...
@@ -231,13 +231,13 @@ def testdcst1Dortho(len, type):
itp
=
(
0
,
1
,
3
,
2
,
4
)
itype
=
itp
[
type
]
if
type
!=
1
or
len
>
1
:
_assert_close
(
a
,
pypocketfft
.
dct
(
pypocketfft
.
dct
(
c
,
ortho
=
True
,
type
=
type
),
ortho
=
True
,
type
=
itype
),
2e-18
)
_assert_close
(
a
,
pypocketfft
.
dct
(
pypocketfft
.
dct
(
a
,
ortho
=
True
,
type
=
type
),
ortho
=
True
,
type
=
itype
),
1.5e-15
)
_assert_close
(
b
,
pypocketfft
.
dct
(
pypocketfft
.
dct
(
b
,
ortho
=
True
,
type
=
type
),
ortho
=
True
,
type
=
itype
),
6e-7
)
_assert_close
(
a
,
pypocketfft
.
dct
(
pypocketfft
.
dct
(
c
,
inorm
=
1
,
type
=
type
),
inorm
=
1
,
type
=
itype
),
2e-18
)
_assert_close
(
a
,
pypocketfft
.
dct
(
pypocketfft
.
dct
(
a
,
inorm
=
1
,
type
=
type
),
inorm
=
1
,
type
=
itype
),
1.5e-15
)
_assert_close
(
b
,
pypocketfft
.
dct
(
pypocketfft
.
dct
(
b
,
inorm
=
1
,
type
=
type
),
inorm
=
1
,
type
=
itype
),
6e-7
)
if
type
!=
1
:
_assert_close
(
a
,
pypocketfft
.
dst
(
pypocketfft
.
dst
(
c
,
ortho
=
True
,
type
=
type
),
ortho
=
True
,
type
=
itype
),
2e-18
)
_assert_close
(
a
,
pypocketfft
.
dst
(
pypocketfft
.
dst
(
a
,
ortho
=
True
,
type
=
type
),
ortho
=
True
,
type
=
itype
),
1.5e-15
)
_assert_close
(
b
,
pypocketfft
.
dst
(
pypocketfft
.
dst
(
b
,
ortho
=
True
,
type
=
type
),
ortho
=
True
,
type
=
itype
),
6e-7
)
_assert_close
(
a
,
pypocketfft
.
dst
(
pypocketfft
.
dst
(
c
,
inorm
=
1
,
type
=
type
),
inorm
=
1
,
type
=
itype
),
2e-18
)
_assert_close
(
a
,
pypocketfft
.
dst
(
pypocketfft
.
dst
(
a
,
inorm
=
1
,
type
=
type
),
inorm
=
1
,
type
=
itype
),
1.5e-15
)
_assert_close
(
b
,
pypocketfft
.
dst
(
pypocketfft
.
dst
(
b
,
inorm
=
1
,
type
=
type
),
inorm
=
1
,
type
=
itype
),
6e-7
)
# TEMPORARY: separate test for DCT/DST IV, since they are less accurate
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment