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 self.new(self._val**power, (self._jac**(power-1)).scale(power))
def inverse(self):
return self.new(1./self._val, makeOp(-1./(self._val**2))(self._jac))
......
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