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

add Linearization.__pow__

parent dbe056fc
......@@ -101,6 +101,11 @@ class Linearization(object):
def __rtruediv__(self, other):
return self.inverse().__mul__(other)
def __pow__(self, power):
if not np.isscalar(power):
return NotImplemented
return**power, (self._jac**(power-1)).scale(power))
def inverse(self):
return, makeOp(-1./(self._val**2))(self._jac))
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