Commit d1b9f160 authored by Philipp Arras's avatar Philipp Arras
Browse files


parent 1c7629b0
Pipeline #70613 failed with stages
in 11 minutes and 22 seconds
......@@ -40,15 +40,17 @@ class _InterpolationOperator(Operator):
def apply(self, x):
val = (np.clip(x.val, self._xmin, self._xmax) - self._xmin) / self._d
lin = isinstance(x, Linearization)
xval = x.val.val if lin else x.val
val = (np.clip(xval, self._xmin, self._xmax) - self._xmin) / self._d
fi = np.floor(val).astype(int)
w = val - fi
res = self._inv_table_func((1-w)*self._table[fi] + w*self._table[fi+1])
resfld = Field(self._domain, res)
if not isinstance(x, Linearization):
if not lin:
return resfld
jac = makeOp(Field(self._domain, self._deriv[fi]*res))
return Linearization(resfld, jac)
return, jac)
def InverseGammaOperator(domain, alpha, q, delta=0.001):
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