Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 1.07 KB

global.md

File metadata and controls

28 lines (17 loc) · 1.07 KB

Global Functions

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

value

#!c++ 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.

derivative

#!c++ 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.