Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
dafe2922
Commit
dafe2922
authored
May 02, 2019
by
Martin Reinecke
Browse files
fix and simplify
parent
a7325040
Pipeline
#47597
passed with stages
in 8 minutes and 14 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/energy_operators.py
View file @
dafe2922
...
...
@@ -192,11 +192,10 @@ class PoissonianEnergy(EnergyOperator):
def
apply
(
self
,
x
):
self
.
_check_input
(
x
)
res
=
x
.
sum
()
tmp
=
(
res
.
val
.
local_data
if
isinstance
(
res
,
Linearization
)
else
res
.
local_data
)
tmp
=
res
.
val
.
local_data
if
isinstance
(
res
,
Linearization
)
else
res
# if we have no infinity here, we can continue with the calculation;
# otherwise we know that the result must also be infinity
if
not
np
.
any
(
np
.
isinf
(
tmp
)
)
:
if
not
np
.
isinf
(
tmp
):
res
=
res
-
x
.
log
().
vdot
(
self
.
_d
)
if
not
isinstance
(
x
,
Linearization
):
return
Field
.
scalar
(
res
)
...
...
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