Module derivatives

Source
Expand description

This module holds traits related to extracting derivatives from curves. In applications, the derivatives of interest are chiefly the first and second; in this module, these are provided by the traits CurveWithDerivative and CurveWithTwoDerivatives.

These take ownership of the curve they are used on by default, so that the resulting output may be used in more durable contexts. For example, CurveWithDerivative<T> is not dyn-compatible, but Curve<WithDerivative<T>> is, so if such a curve needs to be stored in a dynamic context, calling with_derivative and then placing the result in a Box<Curve<WithDerivative<T>>> is sensible.

On the other hand, in more transient contexts, consuming a value merely to sample derivatives is inconvenient, and in these cases, it is recommended to use by_ref when possible to create a referential curve first, retaining liveness of the original.

This module also holds the SampleDerivative and SampleTwoDerivatives traits, which can be used to easily implement CurveWithDerivative and its counterpart.

Modules§

adaptor_impls
Implementations of derivatives on curve adaptors. These allow compositionality for derivatives.

Structs§

SampleDerivativeWrapper
A wrapper that uses a SampleDerivative<T> curve to produce a Curve<WithDerivative<T>>.
SampleTwoDerivativesWrapper
A wrapper that uses a SampleTwoDerivatives<T> curve to produce a Curve<WithTwoDerivatives<T>>.

Traits§

CurveWithDerivative
Trait for curves that have a well-defined notion of derivative, allowing for derivatives to be extracted along with values.
CurveWithTwoDerivatives
Trait for curves that have a well-defined notion of second derivative, allowing for two derivatives to be extracted along with values.
SampleDerivative
A trait for curves that can sample derivatives in addition to values.
SampleTwoDerivatives
A trait for curves that can sample two derivatives in addition to values.