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
336775e0
Commit
336775e0
authored
May 11, 2017
by
Pumpe, Daniel (dpumpe)
Browse files
update DiagonalOperator tests
parent
df39c3b2
Pipeline
#12316
passed with stage
in 6 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_diagonal_operator.py
View file @
336775e0
...
...
@@ -110,12 +110,12 @@ class DiagonalOperator_Tests(unittest.TestCase):
diag
=
Field
.
from_random
(
'normal'
,
domain
=
space
)
D
=
DiagonalOperator
(
space
,
diagonal
=
diag
,
copy
=
copy
)
trace_log
=
D
.
trace_log
()
assert_allclose
(
trace_log
,
np
.
log
(
np
.
sum
(
diag
.
val
.
get_full_data
())))
assert_allclose
(
trace_log
,
np
.
sum
(
np
.
log
(
diag
.
val
.
get_full_data
())))
@
expand
(
product
(
spaces
,
[
True
,
False
]))
def
test_determinant
(
self
,
space
,
copy
):
diag
=
Field
.
from_random
(
'normal'
,
domain
=
space
)
D
=
DiagonalOperator
(
space
,
diagonal
=
diag
,
bare
=
bare
,
copy
=
copy
)
D
=
DiagonalOperator
(
space
,
diagonal
=
diag
,
copy
=
copy
)
det
=
D
.
determinant
()
assert_allclose
(
det
,
np
.
prod
(
diag
.
val
.
get_full_data
()))
...
...
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