Module dual

Source
Expand description

Toolset for forward mode automatic differentiation (AD).

§AD Architecture

The entire rateslib library is built around three core numeric types: f64, Dual and Dual2. Obviously f64 allows for traditional computation, which benefits from efficient calculation leveraging BLAS, while Dual and Dual2 reduce performance of traditional calculation but provide efficient calculation of first order and second order derivatives, respectively. Derivatives are calculated using forward mode AD, similar, but not identical, to the Julia ForwardDiff library.

Mathematical operations are defined to give dual numbers the ability to combine, and flexibly reference different variables at any point during calculations.

Modules§

docs
Standalone documentation pages.
linalg
Perform linear algebra operations involving Arrays of f64, Dual and Dual2.

Structs§

Dual
A dual number data type supporting first order derivatives.
Dual2
A dual number data type supporting second order derivatives.

Enums§

ADOrder
Defines the order of gradients available in a calculation with AD.
Number
Container for the three core numeric types; f64, Dual and Dual2.
NumberArray1
Container for Array1 of each core numeric type.
NumberArray2
Container for Array2 of each core numeric type.
NumberPPSpline
Container for PPSpline definitive type variants.
NumberVec
Container for Vec of each core numeric type.
VarsRelationship
The state of the vars measured between two dual number type structs; a LHS relative to a RHS.

Traits§

Gradient1
Provides calculations of first order gradients to all, or a set of provided, vars.
Gradient2
Provides calculations of second order gradients to all, or a set of provided, vars.
MathFuncs
Functions for common mathematical operations.
NumberMapping
Generic trait indicating a function exists to map one Number to another.
NumberOps
Vars
Manages the vars of the manifold associated with a dual number.

Functions§

set_order
Convert a Number of one ADOrder to another and consume the value.
set_order_clone
Convert a Number of one ADOrder to another.