Sacado::Fad::Expr< SFadExprTag< T, Num > > Class Template Reference

Expression template forward-mode AD class with static memory allocation. More...

#include <Sacado_Fad_SFad.hpp>

List of all members.

Public Types

typedef T value_type
 Typename of values.

Protected Attributes

val_
 Value.
dx_ [Num]
 Derivatives.

Initialization methods



 Expr ()
 Default constructor.
 Expr (const T &x)
 Constructor with supplied value x.
 Expr (const int sz, const T &x)
 Constructor with size sz and value x.
 Expr (const int sz, const int i, const T &x)
 Constructor with size sz, index i, and value x.
 Expr (const Expr &x)
 Copy constructor.
template<typename S >
 Expr (const Expr< S > &x)
 Copy constructor from any Expression object.
 ~Expr ()
 Destructor.
void diff (const int ith, const int n)
 Set Fad object as the ith independent variable.
void resize (int sz)
 Resize derivative array to length sz.
void zero ()
 Zero out the derivative array.

Value accessor methods



const T & val () const
 Returns value.
T & val ()
 Returns value.

Derivative accessor methods



int size () const
 Returns number of derivative components.
int availableSize () const
 Returns number of derivative components that can be stored without reallocation.
bool hasFastAccess () const
 Returns true if derivative array is not empty.
bool isPassive () const
 Returns true if derivative array is empty.
void setIsConstant (bool is_const)
 Set whether variable is constant.
const T * dx () const
 Returns derivative array.
const T & dx (int i) const
 Returns derivative component i with bounds checking.
T & fastAccessDx (int i)
 Returns derivative component i without bounds checking.
const T & fastAccessDx (int i) const
 Returns derivative component i without bounds checking.

Assignment operators



Expr< SFadExprTag< T, Num > > & operator= (const T &val)
 Assignment operator with constant right-hand-side.
Expr< SFadExprTag< T, Num > > & operator= (const Expr< SFadExprTag< T, Num > > &x)
 Assignment with Expr right-hand-side.
template<typename S >
Expr< SFadExprTag< T, Num > > & operator= (const Expr< S > &x)
 Assignment operator with any expression right-hand-side.

Unary operators



Expr< SFadExprTag< T, Num > > & operator+= (const T &x)
 Addition-assignment operator with constant right-hand-side.
Expr< SFadExprTag< T, Num > > & operator-= (const T &x)
 Subtraction-assignment operator with constant right-hand-side.
Expr< SFadExprTag< T, Num > > & operator*= (const T &x)
 Multiplication-assignment operator with constant right-hand-side.
Expr< SFadExprTag< T, Num > > & operator/= (const T &x)
 Division-assignment operator with constant right-hand-side.
template<typename S >
Expr< SFadExprTag< T, Num > > & operator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
template<typename S >
Expr< SFadExprTag< T, Num > > & operator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
template<typename S >
Expr< SFadExprTag< T, Num > > & operator*= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
template<typename S >
Expr< SFadExprTag< T, Num > > & operator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.

Detailed Description

template<typename T, int Num>
class Sacado::Fad::Expr< SFadExprTag< T, Num > >

Expression template forward-mode AD class with static memory allocation.

This classes specializes Expr to SFad expressions.

Definition at line 79 of file Sacado_Fad_SFad.hpp.


Member Typedef Documentation

template<typename T , int Num>
typedef T Sacado::Fad::Expr< SFadExprTag< T, Num > >::value_type

Typename of values.

Definition at line 84 of file Sacado_Fad_SFad.hpp.


Constructor & Destructor Documentation

template<typename T , int Num>
Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr (  )  [inline]

Default constructor.

Definition at line 92 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr ( const T &  x  )  [inline]

Constructor with supplied value x.

Initializes value to x and derivative array is empty

Definition at line 98 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr ( const int  sz,
const T &  x 
)

Constructor with size sz and value x.

Initializes value to x and derivative array 0 of length sz

template<typename T , int Num>
Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr ( const int  sz,
const int  i,
const T &  x 
)

Constructor with size sz, index i, and value x.

Initializes value to x and derivative array of length sz as row i of the identity matrix, i.e., sets derivative component i to 1 and all other's to zero.

template<typename T , int Num>
Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr ( const Expr< SFadExprTag< T, Num > > &  x  ) 

Copy constructor.

template<typename T , int Num>
template<typename S >
Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr ( const Expr< S > &  x  )  [inline]

Copy constructor from any Expression object.

template<typename T , int Num>
Sacado::Fad::Expr< SFadExprTag< T, Num > >::~Expr (  )  [inline]

Destructor.

Definition at line 121 of file Sacado_Fad_SFad.hpp.


Member Function Documentation

template<typename T , int Num>
void Sacado::Fad::Expr< SFadExprTag< T, Num > >::diff ( const int  ith,
const int  n 
)

Set Fad object as the ith independent variable.

Sets the derivative array of length n to the ith row of the identity matrix and has the same affect as the Implementation(const int sz, const int i, const T & x) constructor.

template<typename T , int Num>
void Sacado::Fad::Expr< SFadExprTag< T, Num > >::resize ( int  sz  ) 

Resize derivative array to length sz.

Since the derivative array length is not dynamic, this method throws an error if compiled with SACADO_DEBUG defined.

template<typename T , int Num>
void Sacado::Fad::Expr< SFadExprTag< T, Num > >::zero (  )  [inline]

Zero out the derivative array.

Definition at line 140 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
const T& Sacado::Fad::Expr< SFadExprTag< T, Num > >::val (  )  const [inline]

Returns value.

Definition at line 150 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
T& Sacado::Fad::Expr< SFadExprTag< T, Num > >::val (  )  [inline]

Returns value.

Definition at line 153 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
int Sacado::Fad::Expr< SFadExprTag< T, Num > >::size (  )  const [inline]

Returns number of derivative components.

Definition at line 163 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
int Sacado::Fad::Expr< SFadExprTag< T, Num > >::availableSize (  )  const [inline]

Returns number of derivative components that can be stored without reallocation.

Definition at line 169 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
bool Sacado::Fad::Expr< SFadExprTag< T, Num > >::hasFastAccess (  )  const [inline]

Returns true if derivative array is not empty.

Definition at line 172 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
bool Sacado::Fad::Expr< SFadExprTag< T, Num > >::isPassive (  )  const [inline]

Returns true if derivative array is empty.

Definition at line 175 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
void Sacado::Fad::Expr< SFadExprTag< T, Num > >::setIsConstant ( bool  is_const  )  [inline]

Set whether variable is constant.

Definition at line 178 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
const T* Sacado::Fad::Expr< SFadExprTag< T, Num > >::dx (  )  const [inline]

Returns derivative array.

Definition at line 181 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
const T& Sacado::Fad::Expr< SFadExprTag< T, Num > >::dx ( int  i  )  const [inline]

Returns derivative component i with bounds checking.

Definition at line 184 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
T& Sacado::Fad::Expr< SFadExprTag< T, Num > >::fastAccessDx ( int  i  )  [inline]

Returns derivative component i without bounds checking.

Definition at line 187 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
const T& Sacado::Fad::Expr< SFadExprTag< T, Num > >::fastAccessDx ( int  i  )  const [inline]

Returns derivative component i without bounds checking.

Definition at line 190 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator= ( const T &  val  ) 

Assignment operator with constant right-hand-side.

template<typename T , int Num>
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator= ( const Expr< SFadExprTag< T, Num > > &  x  ) 

Assignment with Expr right-hand-side.

template<typename T , int Num>
template<typename S >
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator= ( const Expr< S > &  x  )  [inline]

Assignment operator with any expression right-hand-side.

template<typename T , int Num>
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator+= ( const T &  x  ) 

Addition-assignment operator with constant right-hand-side.

template<typename T , int Num>
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator-= ( const T &  x  ) 

Subtraction-assignment operator with constant right-hand-side.

template<typename T , int Num>
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator*= ( const T &  x  ) 

Multiplication-assignment operator with constant right-hand-side.

template<typename T , int Num>
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator/= ( const T &  x  ) 

Division-assignment operator with constant right-hand-side.

template<typename T , int Num>
template<typename S >
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator+= ( const Expr< S > &  x  )  [inline]

Addition-assignment operator with Expr right-hand-side.

template<typename T , int Num>
template<typename S >
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator-= ( const Expr< S > &  x  )  [inline]

Subtraction-assignment operator with Expr right-hand-side.

template<typename T , int Num>
template<typename S >
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator*= ( const Expr< S > &  x  )  [inline]

Multiplication-assignment operator with Expr right-hand-side.

template<typename T , int Num>
template<typename S >
Expr< SFadExprTag<T,Num> >& Sacado::Fad::Expr< SFadExprTag< T, Num > >::operator/= ( const Expr< S > &  x  )  [inline]

Division-assignment operator with Expr right-hand-side.


Member Data Documentation

template<typename T , int Num>
T Sacado::Fad::Expr< SFadExprTag< T, Num > >::val_ [protected]

Value.

Definition at line 250 of file Sacado_Fad_SFad.hpp.

template<typename T , int Num>
T Sacado::Fad::Expr< SFadExprTag< T, Num > >::dx_[Num] [protected]

Derivatives.

Definition at line 253 of file Sacado_Fad_SFad.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:19:44 2011 for Sacado Package Browser (Single Doxygen Collection) by  doxygen 1.6.3