casacore
Public Types | Public Member Functions | Public Attributes | List of all members
casacore::AutoDiffRep< T > Class Template Reference

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

#include <AutoDiffRep.h>

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

Public Attributes

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

Detailed Description

template<class T>
class casacore::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

§ const_iterator

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

Definition at line 92 of file AutoDiffRep.h.

§ const_reference

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

Definition at line 90 of file AutoDiffRep.h.

§ iterator

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

Definition at line 91 of file AutoDiffRep.h.

§ reference

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

Definition at line 89 of file AutoDiffRep.h.

§ value_type

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

Definition at line 88 of file AutoDiffRep.h.

Constructor & Destructor Documentation

§ AutoDiffRep() [1/7]

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

Construct a constant with a value of zero.

Zero derivatives.

§ AutoDiffRep() [2/7]

template<class T>
casacore::AutoDiffRep< T >::AutoDiffRep ( const T &  v)
explicit

Construct a constant with a value of v.

Zero derivatives.

§ AutoDiffRep() [3/7]

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

§ AutoDiffRep() [4/7]

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

§ AutoDiffRep() [5/7]

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

Construct with ndiffs derivatives.

All values and derivatives zero

§ AutoDiffRep() [6/7]

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

Construct one from another (deep copy)

§ AutoDiffRep() [7/7]

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

§ ~AutoDiffRep()

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

Destructor.

Member Function Documentation

§ operator=() [1/2]

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

Assign a constant to variable.

All derivatives are zero.

§ operator=() [2/2]

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

Assign one to another (deep copy).

Member Data Documentation

§ grad_p

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

The derivatives.

Definition at line 143 of file AutoDiffRep.h.

§ nd_p

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

The number of derivatives.

Definition at line 138 of file AutoDiffRep.h.

Referenced by casacore::AutoDiff< T >::release().

§ nocopy_p

template<class T>
Bool casacore::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.

Referenced by casacore::AutoDiff< T >::release().

§ val_p

template<class T>
T casacore::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: