Closed MichaelClerx closed 2 years ago
I'm considering doing this before making a NLopt
example, so that the example can make use of gradients. Looking into the code for linear_interpolant
, I wonder
grad_x = (h21 - h11) / self._resolution
and grad_x = (h12 - h11) / self._resolution
?__call__
defined, or make it a method of linear_interpolant
?if we can calculate using
grad_x = (h21 - h11) / self._resolution
andgrad_x = (h12 - h11) / self._resolution
?
Seems that this calculation method is fine after testing it with a gradient-based method in NLopt.
Closed in #68
Easy addition to linear interpolant. Will be discontinuous at nodes. Can just pick positive direction for both (2 point deriv, not averaged from current & last line segment!)