Sacado  Development
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Sacado::Fad::DMFad< ValueT > Class Template Reference

Forward-mode AD class using dynamic memory allocation and expression templates. More...

#include <Sacado_Fad_DMFad.hpp>

Inheritance diagram for Sacado::Fad::DMFad< ValueT >:
Inheritance graph
[legend]
Collaboration diagram for Sacado::Fad::DMFad< ValueT >:
Collaboration graph
[legend]

Classes

struct  apply
 Turn DMFad into a meta-function class usable with mpl::apply. More...
 

Public Types

typedef MemPoolStorage< ValueT > StorageType
 Base classes.
 
typedef GeneralFad< ValueT,
StorageType
GeneralFadType
 
typedef Expr< GeneralFadTypeExprType
 
typedef ExprType::value_type value_type
 Typename of values.
 
typedef ExprType::scalar_type scalar_type
 Typename of scalar's (which may be different from value_type)
 
typedef ScalarType< ValueT >::type ScalarT
 Typename of scalar's (which may be different from ValueT)
 
- Public Types inherited from Sacado::Fad::Expr< GeneralFad< ValueT, MemPoolStorage< ValueT > > >
typedef GeneralFad< ValueT,
MemPoolStorage< ValueT > > 
value_type
 

Public Member Functions

 ~DMFad ()
 Destructor.
 
template<typename S >
Sacado::mpl::enable_if
< Sacado::mpl::is_convertible
< S, value_type >, DMFad & >
::type 
operator= (const S &v)
 Assignment operator with constant right-hand-side.
 
DMFadoperator= (const DMFad &x)
 Assignment operator with DMFad right-hand-side.
 
template<typename S >
mpl::enable_if_c
< mpl::is_convertible
< typename Expr< S >
::value_type, value_type >
::value &&ExprLevel< typename
Expr< S >::value_type >::value==ExprLevel
< value_type >::value, DMFad & >
::type 
operator= (const Expr< S > &x)
 Assignment operator with any expression right-hand-side.
 
template<typename S >
Sacado::mpl::enable_if
< Sacado::mpl::is_convertible
< S, value_type >, DMFad & >
::type 
operator+= (const S &x)
 Addition-assignment operator with constant right-hand-side.
 
template<typename S >
Sacado::mpl::enable_if
< Sacado::mpl::is_convertible
< S, value_type >, DMFad & >
::type 
operator-= (const S &x)
 Subtraction-assignment operator with constant right-hand-side.
 
template<typename S >
Sacado::mpl::enable_if
< Sacado::mpl::is_convertible
< S, value_type >, DMFad & >
::type 
operator*= (const S &x)
 Multiplication-assignment operator with constant right-hand-side.
 
template<typename S >
Sacado::mpl::enable_if
< Sacado::mpl::is_convertible
< S, value_type >, DMFad & >
::type 
operator/= (const S &x)
 Division-assignment operator with constant right-hand-side.
 
DMFadoperator+= (const DMFad &x)
 Addition-assignment operator with DMFad right-hand-side.
 
DMFadoperator-= (const DMFad &x)
 Subtraction-assignment operator with DMFad right-hand-side.
 
DMFadoperator*= (const DMFad &x)
 Multiplication-assignment operator with DMFad right-hand-side.
 
DMFadoperator/= (const DMFad &x)
 Division-assignment operator with DMFad right-hand-side.
 
template<typename S >
mpl::enable_if_c
< mpl::is_convertible
< typename Expr< S >
::value_type, value_type >
::value &&ExprLevel< typename
Expr< S >::value_type >::value==ExprLevel
< value_type >::value, DMFad & >
::type 
operator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
 
template<typename S >
mpl::enable_if_c
< mpl::is_convertible
< typename Expr< S >
::value_type, value_type >
::value &&ExprLevel< typename
Expr< S >::value_type >::value==ExprLevel
< value_type >::value, DMFad & >
::type 
operator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
 
template<typename S >
mpl::enable_if_c
< mpl::is_convertible
< typename Expr< S >
::value_type, value_type >
::value &&ExprLevel< typename
Expr< S >::value_type >::value==ExprLevel
< value_type >::value, DMFad & >
::type 
operator*= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
 
template<typename S >
mpl::enable_if_c
< mpl::is_convertible
< typename Expr< S >
::value_type, value_type >
::value &&ExprLevel< typename
Expr< S >::value_type >::value==ExprLevel
< value_type >::value, DMFad & >
::type 
operator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.
 
Initialization methods
 DMFad ()
 Default constructor. More...
 
template<typename S >
 DMFad (const S &x, typename Sacado::mpl::enable_if< Sacado::mpl::is_convertible< S, value_type >, void * >::type=0)
 Constructor with supplied value x convertible to ValueT. More...
 
 DMFad (const int sz, const ValueT &x, const DerivInit zero_out=InitDerivArray)
 Constructor with size sz and value x. More...
 
 DMFad (const int sz, const int i, const ValueT &x)
 Constructor with size sz, index i, and value x. More...
 
 DMFad (const DMFad &x)
 Copy constructor.
 
template<typename S >
 DMFad (const Expr< S > &x, typename mpl::enable_if_c< mpl::is_convertible< typename Expr< S >::value_type, value_type >::value &&ExprLevel< typename Expr< S >::value_type >::value==ExprLevel< value_type >::value, void * >::type=0)
 Copy constructor from any Expression object.
 

Static Public Member Functions

static void setDefaultPool (MemPool *pool)
 Set the default memory pool for new objects.
 

Detailed Description

template<typename ValueT>
class Sacado::Fad::DMFad< ValueT >

Forward-mode AD class using dynamic memory allocation and expression templates.

This is the user-level class for forward mode AD with dynamic memory allocation, and is appropriate for whenever the number of derivative components is not known at compile time. The user interface is provided by Sacado::Fad::GeneralFad.

Constructor & Destructor Documentation

template<typename ValueT>
Sacado::Fad::DMFad< ValueT >::DMFad ( )
inline

Default constructor.

Initializes value to 0 and derivative array is empty

template<typename ValueT>
template<typename S >
Sacado::Fad::DMFad< ValueT >::DMFad ( const S &  x,
typename Sacado::mpl::enable_if< Sacado::mpl::is_convertible< S, value_type >, void * >::type  = 0 
)
inline

Constructor with supplied value x convertible to ValueT.

Initializes value to ValueT(x) and derivative array is empty.

template<typename ValueT>
Sacado::Fad::DMFad< ValueT >::DMFad ( const int  sz,
const ValueT &  x,
const DerivInit  zero_out = InitDerivArray 
)
inline

Constructor with size sz and value x.

Initializes value to x and derivative array 0 of length sz

template<typename ValueT>
Sacado::Fad::DMFad< ValueT >::DMFad ( const int  sz,
const int  i,
const ValueT &  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.


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