MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / derivative

Method derivative

utils/strand_util.py:286–296  ·  view source on GitHub ↗
(self, t, order=1)

Source from the content-addressed store, hash-verified

284 return inners
285
286 def derivative(self, t, order=1):
287 fractional_part, index = self._interpret_t(t)
288 fractional_part = fractional_part.unsqueeze(-1)
289 if order == 1:
290 inner = 2 * self._c[..., index, :] + 3 * self._d[..., index, :] * fractional_part
291 deriv = self._b[..., index, :] + inner * fractional_part
292 elif order == 2:
293 deriv = 2 * self._c[..., index, :] + 6 * self._d[..., index, :] * fractional_part
294 else:
295 raise ValueError('Derivative is not implemented for orders greater than 2.')
296 return deriv
297
298
299def cubic_spline_coeffs(t, x):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected