Global Functions

This section lists functions that are specific to the active data types and tape management. For mathematical function, see Mathematical Operations.

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 simple returns the value itself.

This function is especially useful in generic code, as it is defined on any data type.

Parameters:
T &x

An active or passive variable

Returns:

Reference to the value stored in x

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.

Parameters:
const T &x

An active or passive variable

Returns:

Reference to the derivative associated with x


Last update: September 2022