Sacado  Development
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Static Public Attributes | List of all members
Sacado::ELRCacheFad::Expr< GeneralFad< T, Storage > > Class Template Reference

GeneralFad expression template specialization. More...

#include <Sacado_ELRCacheFad_GeneralFadExpr.hpp>

Inheritance diagram for Sacado::ELRCacheFad::Expr< GeneralFad< T, Storage > >:
Inheritance graph
[legend]
Collaboration diagram for Sacado::ELRCacheFad::Expr< GeneralFad< T, Storage > >:
Collaboration graph
[legend]

Public Types

typedef GeneralFad< T, Storage >
::value_type 
value_type
 
typedef GeneralFad< T, Storage >
::scalar_type 
scalar_type
 
typedef GeneralFad< T, Storage > base_expr_type
 Typename of base-expressions.
 
- Public Types inherited from Sacado::ELRCacheFad::GeneralFad< T, Storage >
typedef T value_type
 Typename of values.
 
typedef ScalarType< T >::type scalar_type
 Typename of scalar's (which may be different from T)
 

Public Member Functions

 Expr ()
 Default constructor.
 
 Expr (const T &x)
 Constructor with supplied value x. More...
 
 Expr (const int sz, const T &x)
 Constructor with size sz and value x. More...
 
 Expr (const int sz, const int i, const T &x)
 Constructor with size sz, index i, and value x. More...
 
 Expr (const Expr &x)
 Copy constructor.
 
template<typename S >
 Expr (const Expr< S > &x)
 Copy constructor from any Expression object.
 
 ~Expr ()
 Destructor.
 
void computePartials (const T &bar, T partials[]) const
 Return partials w.r.t. arguments.
 
void getTangents (int i, T dots[]) const
 Return tangent component i of arguments.
 
template<int Arg>
bool isActive () const
 Return whether argument is active.
 
bool isLinear () const
 Return whether expression is linear.
 
template<int Arg>
T getTangent (int i) const
 Return tangent component i of argument Arg.
 
const base_expr_type & getArg (int j) const
 
- Public Member Functions inherited from Sacado::ELRCacheFad::GeneralFad< T, Storage >
 GeneralFad ()
 Default constructor.
 
 GeneralFad (const T &x)
 Constructor with supplied value x. More...
 
 GeneralFad (const int sz, const T &x)
 Constructor with size sz and value x. More...
 
 GeneralFad (const int sz, const int i, const T &x)
 Constructor with size sz, index i, and value x. More...
 
 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. More...
 
void setUpdateValue (bool update_val)
 Set whether this Fad object should update values.
 
bool updateValue () const
 Return whether this Fad object has an updated value.
 
void cache () const
 Cache values.
 
template<typename S >
bool isEqualTo (const Expr< S > &x) const
 Returns whether two Fad objects have the same values.
 
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.
 
GeneralFad & operator= (const T &val)
 Assignment operator with constant right-hand-side.
 
GeneralFad & operator= (const GeneralFad &x)
 Assignment with Expr right-hand-side.
 
template<typename S >
GeneralFad & operator= (const Expr< S > &x)
 Assignment operator with any expression right-hand-side.
 
GeneralFad & operator+= (const T &x)
 Addition-assignment operator with constant right-hand-side.
 
GeneralFad & operator-= (const T &x)
 Subtraction-assignment operator with constant right-hand-side.
 
GeneralFad & operator*= (const T &x)
 Multiplication-assignment operator with constant right-hand-side.
 
GeneralFad & operator/= (const T &x)
 Division-assignment operator with constant right-hand-side.
 
GeneralFad & operator+= (const typename dummy< value_type, scalar_type >::type &x)
 Addition-assignment operator with constant right-hand-side. More...
 
GeneralFad & operator-= (const typename dummy< value_type, scalar_type >::type &x)
 Subtraction-assignment operator with constant right-hand-side. More...
 
GeneralFad & operator*= (const typename dummy< value_type, scalar_type >::type &x)
 Multiplication-assignment operator with constant right-hand-side. More...
 
GeneralFad & operator/= (const typename dummy< value_type, scalar_type >::type &x)
 Division-assignment operator with constant right-hand-side. More...
 
template<typename S >
GeneralFad & operator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
 
template<typename S >
GeneralFad & operator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
 
template<typename S >
GeneralFad & operator*= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
 
template<typename S >
GeneralFad & operator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.
 

Static Public Attributes

static const int num_args = 1
 Number of arguments.
 
static const bool is_linear = true
 Is expression linear.
 

Additional Inherited Members

- Protected Attributes inherited from Sacado::ELRCacheFad::GeneralFad< T, Storage >
bool update_val_
 Update value.
 

Detailed Description

template<typename T, typename Storage>
class Sacado::ELRCacheFad::Expr< GeneralFad< T, Storage > >

GeneralFad expression template specialization.

This template class represents a simple GeneralFad expression and mixes-in the GeneralFad interface and the expression template interface using the caching expression-level-revese-mode expression templates.

Constructor & Destructor Documentation

template<typename T , typename Storage >
Sacado::ELRCacheFad::Expr< GeneralFad< T, Storage > >::Expr ( const T &  x)
inline

Constructor with supplied value x.

Initializes value to x and derivative array is empty

template<typename T , typename Storage >
Sacado::ELRCacheFad::Expr< GeneralFad< T, Storage > >::Expr ( 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

template<typename T , typename Storage >
Sacado::ELRCacheFad::Expr< GeneralFad< T, Storage > >::Expr ( 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.


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