Commit 7999e816 authored by Julia Stadler's avatar Julia Stadler

possonian engery

parent 9f8bd423
......@@ -192,8 +192,12 @@ class PoissonianEnergy(EnergyOperator):
self._check_input(x)
res = x.sum() - x.log().vdot(self._d)
if not isinstance(x, Linearization):
if res.val != res.val:
return Field.scalar(np.inf)
return Field.scalar(res)
if not x.want_metric:
if res.val.val != res.val.val:
res = res.new(Field.scalar(np.inf), res.jac)
return res
metric = SandwichOperator.make(x.jac, makeOp(1./x.val))
return res.add_metric(metric)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment