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 | Static Public Attributes | Protected Attributes | List of all members
Sacado::Fad::Exp::DynamicStorage< T, U > Class Template Reference

Derivative array storage class using dynamic memory allocation. More...

#include <Sacado_Fad_Exp_DynamicStorage.hpp>

Classes

struct  apply
 Turn DynamicStorage into a meta-function class usable with mpl::apply. More...
 
struct  apply_N
 Replace static derivative length. More...
 

Public Types

typedef std::remove_cv< T >::type value_type
 

Public Member Functions

KOKKOS_INLINE_FUNCTION DynamicStorage ()
 Default constructor. More...
 
KOKKOS_INLINE_FUNCTION DynamicStorage (const T &x)
 Constructor with value. More...
 
KOKKOS_INLINE_FUNCTION DynamicStorage (const int sz, const T &x, const DerivInit zero_out=InitDerivArray)
 Constructor with size sz. More...
 
KOKKOS_INLINE_FUNCTION DynamicStorage (const int sz, const int i, const value_type &x)
 Constructor with size sz, index i, and value x. More...
 
KOKKOS_INLINE_FUNCTION DynamicStorage (const DynamicStorage &x)
 Copy constructor. More...
 
KOKKOS_INLINE_FUNCTION DynamicStorage (DynamicStorage &&x)
 Move constructor. More...
 
KOKKOS_INLINE_FUNCTION ~DynamicStorage ()
 Destructor. More...
 
KOKKOS_INLINE_FUNCTION
DynamicStorage
operator= (const DynamicStorage &x)
 Assignment. More...
 
KOKKOS_INLINE_FUNCTION
DynamicStorage
operator= (DynamicStorage &&x)
 Move assignment. More...
 
KOKKOS_INLINE_FUNCTION int size () const
 Returns number of derivative components. More...
 
KOKKOS_INLINE_FUNCTION int length () const
 Returns array length. More...
 
KOKKOS_INLINE_FUNCTION void resize (int sz)
 Resize the derivative array to sz. More...
 
KOKKOS_INLINE_FUNCTION void resizeAndZero (int sz)
 Resize the derivative array to sz. More...
 
KOKKOS_INLINE_FUNCTION void expand (int sz)
 Expand derivative array to size sz. More...
 
KOKKOS_INLINE_FUNCTION void zero ()
 Zero out derivative array. More...
 
KOKKOS_INLINE_FUNCTION const Tval () const
 Returns value. More...
 
KOKKOS_INLINE_FUNCTION Tval ()
 Returns value. More...
 
KOKKOS_INLINE_FUNCTION const U * dx () const
 Returns derivative array. More...
 
KOKKOS_INLINE_FUNCTIONdx (int i) const
 Returns derivative component i with bounds checking. More...
 
KOKKOS_INLINE_FUNCTION U & fastAccessDx (int i)
 Returns derivative component i without bounds checking. More...
 
KOKKOS_INLINE_FUNCTION const U & fastAccessDx (int i) const
 Returns derivative component i without bounds checking. More...
 

Static Public Attributes

static constexpr bool is_statically_sized = false
 
static constexpr int static_size = 0
 
static constexpr bool is_view = false
 

Protected Attributes

T val_
 Value. More...
 
int sz_
 Derivative array size. More...
 
int len_
 Derivative array length. More...
 
U * dx_
 Derivative array. More...
 

Detailed Description

template<typename T, typename U = T>
class Sacado::Fad::Exp::DynamicStorage< T, U >

Derivative array storage class using dynamic memory allocation.

Definition at line 46 of file Sacado_Fad_Exp_DynamicStorage.hpp.

Member Typedef Documentation

template<typename T , typename U = T>
typedef std::remove_cv<T>::type Sacado::Fad::Exp::DynamicStorage< T, U >::value_type

Definition at line 50 of file Sacado_Fad_Exp_DynamicStorage.hpp.

Constructor & Destructor Documentation

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::DynamicStorage< T, U >::DynamicStorage ( )
inline

Default constructor.

Definition at line 69 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::DynamicStorage< T, U >::DynamicStorage ( const T x)
inline

Constructor with value.

Definition at line 74 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::DynamicStorage< T, U >::DynamicStorage ( const int  sz,
const T x,
const DerivInit  zero_out = InitDerivArray 
)
inline

Constructor with size sz.

Initializes derivative array 0 of length sz

Definition at line 82 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::DynamicStorage< T, U >::DynamicStorage ( const int  sz,
const int  i,
const value_type 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 98 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::DynamicStorage< T, U >::DynamicStorage ( const DynamicStorage< T, U > &  x)
inline

Copy constructor.

Definition at line 105 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::DynamicStorage< T, U >::DynamicStorage ( DynamicStorage< T, U > &&  x)
inline

Move constructor.

Definition at line 112 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::DynamicStorage< T, U >::~DynamicStorage ( )
inline

Destructor.

Definition at line 121 of file Sacado_Fad_Exp_DynamicStorage.hpp.

Member Function Documentation

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION DynamicStorage& Sacado::Fad::Exp::DynamicStorage< T, U >::operator= ( const DynamicStorage< T, U > &  x)
inline

Assignment.

Definition at line 128 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION DynamicStorage& Sacado::Fad::Exp::DynamicStorage< T, U >::operator= ( DynamicStorage< T, U > &&  x)
inline

Move assignment.

Definition at line 150 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION int Sacado::Fad::Exp::DynamicStorage< T, U >::size ( ) const
inline

Returns number of derivative components.

Definition at line 164 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION int Sacado::Fad::Exp::DynamicStorage< T, U >::length ( ) const
inline

Returns array length.

Definition at line 168 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Exp::DynamicStorage< T, U >::resize ( int  sz)
inline

Resize the derivative array to sz.

Note: This does not necessarily preserve derivative components.

Definition at line 175 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Exp::DynamicStorage< T, U >::resizeAndZero ( int  sz)
inline

Resize the derivative array to sz.

This method doest not preserve any existing derivative components but sets any that are added to zero.

Definition at line 191 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Exp::DynamicStorage< T, U >::expand ( int  sz)
inline

Expand derivative array to size sz.

This method preserves any existing derivative components and sets any that are added to zero.

Definition at line 209 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Exp::DynamicStorage< T, U >::zero ( )
inline

Zero out derivative array.

Definition at line 225 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION const T& Sacado::Fad::Exp::DynamicStorage< T, U >::val ( ) const
inline

Returns value.

Definition at line 231 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION T& Sacado::Fad::Exp::DynamicStorage< T, U >::val ( )
inline

Returns value.

Definition at line 235 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION const U* Sacado::Fad::Exp::DynamicStorage< T, U >::dx ( ) const
inline

Returns derivative array.

Definition at line 239 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION U Sacado::Fad::Exp::DynamicStorage< T, U >::dx ( int  i) const
inline

Returns derivative component i with bounds checking.

Definition at line 259 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION U& Sacado::Fad::Exp::DynamicStorage< T, U >::fastAccessDx ( int  i)
inline

Returns derivative component i without bounds checking.

Definition at line 263 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION const U& Sacado::Fad::Exp::DynamicStorage< T, U >::fastAccessDx ( int  i) const
inline

Returns derivative component i without bounds checking.

Definition at line 267 of file Sacado_Fad_Exp_DynamicStorage.hpp.

Member Data Documentation

template<typename T , typename U = T>
constexpr bool Sacado::Fad::Exp::DynamicStorage< T, U >::is_statically_sized = false
static

Definition at line 51 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
constexpr int Sacado::Fad::Exp::DynamicStorage< T, U >::static_size = 0
static

Definition at line 52 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
constexpr bool Sacado::Fad::Exp::DynamicStorage< T, U >::is_view = false
static

Definition at line 53 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
T Sacado::Fad::Exp::DynamicStorage< T, U >::val_
protected

Value.

Definition at line 274 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
int Sacado::Fad::Exp::DynamicStorage< T, U >::sz_
protected

Derivative array size.

Definition at line 277 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
int Sacado::Fad::Exp::DynamicStorage< T, U >::len_
protected

Derivative array length.

Definition at line 280 of file Sacado_Fad_Exp_DynamicStorage.hpp.

template<typename T , typename U = T>
U* Sacado::Fad::Exp::DynamicStorage< T, U >::dx_
protected

Derivative array.

Definition at line 283 of file Sacado_Fad_Exp_DynamicStorage.hpp.


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