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§
- Sample
Derivative Wrapper - A wrapper that uses a
SampleDerivative<T>
curve to produce aCurve<WithDerivative<T>>
. - Sample
TwoDerivatives Wrapper - A wrapper that uses a
SampleTwoDerivatives<T>
curve to produce aCurve<WithTwoDerivatives<T>>
.
Traits§
- Curve
With Derivative - Trait for curves that have a well-defined notion of derivative, allowing for derivatives to be extracted along with values.
- Curve
With TwoDerivatives - Trait for curves that have a well-defined notion of second derivative, allowing for two derivatives to be extracted along with values.
- Sample
Derivative - A trait for curves that can sample derivatives in addition to values.
- Sample
TwoDerivatives - A trait for curves that can sample two derivatives in addition to values.