Commit a9fea605 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'tmp_fix' into 'NIFTy_6'

Tmp fix

See merge request !478
parents b7ce6553 abeb1a45
Pipeline #75233 passed with stages
in 8 minutes and 26 seconds
...@@ -47,9 +47,9 @@ import numpy as np ...@@ -47,9 +47,9 @@ import numpy as np
dom = ift.UnstructuredDomain(5) dom = ift.UnstructuredDomain(5)
dtype = [np.float64, np.complex128][1] dtype = [np.float64, np.complex128][1]
invcov = ift.ScalingOperator(dom, 3) invcov = ift.ScalingOperator(dom, 3)
e = ift.GaussianEnergy(mean=ift.from_random('normal', dom, dtype=dtype), e = ift.GaussianEnergy(mean=ift.from_random(dom, 'normal', dtype=dtype),
inverse_covariance=invcov) inverse_covariance=invcov)
pos = ift.from_random('normal', dom, dtype=np.complex128) pos = ift.from_random(dom, 'normal', dtype=np.complex128)
lin = e(ift.Linearization.make_var(pos, want_metric=True)) lin = e(ift.Linearization.make_var(pos, want_metric=True))
met = lin.metric met = lin.metric
print(met) print(met)
......
...@@ -207,12 +207,13 @@ class Linearization(Operator): ...@@ -207,12 +207,13 @@ class Linearization(Operator):
return self.__mul__(other) return self.__mul__(other)
from .operators.outer_product_operator import OuterProduct from .operators.outer_product_operator import OuterProduct
if other.jac is None: if other.jac is None:
return self.new(OuterProduct(self._val, other.domain)(other), return self.new(OuterProduct(other.domain, self._val)(other),
OuterProduct(self._jac(self._val), other.domain)) OuterProduct(other.domain, self._jac(self._val)))
tmp_op = OuterProduct(other.target, self._val)
return self.new( return self.new(
OuterProduct(self._val, other.target)(other._val), tmp_op(other._val),
OuterProduct(self._jac(self._val), other.target)._myadd( OuterProduct(other.target, self._jac(self._val))._myadd(
OuterProduct(self._val, other.target)(other._jac), False)) tmp_op(other._jac), False))
def vdot(self, other): def vdot(self, other):
"""Computes the inner product of this Linearization with a Field or """Computes the inner product of this Linearization with a Field or
......
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