Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | List of all members
Sacado::ELRCacheFad::GeneralFad< T, Storage > Class Template Reference

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

#include <Sacado_ELRCacheFad_GeneralFad.hpp>

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

Classes

struct  SlowLocalAccumOp
 

Public Types

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

Public Member Functions

template<typename S >
KOKKOS_INLINE_FUNCTION SACADO_ENABLE_VALUE_FUNC (GeneralFad &) operator
 Assignment operator with constant right-hand-side. More...
 

Initialization methods

KOKKOS_INLINE_FUNCTION GeneralFad ()
 Default constructor. More...
 
template<typename S >
KOKKOS_INLINE_FUNCTION GeneralFad (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
 Constructor with supplied value x. More...
 
KOKKOS_INLINE_FUNCTION GeneralFad (const int sz, const T &x, const DerivInit zero_out=InitDerivArray)
 Constructor with size sz and value x. More...
 
KOKKOS_INLINE_FUNCTION GeneralFad (const int sz, const int i, const T &x)
 Constructor with size sz, index i, and value x. More...
 
KOKKOS_INLINE_FUNCTION GeneralFad (const Storage &s)
 Constructor with supplied storage s. More...
 
KOKKOS_INLINE_FUNCTION GeneralFad (const GeneralFad &x)
 Copy constructor. More...
 
template<typename S >
KOKKOS_INLINE_FUNCTION GeneralFad (const Expr< S > &x, SACADO_ENABLE_EXPR_CTOR_DECL)
 Copy constructor from any Expression object. More...
 
KOKKOS_INLINE_FUNCTION ~GeneralFad ()
 Destructor. More...
 
KOKKOS_INLINE_FUNCTION void diff (const int ith, const int n)
 Set GeneralFad object as the ith independent variable. More...
 
KOKKOS_INLINE_FUNCTION void setUpdateValue (bool update_val)
 Set whether this Fad object should update values. More...
 
KOKKOS_INLINE_FUNCTION bool updateValue () const
 Return whether this Fad object has an updated value. More...
 
KOKKOS_INLINE_FUNCTION void cache () const
 Cache values. More...
 
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. More...
 

Derivative accessor methods

KOKKOS_INLINE_FUNCTION int availableSize () const
 Returns number of derivative components that can be stored without reallocation. More...
 
KOKKOS_INLINE_FUNCTION bool hasFastAccess () const
 Returns true if derivative array is not empty. More...
 
KOKKOS_INLINE_FUNCTION bool isPassive () const
 Returns true if derivative array is empty. More...
 
KOKKOS_INLINE_FUNCTION void setIsConstant (bool is_const)
 Set whether variable is constant. More...
 

Detailed Description

template<typename T, typename Storage>
class Sacado::ELRCacheFad::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 71 of file Sacado_ELRCacheFad_GeneralFad.hpp.

Member Typedef Documentation

template<typename T, typename Storage>
typedef RemoveConst<T>::type Sacado::ELRCacheFad::GeneralFad< T, Storage >::value_type

Typename of values.

Definition at line 76 of file Sacado_ELRCacheFad_GeneralFad.hpp.

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

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

Definition at line 79 of file Sacado_ELRCacheFad_GeneralFad.hpp.

Constructor & Destructor Documentation

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION Sacado::ELRCacheFad::GeneralFad< T, Storage >::GeneralFad ( )
inline

Default constructor.

Definition at line 88 of file Sacado_ELRCacheFad_GeneralFad.hpp.

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

Constructor with supplied value x.

Initializes value to x and derivative array is empty

Definition at line 96 of file Sacado_ELRCacheFad_GeneralFad.hpp.

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

Definition at line 104 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION Sacado::ELRCacheFad::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 114 of file Sacado_ELRCacheFad_GeneralFad.hpp.

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

Constructor with supplied storage s.

Definition at line 121 of file Sacado_ELRCacheFad_GeneralFad.hpp.

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

Copy constructor.

Definition at line 125 of file Sacado_ELRCacheFad_GeneralFad.hpp.

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

Copy constructor from any Expression object.

Definition at line 131 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION Sacado::ELRCacheFad::GeneralFad< T, Storage >::~GeneralFad ( )
inline

Destructor.

Definition at line 191 of file Sacado_ELRCacheFad_GeneralFad.hpp.

Member Function Documentation

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION void Sacado::ELRCacheFad::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 201 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION void Sacado::ELRCacheFad::GeneralFad< T, Storage >::setUpdateValue ( bool  update_val)
inline

Set whether this Fad object should update values.

Definition at line 212 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION bool Sacado::ELRCacheFad::GeneralFad< T, Storage >::updateValue ( ) const
inline

Return whether this Fad object has an updated value.

Definition at line 216 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION void Sacado::ELRCacheFad::GeneralFad< T, Storage >::cache ( ) const
inline

Cache values.

Definition at line 220 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
template<typename S >
KOKKOS_INLINE_FUNCTION Sacado::ELRCacheFad::GeneralFad< T, Storage >::SACADO_ENABLE_EXPR_FUNC ( bool  ) const
inline

Returns whether two Fad objects have the same values.

Definition at line 225 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION int Sacado::ELRCacheFad::GeneralFad< T, Storage >::availableSize ( ) const
inline

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

Definition at line 246 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION bool Sacado::ELRCacheFad::GeneralFad< T, Storage >::hasFastAccess ( ) const
inline

Returns true if derivative array is not empty.

Definition at line 250 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION bool Sacado::ELRCacheFad::GeneralFad< T, Storage >::isPassive ( ) const
inline

Returns true if derivative array is empty.

Definition at line 254 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
KOKKOS_INLINE_FUNCTION void Sacado::ELRCacheFad::GeneralFad< T, Storage >::setIsConstant ( bool  is_const)
inline

Set whether variable is constant.

Definition at line 258 of file Sacado_ELRCacheFad_GeneralFad.hpp.

template<typename T, typename Storage>
template<typename S >
KOKKOS_INLINE_FUNCTION Sacado::ELRCacheFad::GeneralFad< T, Storage >::SACADO_ENABLE_VALUE_FUNC ( GeneralFad< T, Storage > &  )

Assignment operator with constant right-hand-side.


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