Commit 3c6d018b authored by Martin Reinecke's avatar Martin Reinecke
Browse files

performance tuning

parent 12eeaaab
Pipeline #17928 canceled with stage
in 2 minutes and 11 seconds
......@@ -23,7 +23,6 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
def __init__(self, R, N, S, inverter, **kwargs):
self.R = R
self.N = N
self.S = S
......@@ -23,17 +23,18 @@ class WienerFilterEnergy(Energy):
The prior signal covariance in harmonic space.
def __init__(self, position, d, R, N, S, inverter):
def __init__(self, position, d, R, N, S, inverter, _j=None):
super(WienerFilterEnergy, self).__init__(position=position)
self.d = d
self.R = R
self.N = N
self.S = S
self._inverter = inverter
self._jpre = _j
def at(self, position):
return self.__class__(position=position, d=self.d, R=self.R, N=self.N,
S=self.S, _j=self._jpre)
......@@ -57,6 +58,7 @@ class WienerFilterEnergy(Energy):
return self.curvature(self.position)
def _j(self):
return self.R.adjoint_times(self.N.inverse_times(self.d))
if self._jpre is None:
self._jpre = self.R.adjoint_times(self.N.inverse_times(self.d))
return self._jpre
Supports Markdown
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