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
494068cf
Commit
494068cf
authored
Jul 27, 2018
by
Martin Reinecke
Browse files
fixes
parent
56c8445b
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/extra/energy_and_model_tests.py
View file @
494068cf
...
...
@@ -168,9 +168,10 @@ def check_value_gradient_metric_consistency2(op, loc, tol=1e-8, ntries=100):
dirder
=
linmid
.
jac
(
dir
)
/
dirnorm
numgrad
=
(
lin2
.
val
-
val
)
/
dirnorm
dgrad
=
linmid
.
metric
(
dir
)
/
dirnorm
dgrad2
=
(
lin2
.
gradient
-
lin
.
gradient
)
/
dirnorm
xtol
=
tol
*
dirder
.
norm
()
/
np
.
sqrt
(
dirder
.
size
)
if
((
abs
(
numgrad
-
dirder
)
<=
xtol
).
all
()
and
(
abs
(
dgrad
-
d
irder
)
<=
xtol
).
all
()):
(
abs
(
dgrad
-
d
grad2
)
<=
xtol
).
all
()):
break
dir
=
dir
*
0.5
dirnorm
*=
0.5
...
...
nifty5/operators/null_operator.py
View file @
494068cf
...
...
@@ -45,7 +45,7 @@ class NullOperator(LinearOperator):
if
isinstance
(
dom
,
DomainTuple
):
return
Field
.
full
(
dom
,
0
)
else
:
return
MultiField
(
dom
,
(
None
,)
*
len
(
dom
)
)
return
MultiField
.
full
(
dom
,
0
)
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
...
...
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