Sacado  Development
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Classes | Public Types | Public Member Functions
Sacado::ELRCacheFad::ViewFad< ValueT, length, stride > Class Template Reference

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

#include <Sacado_ELRCacheFad_ViewFad.hpp>

Inheritance diagram for Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >:
Inheritance graph
[legend]
Collaboration diagram for Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >:
Collaboration graph
[legend]

List of all members.

Classes

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

Public Types

typedef Fad::ViewStorage
< ValueT, length, stride > 
StorageType
 Base classes.
typedef GeneralFad< ValueT,
StorageType
GeneralFadType
typedef Expr< GeneralFadTypeExprType
typedef ScalarType< ValueT >::type ScalarT
 Typename of scalar's (which may be different from ValueT)

Public Member Functions

 ~ViewFad ()
 Destructor.
ViewFadoperator= (const ValueT &v)
 Assignment operator with constant right-hand-side.
ViewFadoperator= (const typename dummy< ValueT, ScalarT >::type &v)
 Assignment operator with constant right-hand-side.
ViewFadoperator= (const ViewFad &x)
 Assignment operator with ViewFad right-hand-side.
template<typename S >
ViewFadoperator= (const Expr< S > &x)
 Assignment operator with any expression right-hand-side.
Initialization methods
 ViewFad ()
 Default constructor.
 ViewFad (const ValueT &x)
 Constructor with supplied value x of type ValueT.
 ViewFad (const typename dummy< ValueT, ScalarT >::type &x)
 Constructor with supplied value x of type ScalarT.
 ViewFad (const int sz, const ValueT &x)
 Constructor with size sz and value x.
 ViewFad (const int sz, const int i, const ValueT &x)
 Constructor with size sz, index i, and value x.
 ViewFad (const ViewFad &x)
 Copy constructor.
template<typename S >
 ViewFad (const Expr< S > &x)
 Copy constructor from any Expression object.
 ViewFad (const StorageType &s)
 Constructor with supplied storage s.
 ViewFad (ValueT *v, const int arg_size=0, const int arg_stride=0)
 View-specific constructor.
Unary operators
ViewFadoperator+= (const ValueT &x)
 Addition-assignment operator with constant right-hand-side.
ViewFadoperator-= (const ValueT &x)
 Subtraction-assignment operator with constant right-hand-side.
ViewFadoperator*= (const ValueT &x)
 Multiplication-assignment operator with constant right-hand-side.
ViewFadoperator/= (const ValueT &x)
 Division-assignment operator with constant right-hand-side.
ViewFadoperator+= (const typename dummy< ValueT, ScalarT >::type &x)
 Addition-assignment operator with constant right-hand-side.
ViewFadoperator-= (const typename dummy< ValueT, ScalarT >::type &x)
 Subtraction-assignment operator with constant right-hand-side.
ViewFadoperator*= (const typename dummy< ValueT, ScalarT >::type &x)
 Multiplication-assignment operator with constant right-hand-side.
ViewFadoperator/= (const typename dummy< ValueT, ScalarT >::type &x)
 Division-assignment operator with constant right-hand-side.
template<typename S >
ViewFadoperator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
template<typename S >
ViewFadoperator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
template<typename S >
ViewFadoperator*= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
template<typename S >
ViewFadoperator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.

Detailed Description

template<typename ValueT, unsigned length, unsigned stride>
class Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >

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 , unsigned length, unsigned stride>
Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::ViewFad ( ) [inline]

Default constructor.

Initializes value to 0 and derivative array is empty

template<typename ValueT , unsigned length, unsigned stride>
Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::ViewFad ( const ValueT &  x) [inline]

Constructor with supplied value x of type ValueT.

Initializes value to x and derivative array is empty

template<typename ValueT , unsigned length, unsigned stride>
Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::ViewFad ( const typename dummy< ValueT, ScalarT >::type &  x) [inline]

Constructor with supplied value x of type ScalarT.

Initializes value to ValueT(x) and derivative array is empty. Creates a dummy overload when ValueT and ScalarT are the same type.

template<typename ValueT , unsigned length, unsigned stride>
Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::ViewFad ( const int  sz,
const ValueT &  x 
) [inline]

Constructor with size sz and value x.

Initializes value to x and derivative array 0 of length sz

template<typename ValueT , unsigned length, unsigned stride>
Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::ViewFad ( 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.


Member Function Documentation

template<typename ValueT , unsigned length, unsigned stride>
ViewFad& Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::operator*= ( const typename dummy< ValueT, ScalarT >::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.

template<typename ValueT , unsigned length, unsigned stride>
ViewFad& Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::operator+= ( const typename dummy< ValueT, ScalarT >::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.

template<typename ValueT , unsigned length, unsigned stride>
ViewFad& Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::operator-= ( const typename dummy< ValueT, ScalarT >::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.

template<typename ValueT , unsigned length, unsigned stride>
ViewFad& Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::operator/= ( const typename dummy< ValueT, ScalarT >::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.

template<typename ValueT , unsigned length, unsigned stride>
ViewFad& Sacado::ELRCacheFad::ViewFad< ValueT, length, stride >::operator= ( const typename dummy< ValueT, ScalarT >::type &  v) [inline]

Assignment operator with constant right-hand-side.

Creates a dummy overload when ValueT and ScalarT are the same type.


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