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

more convenient handling of 'unitary' property

parent f1f2506c
Pipeline #23092 passed with stage
in 4 minutes and 44 seconds
......@@ -38,10 +38,6 @@ class LogNormalWienerFilterCurvature(InversionEnabler, EndomorphicOperator):
def self_adjoint(self):
return True
@property
def unitary(self):
return False
def _times(self, x):
part1 = self.S.inverse_times(x)
part3 = self._fft.adjoint_times(self._expp_sspace * self._fft(x))
......
......@@ -25,10 +25,6 @@ class NonlinearPowerCurvature(InversionEnabler, EndomorphicOperator):
def self_adjoint(self):
return True
@property
def unitary(self):
return False
def _times(self, x):
result = None
for sample in self.sample_list:
......
......@@ -31,10 +31,6 @@ class LinearizedSignalResponse(LinearOperator):
def target(self):
return self.Instrument.target
@property
def unitary(self):
return False
class LinearizedPowerResponse(LinearOperator):
def __init__(self, Instrument, nonlinearity, FFT, Projection, t, m):
......@@ -74,7 +70,3 @@ class LinearizedPowerResponse(LinearOperator):
@property
def target(self):
return self.Instrument.target
@property
def unitary(self):
return False
......@@ -36,10 +36,6 @@ class WienerFilterCurvature(InversionEnabler, EndomorphicOperator):
def self_adjoint(self):
return True
@property
def unitary(self):
return False
def _times(self, x):
res = self.R.adjoint_times(self.N.inverse_times(self.R(x)))
res += self.S.inverse_times(x)
......
......@@ -37,8 +37,6 @@ class ComposedOperator(LinearOperator):
The NIFTy.space in which the operator is defined.
target : DomainTuple
The NIFTy.space in which the outcome of the operator lives
unitary : boolean
Indicates whether the Operator is unitary or not.
"""
def __init__(self, operators):
......@@ -63,10 +61,6 @@ class ComposedOperator(LinearOperator):
def target(self):
return self._operator_store[-1].target
@property
def unitary(self):
return False
def _times(self, x):
return self._times_helper(x, func='times')
......
......@@ -42,10 +42,6 @@ class DirectSmoothingOperator(EndomorphicOperator):
def self_adjoint(self):
return True
@property
def unitary(self):
return False
def _precompute(self, x):
""" Does precomputations for Gaussian smoothing on a 1D irregular grid.
......
......@@ -95,7 +95,3 @@ class DOFProjectionOperator(LinearOperator):
@property
def target(self):
return self._target
@property
def unitary(self):
return False
......@@ -34,8 +34,6 @@ class EndomorphicOperator(LinearOperator):
target : DomainTuple
The domain in which the outcome of the operator lives. As the Operator
is endomorphic this is the same as its domain.
unitary : boolean
Indicates whether the Operator is unitary or not.
self_adjoint : boolean
Indicates whether the operator is self_adjoint or not.
"""
......
......@@ -35,7 +35,3 @@ class FFTSmoothingOperator(EndomorphicOperator):
@property
def self_adjoint(self):
return True
@property
def unitary(self):
return False
......@@ -70,10 +70,6 @@ class LaplaceOperator(EndomorphicOperator):
def domain(self):
return self._domain
@property
def unitary(self):
return False
@property
def self_adjoint(self):
return False
......
......@@ -64,15 +64,15 @@ class LinearOperator(with_metaclass(
"""
raise NotImplementedError
@abc.abstractproperty
@property
def unitary(self):
"""
unitary : boolean
States whether the Operator is unitary or not.
Every Operator which inherits from the abstract LinearOperator
base class must have this attribute.
Since the majority of operators will not be unitary, this property
returns False, unless it is overridden in a subclass.
"""
raise NotImplementedError
return False
def __call__(self, x):
return self.times(x)
......
......@@ -33,8 +33,6 @@ class ResponseOperator(LinearOperator):
The domain on which the Operator's input Field lives.
target : DomainTuple
The domain in which the outcome of the operator lives.
unitary : boolean
Indicates whether the Operator is unitary or not.
Raises
------
......@@ -78,10 +76,6 @@ class ResponseOperator(LinearOperator):
def target(self):
return self._target
@property
def unitary(self):
return False
def _times(self, x):
res = self._composed_kernel.times(x)
res = self._composed_exposure.times(res)
......
......@@ -38,10 +38,6 @@ class SmoothnessOperator(EndomorphicOperator):
def domain(self):
return self._laplace._domain
@property
def unitary(self):
return False
@property
def self_adjoint(self):
return False
......
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