Sacado Package Browser (Single Doxygen Collection) Version of the Day
Public Types
Sacado::Fad::GeneralFad< T, Storage > Class Template Reference

Forward-mode AD class templated on the storage for the derivative array. More...

#include <Sacado_Fad_GeneralFad.hpp>

Inheritance diagram for Sacado::Fad::GeneralFad< T, Storage >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef T value_type
 Typename of values.
typedef ScalarType< T >::type scalar_type
 Typename of scalar's (which may be different from T)

Initialization methods

 GeneralFad ()
 Default constructor.
 GeneralFad (const T &x)
 Constructor with supplied value x.
 GeneralFad (const int sz, const T &x)
 Constructor with size sz and value x.
 GeneralFad (const int sz, const int i, const T &x)
 Constructor with size sz, index i, and value x.
 GeneralFad (const GeneralFad &x)
 Copy constructor.
template<typename S >
 GeneralFad (const Expr< S > &x)
 Copy constructor from any Expression object.
 ~GeneralFad ()
 Destructor.
void diff (const int ith, const int n)
 Set GeneralFad object as the ith independent variable.

Derivative accessor methods

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.

Assignment operators

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

Unary operators

GeneralFadoperator+= (const T &x)
 Addition-assignment operator with constant right-hand-side.
GeneralFadoperator-= (const T &x)
 Subtraction-assignment operator with constant right-hand-side.
GeneralFadoperator*= (const T &x)
 Multiplication-assignment operator with constant right-hand-side.
GeneralFadoperator/= (const T &x)
 Division-assignment operator with constant right-hand-side.
GeneralFadoperator+= (const typename dummy< value_type, scalar_type >::type &x)
 Addition-assignment operator with constant right-hand-side.
GeneralFadoperator-= (const typename dummy< value_type, scalar_type >::type &x)
 Subtraction-assignment operator with constant right-hand-side.
GeneralFadoperator*= (const typename dummy< value_type, scalar_type >::type &x)
 Multiplication-assignment operator with constant right-hand-side.
GeneralFadoperator/= (const typename dummy< value_type, scalar_type >::type &x)
 Division-assignment operator with constant right-hand-side.
template<typename S >
GeneralFadoperator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
template<typename S >
GeneralFadoperator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
template<typename S >
GeneralFadoperator*= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
template<typename S >
GeneralFadoperator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.

Detailed Description

template<typename T, typename Storage>
class Sacado::Fad::GeneralFad< T, Storage >

Forward-mode AD class templated on the storage for the derivative array.

This class provides a general forward mode AD implementation for any type of derivative array storage. It does not incorporate expression templates.

Definition at line 72 of file Sacado_Fad_GeneralFad.hpp.


Member Typedef Documentation

template<typename T, typename Storage>
typedef T Sacado::Fad::GeneralFad< T, Storage >::value_type

Typename of values.

Definition at line 77 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
typedef ScalarType<T>::type Sacado::Fad::GeneralFad< T, Storage >::scalar_type

Typename of scalar's (which may be different from T)

Definition at line 80 of file Sacado_Fad_GeneralFad.hpp.


Constructor & Destructor Documentation

template<typename T, typename Storage>
Sacado::Fad::GeneralFad< T, Storage >::GeneralFad ( ) [inline]

Default constructor.

Definition at line 88 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
Sacado::Fad::GeneralFad< T, Storage >::GeneralFad ( const T &  x) [inline]

Constructor with supplied value x.

Initializes value to x and derivative array is empty

Definition at line 94 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
Sacado::Fad::GeneralFad< T, Storage >::GeneralFad ( const int  sz,
const T &  x 
) [inline]

Constructor with size sz and value x.

Initializes value to x and derivative array 0 of length sz

Definition at line 100 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
Sacado::Fad::GeneralFad< T, Storage >::GeneralFad ( const int  sz,
const int  i,
const T &  x 
) [inline]

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.

Definition at line 108 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
Sacado::Fad::GeneralFad< T, Storage >::GeneralFad ( const GeneralFad< T, Storage > &  x) [inline]

Copy constructor.

Definition at line 114 of file Sacado_Fad_GeneralFad.hpp.

template<typename T , typename Storage >
template<typename S >
Sacado::Fad::GeneralFad< T, Storage >::GeneralFad ( const Expr< S > &  x) [inline]

Copy constructor from any Expression object.

Definition at line 58 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage>
Sacado::Fad::GeneralFad< T, Storage >::~GeneralFad ( ) [inline]

Destructor.

Definition at line 121 of file Sacado_Fad_GeneralFad.hpp.


Member Function Documentation

template<typename T , typename Storage >
void Sacado::Fad::GeneralFad< T, Storage >::diff ( const int  ith,
const int  n 
) [inline]

Set GeneralFad 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.

Definition at line 81 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage>
int Sacado::Fad::GeneralFad< T, Storage >::availableSize ( ) const [inline]

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

Definition at line 143 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
bool Sacado::Fad::GeneralFad< T, Storage >::hasFastAccess ( ) const [inline]

Returns true if derivative array is not empty.

Definition at line 146 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
bool Sacado::Fad::GeneralFad< T, Storage >::isPassive ( ) const [inline]

Returns true if derivative array is empty.

Definition at line 149 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage>
void Sacado::Fad::GeneralFad< T, Storage >::setIsConstant ( bool  is_const) [inline]

Set whether variable is constant.

Definition at line 152 of file Sacado_Fad_GeneralFad.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator= ( const T &  val) [inline]

Assignment operator with constant right-hand-side.

Reimplemented in Sacado::Fad::SimpleFad< ValueT >.

Definition at line 93 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator= ( const GeneralFad< T, Storage > &  x) [inline]

Assignment with Expr right-hand-side.

Definition at line 107 of file Sacado_Fad_GeneralFadImp.hpp.

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

Assignment operator with any expression right-hand-side.

Definition at line 119 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator+= ( const T &  x) [inline]

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

Definition at line 142 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator-= ( const T &  x) [inline]

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

Definition at line 151 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator*= ( const T &  x) [inline]

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

Definition at line 160 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator/= ( const T &  x) [inline]

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

Definition at line 173 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator+= ( const typename dummy< value_type, scalar_type >::type &  x) [inline]

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

Creates a dummy overload when value_type and scalar_type are the same type.

Definition at line 187 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator-= ( const typename dummy< value_type, scalar_type >::type &  x) [inline]

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

Creates a dummy overload when value_type and scalar_type are the same type.

Definition at line 197 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator*= ( const typename dummy< value_type, scalar_type >::type &  x) [inline]

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

Creates a dummy overload when value_type and scalar_type are the same type.

Definition at line 207 of file Sacado_Fad_GeneralFadImp.hpp.

template<typename T, typename Storage >
Sacado::Fad::GeneralFad< T, Storage > & Sacado::Fad::GeneralFad< T, Storage >::operator/= ( const typename dummy< value_type, scalar_type >::type &  x) [inline]

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

Creates a dummy overload when value_type and scalar_type are the same type.

Definition at line 221 of file Sacado_Fad_GeneralFadImp.hpp.

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

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

Definition at line 235 of file Sacado_Fad_GeneralFadImp.hpp.

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

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

Definition at line 272 of file Sacado_Fad_GeneralFadImp.hpp.

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

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

Definition at line 310 of file Sacado_Fad_GeneralFadImp.hpp.

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

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

Definition at line 355 of file Sacado_Fad_GeneralFadImp.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines