Commit d996d12c authored by Philipp Frank's avatar Philipp Frank
Browse files

remove duplicate inverse

parent 34af9f25
...@@ -110,11 +110,11 @@ class Linearization(object): ...@@ -110,11 +110,11 @@ class Linearization(object):
def __truediv__(self, other): def __truediv__(self, other):
if isinstance(other, Linearization): if isinstance(other, Linearization):
return self.__mul__(other.inverse()) return self.__mul__(other.one_over())
return self.__mul__(1./other) return self.__mul__(1./other)
def __rtruediv__(self, other): def __rtruediv__(self, other):
return self.inverse().__mul__(other) return self.one_over().__mul__(other)
def __pow__(self, power): def __pow__(self, power):
if not np.isscalar(power): if not np.isscalar(power):
...@@ -122,9 +122,6 @@ class Linearization(object): ...@@ -122,9 +122,6 @@ class Linearization(object):
return**power, return**power,
makeOp(self._val**(power-1)).scale(power)(self._jac)) makeOp(self._val**(power-1)).scale(power)(self._jac))
def inverse(self):
return, makeOp(-1./(self._val**2))(self._jac))
def __mul__(self, other): def __mul__(self, other):
from .sugar import makeOp from .sugar import makeOp
if isinstance(other, Linearization): if isinstance(other, Linearization):
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