Stokhos  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector > Class Template Reference

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

#include <Sacado_Fad_SFad_MP_Vector.hpp>

Collaboration diagram for Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >:
Collaboration graph
[legend]

Public Types

typedef Sacado::MP::Vector
< Stokhos::StaticFixedStorage
< Ord, Val, VecNum, Dev > > 
T
 
typedef RemoveConst< T >::type value_type
 Typename of values.
 
typedef ScalarType< value_type >
::type 
scalar_type
 Typename of scalar's (which may be different from T)
 
typedef SFad< value_type, Num > base_expr_type
 Typename of base-expressions.
 
typedef value_type::value_type val_type
 

Public Member Functions

template<typename S >
KOKKOS_INLINE_FUNCTION SACADO_ENABLE_VALUE_FUNC (Expr &) operator
 Assignment operator with constant right-hand-side.
 
Initialization methods
KOKKOS_INLINE_FUNCTION Expr ()
 Default constructor.
 
template<typename S >
KOKKOS_INLINE_FUNCTION Expr (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
 Constructor with supplied value x. More...
 
KOKKOS_INLINE_FUNCTION Expr (const int sz, const T &x, const DerivInit zero_out=InitDerivArray)
 Constructor with size sz and value x. More...
 
KOKKOS_INLINE_FUNCTION Expr (const int sz, const int i, const T &x)
 Constructor with size sz, index i, and value x. More...
 
KOKKOS_INLINE_FUNCTION Expr (const Expr &x)
 Copy constructor.
 
template<typename S >
KOKKOS_INLINE_FUNCTION Expr (const Expr< S > &x, SACADO_ENABLE_EXPR_CTOR_DECL)
 Copy constructor from any Expression object.
 
KOKKOS_INLINE_FUNCTION ~Expr ()
 Destructor.
 
KOKKOS_INLINE_FUNCTION void diff (const int ith, const int n)
 Set Fad object as the ith independent variable. More...
 
KOKKOS_INLINE_FUNCTION void resize (int sz)
 Resize derivative array to length sz. More...
 
KOKKOS_INLINE_FUNCTION void expand (int sz)
 Expand derivative array to size sz. More...
 
KOKKOS_INLINE_FUNCTION void zero ()
 Zero out the derivative array.
 
KOKKOS_INLINE_FUNCTION void setUpdateValue (bool update_val)
 Set whether this Fad object should update values.
 
KOKKOS_INLINE_FUNCTION bool updateValue () const
 Return whether this Fad object has an updated value.
 
template<typename S >
KOKKOS_INLINE_FUNCTION SACADO_ENABLE_EXPR_FUNC (bool) isEqualTo(const Expr< S > &x) const
 Returns whether two Fad objects have the same values.
 
Value accessor methods
KOKKOS_INLINE_FUNCTION const Tval () const
 Returns value.
 
KOKKOS_INLINE_FUNCTION Tval ()
 Returns value.
 
KOKKOS_INLINE_FUNCTION const
val_type & 
val (int j) const
 Returns value.
 
KOKKOS_INLINE_FUNCTION val_type & val (int j)
 Returns value.
 
Derivative accessor methods
KOKKOS_INLINE_FUNCTION int size () const
 Returns number of derivative components.
 
KOKKOS_INLINE_FUNCTION int availableSize () const
 Returns number of derivative components that can be stored without reallocation.
 
KOKKOS_INLINE_FUNCTION bool hasFastAccess () const
 Returns true if derivative array is not empty.
 
KOKKOS_INLINE_FUNCTION bool isPassive () const
 Returns true if derivative array is empty.
 
KOKKOS_INLINE_FUNCTION void setIsConstant (bool is_const)
 Set whether variable is constant.
 
KOKKOS_INLINE_FUNCTION const Tdx () const
 Returns derivative array.
 
KOKKOS_INLINE_FUNCTION const Tdx (int i) const
 Returns derivative component i with bounds checking.
 
KOKKOS_INLINE_FUNCTION TfastAccessDx (int i)
 Returns derivative component i without bounds checking.
 
KOKKOS_INLINE_FUNCTION const TfastAccessDx (int i) const
 Returns derivative component i without bounds checking.
 
KOKKOS_INLINE_FUNCTION const
val_type & 
dx (int i, int j) const
 Returns derivative component i with bounds checking.
 
KOKKOS_INLINE_FUNCTION val_type & fastAccessDx (int i, int j)
 Returns derivative component i without bounds checking.
 
KOKKOS_INLINE_FUNCTION const
val_type & 
fastAccessDx (int i, int j) const
 Returns derivative component i without bounds checking.
 

Public Attributes

T val_
 Value.
 

Detailed Description

template<typename Ord, typename Val, int VecNum, typename Dev, int Num>
class Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >

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

This classes specializes Expr to SFad expressions.

Constructor & Destructor Documentation

template<typename Ord , typename Val , int VecNum, typename Dev , int Num>
template<typename S >
KOKKOS_INLINE_FUNCTION Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >::Expr ( const S &  x,
SACADO_ENABLE_VALUE_CTOR_DECL   
)
inline

Constructor with supplied value x.

Initializes value to x and derivative array is empty

template<typename Ord , typename Val , int VecNum, typename Dev , int Num>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >::Expr ( const int  sz,
const T 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 Ord , typename Val , int VecNum, typename Dev , int Num>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >::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.

Member Function Documentation

template<typename Ord , typename Val , int VecNum, typename Dev , int Num>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >::diff ( const int  ith,
const int  n 
)
inline

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 Ord , typename Val , int VecNum, typename Dev , int Num>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >::expand ( int  sz)
inline

Expand derivative array to size sz.

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

template<typename Ord , typename Val , int VecNum, typename Dev , int Num>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Expr< SFadExprTag< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Num >, ExprSpecMPVector >::resize ( int  sz)
inline

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.


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