AutoDiffRep.h
Classes
- AutoDiffRep -- Representation of an automatic differential class data (full description)
template <class T> class AutoDiffRep
Interface
- Public Members
- AutoDiffRep()
- explicit AutoDiffRep(const T &v)
- AutoDiffRep(const T &v, const uInt ndiffs, const uInt n)
- AutoDiffRep(const T &v, const uInt ndiffs)
- AutoDiffRep(const uInt ndiffs)
- AutoDiffRep(const AutoDiffRep<T> &other)
- AutoDiffRep(const T &v, const Vector<T> &derivs)
- ~AutoDiffRep()
- AutoDiffRep<T> &operator=(const T &v)
- AutoDiffRep<T> &operator=(const AutoDiffRep<T> &other)
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
- Programs:
- Tests:
Prerequisite
Etymology
Class that represents partial derivatives obtained by automatic
differentiation.
Synopsis
Structure (only a class since cxx2html cannot handle struct) representing
the data necessary for automatic differentiation. The structure contains a
value, and the derivatives of the value with respect to the number of
dependend variables.
The actual differentiation and access is done through the
AutoDiff class.
Example
See the example in AutoDiff
Motivation
To separate the data container from the actual calculations.
To be able to create special conatiners; constructors and destructors
(including memory allocation) to speed up processes.
Template Type Argument Requirements (T)
- any class that has the standard mathematical and comparison
operators defined
To Do
Member Description
Construct a constant with a value of zero. Zero derivatives.
Construct a constant with a value of v. Zero derivatives.
AutoDiffRep(const T &v, const uInt ndiffs, const uInt n)
Given a function f(x0,x1,...,xn,...). Construct with
a total number of derivatives ndiffs. The nth derivative is one, and all
others are zero. The value v is the value of xn.
AutoDiffRep(const T &v, const uInt ndiffs)
Given a function f(x0,x1,...,xn,...). Construct with
a total number of derivatives ndiffs, and a value of xn.
All derivatives are zero.
Construct with ndiffs derivatives. All values and derivatives zero
AutoDiffRep(const AutoDiffRep<T> &other)
Construct one from another (deep copy)
AutoDiffRep(const T &v, const Vector<T> &derivs)
Construct a function f(x0,x1,...,xn) of a value v and a vector of
derivatives derivs(0) = df/dx0, derivs(1) = df/dx1, ...
Destructor
AutoDiffRep<T> &operator=(const T &v)
Assign a constant to variable. All derivatives
are zero.
AutoDiffRep<T> &operator=(const AutoDiffRep<T> &other)
Assign one to another (deep copy).