AD Mode Interface¶
XAD provides a set of interface structures that conveniently allow access to the data types needed for different AD modes. These are described in the following.
First-Order Mode Interface¶
-
template <typename T>
class adj¶ Structure defining the data types for adjoint-mode first order differentiation.
The template parameter T is the underlying basic type, typically double or float.
- typedef passive_type value_type¶
Same as passive_type
-
template <typename T>
class fwd¶ Structure defining the data types for forward-mode (tangent-linear) first order differentiation.
The template parameter T is the underlying basic type, typically double or float.
- typedef passive_type value_type¶
Same as passive_type
- typedef void tape_type¶
As forward mode does not require a tape, this is defined to void
Second-Order Mode Interface¶
Second order is performed by nesting two first-order modes.
-
template <typename T>
class fwd_adj¶ Structure defining the data types for second order forward-over-adjoint mode.
The template parameter
T
is the underlying basic type, typicallydouble
orfloat
.- typedef FReal<T> inner_type¶
The type for the inner mode, applied for the second order. In this case this is a forward AD type.
- typedef AReal<inner_type> active_type¶
Active data type for forward-over-adjoint mode differentiation
- typedef Tape<inner_type> tape_type¶
Tape type for forward-over-adjoint mode differentiation
- typedef passive_type value_type¶
Same as
passive_type
-
template <typename T>
class fwd_fwd¶ Structure defining the data types for second order forward-over-forward mode.
The template parameter T is the underlying basic type, typically
double
orfloat
.- typedef FReal<T> inner_type¶
The type for the inner mode, applied for the second order. In this case this is a forward AD type.
- typedef FReal<inner_type> active_type¶
Active data type for forward-over-forward mode differentiation
- typedef passive_type value_type¶
Same as
passive_type
- typedef void tape_type¶
As not tape is required in this mode, this is defined as
void
-
template <typename T>
class adj_fwd¶ Structure defining the data types for second order adjoint-over-forward mode.
The template parameter
T
is the underlying basic type, typicallydouble
orfloat
.- typedef AReal<T> inner_type¶
The type for the inner mode, applied for the second order. In this case this is a adjoint AD type.
- typedef FReal<inner_type> active_type¶
Active data type for adjoint-over-forward mode differentiation
- typedef passive_type value_type¶
Same as
passive_type
-
template <typename T>
class adj_adj¶ Structure defining the data types for second order adjoint-over-adjoint mode.
The template parameter
T
is the underlying basic type, typicallydouble
orfloat
.- typedef AReal<T> inner_type¶
The type for the inner mode, applied for the second order. In this case this is a adjoint AD type.
- typedef AReal<inner_type> active_type¶
Active data type for adjoint-over-adjoint mode differentiation
- typedef Tape<inner_type> outer_tape_type¶
Tape type for the first order (outer) differentiation
- typedef passive_type value_type¶
Same as
passive_type