casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Public Attributes
casa::AutoDiffRep< T > Class Template Reference

Representation of an automatic differential class data. More...

#include <AutoDiffRep.h>

List of all members.

Public Types

typedef T value_type
typedef value_typereference
typedef const value_typeconst_reference
typedef value_typeiterator
typedef const value_typeconst_iterator

Public Member Functions

 AutoDiffRep ()
 Construct a constant with a value of zero.
 AutoDiffRep (const T &v)
 Construct a constant with a value of v.
 AutoDiffRep (const T &v, const uInt ndiffs, const uInt n)
 Given a function f(x0,x1,...,xn,...).
 AutoDiffRep (const T &v, const uInt ndiffs)
 Given a function f(x0,x1,...,xn,...).
 AutoDiffRep (const uInt ndiffs)
 Construct with ndiffs derivatives.
 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, ...
 ~AutoDiffRep ()
 Destructor.
AutoDiffRep< T > & operator= (const T &v)
 Assign a constant to variable.
AutoDiffRep< T > & operator= (const AutoDiffRep< T > &other)
 Assign one to another (deep copy).

Public Attributes

val_p
 The function value.
uInt nd_p
 The number of derivatives.
Bool nocopy_p
 A flag indicating that value will not be used anymore (to stop superfluous copying)
Vector< T > grad_p
 The derivatives.

Detailed Description

template<class T>
class casa::AutoDiffRep< T >

Representation of an automatic differential class data.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tAutoDiff

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)

To Do

Definition at line 85 of file AutoDiffRep.h.


Member Typedef Documentation

template<class T>
typedef const value_type* casa::AutoDiffRep< T >::const_iterator

Definition at line 92 of file AutoDiffRep.h.

template<class T>
typedef const value_type& casa::AutoDiffRep< T >::const_reference

Definition at line 90 of file AutoDiffRep.h.

template<class T>
typedef value_type* casa::AutoDiffRep< T >::iterator

Definition at line 91 of file AutoDiffRep.h.

template<class T>
typedef value_type& casa::AutoDiffRep< T >::reference

Definition at line 89 of file AutoDiffRep.h.

template<class T>
typedef T casa::AutoDiffRep< T >::value_type

Definition at line 88 of file AutoDiffRep.h.


Constructor & Destructor Documentation

template<class T>
casa::AutoDiffRep< T >::AutoDiffRep ( )

Construct a constant with a value of zero.

Zero derivatives.

template<class T>
casa::AutoDiffRep< T >::AutoDiffRep ( const T &  v) [explicit]

Construct a constant with a value of v.

Zero derivatives.

template<class T>
casa::AutoDiffRep< T >::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.

template<class T>
casa::AutoDiffRep< T >::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.

template<class T>
casa::AutoDiffRep< T >::AutoDiffRep ( const uInt  ndiffs)

Construct with ndiffs derivatives.

All values and derivatives zero

template<class T>
casa::AutoDiffRep< T >::AutoDiffRep ( const AutoDiffRep< T > &  other)

Construct one from another (deep copy)

template<class T>
casa::AutoDiffRep< T >::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, ...

template<class T>
casa::AutoDiffRep< T >::~AutoDiffRep ( )

Destructor.


Member Function Documentation

template<class T>
AutoDiffRep<T>& casa::AutoDiffRep< T >::operator= ( const T &  v)

Assign a constant to variable.

All derivatives are zero.

template<class T>
AutoDiffRep<T>& casa::AutoDiffRep< T >::operator= ( const AutoDiffRep< T > &  other)

Assign one to another (deep copy).


Member Data Documentation

template<class T>
Vector<T> casa::AutoDiffRep< T >::grad_p

The derivatives.

Definition at line 143 of file AutoDiffRep.h.

template<class T>
uInt casa::AutoDiffRep< T >::nd_p

The number of derivatives.

Definition at line 138 of file AutoDiffRep.h.

template<class T>
Bool casa::AutoDiffRep< T >::nocopy_p

A flag indicating that value will not be used anymore (to stop superfluous copying)

Definition at line 141 of file AutoDiffRep.h.

template<class T>
T casa::AutoDiffRep< T >::val_p

The function value.

Definition at line 136 of file AutoDiffRep.h.


The documentation for this class was generated from the following file: