Global functions
This section lists functions that are specific to the active data types and tape management. For mathematical functions, see Mathematical Operations.
value
value(T& x) returns a reference (or const-reference if x is constant) to the value stored in x.
If x is a XAD active data type, such as AReal or FReal, this function returns a reference to the stored value (which is assignable).
If x is a passive data type, this function simply returns the value itself.
This function is especially useful in generic code, as it is defined on any data type.
derivative
derivative(const T& x) returns a reference (or const-reference if x is constant) to the derivative stored in x.
If x is a XAD active data type, such as AReal or FReal, this function returns a reference to the stored derivative (which is assignable).
If x is a passive data type, this function simply returns 0.
This function is especially useful in generic code, as it is defined on any data type.
Questions or issues: GitHub Discussions · issues. Would you rather we AAD-enabled your code? Get a free speed-up estimate.