Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
Public Types | List of all members
Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage > Class Template Reference

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

#include <Sacado_Fad_GeneralFad_MP_Vector.hpp>

Inheritance diagram for Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >:
Inheritance graph
[legend]

Public Types

typedef Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > > T
 
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...
 
typedef value_type::value_type val_type
 
- Public Types inherited from Stokhos::StandardStorage< int, double >
typedef doublereference
 
typedef const doubleconst_reference
 
typedef doublepointer
 
typedef const doubleconst_pointer
 

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...
 
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...
 

Value accessor methods

KOKKOS_INLINE_FUNCTION const Tval () const
 Returns value. More...
 
KOKKOS_INLINE_FUNCTION Tval ()
 Returns value. More...
 
KOKKOS_INLINE_FUNCTION const val_typeval (int j) const
 Returns value. More...
 
KOKKOS_INLINE_FUNCTION val_typeval (int j)
 Returns value. 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...
 
KOKKOS_INLINE_FUNCTION const Tdx () const
 Returns derivative array. More...
 
KOKKOS_INLINE_FUNCTION T dx (int i) const
 Returns derivative component i with bounds checking. More...
 
KOKKOS_INLINE_FUNCTION TfastAccessDx (int i)
 Returns derivative component i without bounds checking. More...
 
KOKKOS_INLINE_FUNCTION const TfastAccessDx (int i) const
 Returns derivative component i without bounds checking. More...
 
KOKKOS_INLINE_FUNCTION val_type dx (int i, int j) const
 Returns derivative component i with bounds checking. More...
 
KOKKOS_INLINE_FUNCTION val_typefastAccessDx (int i, int j)
 Returns derivative component i without bounds checking. More...
 
KOKKOS_INLINE_FUNCTION const val_typefastAccessDx (int i, int j) const
 Returns derivative component i without bounds checking. More...
 

Additional Inherited Members

- Public Member Functions inherited from Stokhos::StandardStorage< int, double >
 StandardStorage (const int &sz, const double &x=double(0.0))
 Constructor. More...
 
 ~StandardStorage ()
 Destructor. More...
 
void init (const_reference v)
 Initialize values to a constant value. More...
 
void init (const_pointer v, const int &sz=0)
 Initialize values to an array of values. More...
 
void load (pointer v)
 Load values to an array of values. More...
 
void resize (const int &sz)
 Resize to new size (values are preserved) More...
 
int size () const
 Return size. More...
 
const_reference operator[] (const int &i) const
 Coefficient access (avoid if possible) More...
 
reference operator[] (const int &i)
 Coefficient access (avoid if possible) More...
 
const_pointer coeff () const
 Get coefficients. More...
 
pointer coeff ()
 Get coefficients. More...
 

Detailed Description

template<typename Ord, typename Val, int VecNum, typename Dev, typename Storage>
class Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, 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 85 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

Member Typedef Documentation

◆ T

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
typedef Sacado::MP::Vector< Stokhos::StaticFixedStorage<Ord,Val,VecNum,Dev> > Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::T

Definition at line 89 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ value_type

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
typedef RemoveConst<T>::type Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::value_type

Typename of values.

Definition at line 92 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ scalar_type

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
typedef ScalarType<value_type>::type Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::scalar_type

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

Definition at line 95 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ val_type

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
typedef value_type::value_type Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::val_type

Definition at line 97 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

Constructor & Destructor Documentation

◆ GeneralFad() [1/7]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::GeneralFad ( )
inline

Default constructor.

Definition at line 106 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ GeneralFad() [2/7]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
template<typename S >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, 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 114 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ GeneralFad() [3/7]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, 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 122 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ GeneralFad() [4/7]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, 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 132 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ GeneralFad() [5/7]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::GeneralFad ( const Storage s)
inline

Constructor with supplied storage s.

Definition at line 139 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ GeneralFad() [6/7]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::GeneralFad ( const GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage > &  x)
inline

Copy constructor.

Definition at line 143 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ GeneralFad() [7/7]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
template<typename S >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::GeneralFad ( const Expr< S > &  x,
SACADO_ENABLE_EXPR_CTOR_DECL   
)
inline

Copy constructor from any Expression object.

Definition at line 149 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ ~GeneralFad()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::~GeneralFad ( )
inline

Destructor.

Definition at line 171 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

Member Function Documentation

◆ diff()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION void Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, 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 181 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ setUpdateValue()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION void Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::setUpdateValue ( bool  update_val)
inline

Set whether this Fad object should update values.

Definition at line 191 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ updateValue()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION bool Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::updateValue ( ) const
inline

Return whether this Fad object has an updated value.

Definition at line 195 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ SACADO_ENABLE_EXPR_FUNC()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
template<typename S >
KOKKOS_INLINE_FUNCTION Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::SACADO_ENABLE_EXPR_FUNC ( bool  ) const &
inline

Returns whether two Fad objects have the same values.

Definition at line 200 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ val() [1/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION const T& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::val ( ) const
inline

Returns value.

Definition at line 218 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ val() [2/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION T& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::val ( )
inline

Returns value.

Definition at line 222 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ val() [3/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION const val_type& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::val ( int  j) const
inline

Returns value.

Definition at line 226 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ val() [4/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION val_type& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::val ( int  j)
inline

Returns value.

Definition at line 230 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ availableSize()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION int Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::availableSize ( ) const
inline

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

Definition at line 244 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ hasFastAccess()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION bool Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::hasFastAccess ( ) const
inline

Returns true if derivative array is not empty.

Definition at line 248 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ isPassive()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION bool Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::isPassive ( ) const
inline

Returns true if derivative array is empty.

Definition at line 252 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ setIsConstant()

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION void Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::setIsConstant ( bool  is_const)
inline

Set whether variable is constant.

Definition at line 256 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ dx() [1/3]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION const T* Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::dx ( ) const
inline

Returns derivative array.

Definition at line 263 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ dx() [2/3]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION T Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::dx ( int  i) const
inline

Returns derivative component i with bounds checking.

Definition at line 267 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ fastAccessDx() [1/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION T& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::fastAccessDx ( int  i)
inline

Returns derivative component i without bounds checking.

Definition at line 271 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ fastAccessDx() [2/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION const T& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::fastAccessDx ( int  i) const
inline

Returns derivative component i without bounds checking.

Definition at line 275 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ dx() [3/3]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION val_type Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::dx ( int  i,
int  j 
) const
inline

Returns derivative component i with bounds checking.

Definition at line 279 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ fastAccessDx() [3/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION val_type& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::fastAccessDx ( int  i,
int  j 
)
inline

Returns derivative component i without bounds checking.

Definition at line 283 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.

◆ fastAccessDx() [4/4]

template<typename Ord , typename Val , int VecNum, typename Dev , typename Storage >
KOKKOS_INLINE_FUNCTION const val_type& Sacado::Fad::GeneralFad< Sacado::MP::Vector< Stokhos::StaticFixedStorage< Ord, Val, VecNum, Dev > >, Storage >::fastAccessDx ( int  i,
int  j 
) const
inline

Returns derivative component i without bounds checking.

Definition at line 289 of file Sacado_Fad_GeneralFad_MP_Vector.hpp.


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