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

performance tuning

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