Commit a1e34940 authored by Martin Reinecke's avatar Martin Reinecke

better behaviour for factor=0.

parent 60b965f2
Pipeline #23850 passed with stage
in 4 minutes and 24 seconds
...@@ -69,7 +69,10 @@ class ScalingOperator(EndomorphicOperator): ...@@ -69,7 +69,10 @@ class ScalingOperator(EndomorphicOperator):
@property @property
def inverse(self): def inverse(self):
return ScalingOperator(1./self._factor, self._domain) if self._factor!= 0.:
return ScalingOperator(1./self._factor, self._domain)
from .inverse_operator import InverseOperator
return InverseOperator(self)
@property @property
def adjoint(self): def adjoint(self):
...@@ -81,5 +84,7 @@ class ScalingOperator(EndomorphicOperator): ...@@ -81,5 +84,7 @@ class ScalingOperator(EndomorphicOperator):
@property @property
def capability(self): def capability(self):
if self._factor==0.:
return self.TIMES | self.ADJOINT_TIMES
return (self.TIMES | self.ADJOINT_TIMES | return (self.TIMES | self.ADJOINT_TIMES |
self.INVERSE_TIMES | self.ADJOINT_INVERSE_TIMES) self.INVERSE_TIMES | self.ADJOINT_INVERSE_TIMES)
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