Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
9cbdaa07
Commit
9cbdaa07
authored
Feb 06, 2018
by
Philipp Arras
Browse files
Add test for laplace operator
parent
378af2c5
Pipeline
#24470
failed with stage
in 5 minutes and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_laplace_operator.py
View file @
9cbdaa07
...
...
@@ -33,3 +33,19 @@ class LaplaceOperatorTests(unittest.TestCase):
L
=
ift
.
LaplaceOperator
(
p
,
logarithmic
=
log2
)
fp
=
ift
.
Field
.
from_random
(
"normal"
,
domain
=
p
,
dtype
=
np
.
float64
)
assert_allclose
(
L
(
fp
).
vdot
(
L
(
fp
)),
L
.
adjoint_times
(
L
(
fp
)).
vdot
(
fp
))
@
expand
(
product
([
10
,
100
,
1000
]))
def
test_Laplace
(
self
,
sz
):
s
=
ift
.
RGSpace
(
sz
,
harmonic
=
True
)
bb
=
ift
.
PowerSpace
.
useful_binbounds
(
s
,
logarithmic
=
False
)
p
=
ift
.
PowerSpace
(
s
,
binbounds
=
bb
)
foo
=
ift
.
PS_field
(
p
,
lambda
k
:
2
*
k
**
2
)
L
=
ift
.
LaplaceOperator
(
p
,
logarithmic
=
False
)
result
=
ift
.
Field
(
p
,
val
=
2
*
2.
)
result
.
val
[
0
]
=
0.
result
.
val
[
1
]
=
0.
result
.
val
[
-
1
]
=
0.
assert_allclose
(
L
(
foo
).
val
,
result
.
val
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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