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 Member Functions | Static Public Attributes | Protected Attributes | Private Attributes | List of all members
Sacado::Fad::Exp::MemPoolStorage< T > Class Template Reference

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

#include <Sacado_Fad_Exp_MemPoolStorage.hpp>

Classes

struct  apply
 Turn MemPoolStorage 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 MemPoolStorage ()
 Default constructor. More...
 
 MemPoolStorage (const T &x)
 Constructor with value. More...
 
 MemPoolStorage (const int sz, const T &x, const DerivInit zero_out)
 Constructor with size sz. More...
 
 MemPoolStorage (const MemPoolStorage &x)
 Copy constructor. More...
 
 ~MemPoolStorage ()
 Destructor. More...
 
MemPoolStorageoperator= (const MemPoolStorage &x)
 Assignment. More...
 
int size () const
 Returns number of derivative components. More...
 
KOKKOS_INLINE_FUNCTION int length () const
 Returns array length. More...
 
void resize (int sz)
 Resize the derivative array to sz. More...
 
void resizeAndZero (int sz)
 Resize the derivative array to sz. More...
 
void expand (int sz)
 Expand derivative array to size sz. More...
 
void zero ()
 Zero out derivative array. More...
 
const Tval () const
 Returns value. More...
 
Tval ()
 Returns value. More...
 
const Tdx () const
 Returns derivative array. More...
 
T dx (int i) const
 Returns derivative component i with bounds checking. More...
 
TfastAccessDx (int i)
 Returns derivative component i without bounds checking. More...
 
const TfastAccessDx (int i) const
 Returns derivative component i without bounds checking. More...
 

Static Public Member Functions

static void setDefaultPool (MemPool *pool)
 Set the default memory pool for new objects. More...
 

Static Public Attributes

static constexpr bool is_statically_sized = false
 
static constexpr int static_size = 0
 
static MemPooldefaultPool_
 Default memory pool. More...
 

Protected Attributes

MemPoolmyPool_
 Memory pool. More...
 

Private Attributes

T val_
 Value. More...
 
int sz_
 Derivative array size. More...
 
int len_
 Derivative array length. More...
 
Tdx_
 Derivative array. More...
 

Detailed Description

template<typename T>
class Sacado::Fad::Exp::MemPoolStorage< T >

Derivative array storage class using dynamic memory allocation.

Definition at line 177 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

Member Typedef Documentation

template<typename T >
typedef std::remove_cv<T>::type Sacado::Fad::Exp::MemPoolStorage< T >::value_type

Definition at line 181 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

Constructor & Destructor Documentation

Default constructor.

Definition at line 199 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
Sacado::Fad::Exp::MemPoolStorage< T >::MemPoolStorage ( const T x)
inline

Constructor with value.

Definition at line 203 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
Sacado::Fad::Exp::MemPoolStorage< T >::MemPoolStorage ( const int  sz,
const T x,
const DerivInit  zero_out 
)
inline

Constructor with size sz.

Initializes derivative array 0 of length sz

Definition at line 210 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
Sacado::Fad::Exp::MemPoolStorage< T >::MemPoolStorage ( const MemPoolStorage< T > &  x)
inline

Copy constructor.

Definition at line 219 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
Sacado::Fad::Exp::MemPoolStorage< T >::~MemPoolStorage ( )
inline

Destructor.

Definition at line 225 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

Member Function Documentation

template<typename T >
MemPoolStorage& Sacado::Fad::Exp::MemPoolStorage< T >::operator= ( const MemPoolStorage< T > &  x)
inline

Assignment.

Definition at line 231 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
static void Sacado::Fad::Exp::MemPoolStorage< T >::setDefaultPool ( MemPool pool)
inlinestatic

Set the default memory pool for new objects.

Definition at line 253 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
int Sacado::Fad::Exp::MemPoolStorage< T >::size ( ) const
inline

Returns number of derivative components.

Definition at line 258 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
KOKKOS_INLINE_FUNCTION int Sacado::Fad::Exp::MemPoolStorage< T >::length ( ) const
inline

Returns array length.

Definition at line 262 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
void Sacado::Fad::Exp::MemPoolStorage< T >::resize ( int  sz)
inline

Resize the derivative array to sz.

Note: This does not necessarily preserve derivative components.

Definition at line 268 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
void Sacado::Fad::Exp::MemPoolStorage< T >::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 284 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
void Sacado::Fad::Exp::MemPoolStorage< T >::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 302 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
void Sacado::Fad::Exp::MemPoolStorage< T >::zero ( )
inline

Zero out derivative array.

Definition at line 317 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
const T& Sacado::Fad::Exp::MemPoolStorage< T >::val ( ) const
inline

Returns value.

Definition at line 322 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
T& Sacado::Fad::Exp::MemPoolStorage< T >::val ( )
inline

Returns value.

Definition at line 325 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
const T* Sacado::Fad::Exp::MemPoolStorage< T >::dx ( ) const
inline

Returns derivative array.

Definition at line 328 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
T Sacado::Fad::Exp::MemPoolStorage< T >::dx ( int  i) const
inline

Returns derivative component i with bounds checking.

Definition at line 331 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
T& Sacado::Fad::Exp::MemPoolStorage< T >::fastAccessDx ( int  i)
inline

Returns derivative component i without bounds checking.

Definition at line 334 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
const T& Sacado::Fad::Exp::MemPoolStorage< T >::fastAccessDx ( int  i) const
inline

Returns derivative component i without bounds checking.

Definition at line 337 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

Member Data Documentation

template<typename T >
constexpr bool Sacado::Fad::Exp::MemPoolStorage< T >::is_statically_sized = false
static

Definition at line 182 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
constexpr int Sacado::Fad::Exp::MemPoolStorage< T >::static_size = 0
static

Definition at line 183 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
T Sacado::Fad::Exp::MemPoolStorage< T >::val_
private

Value.

Definition at line 342 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
int Sacado::Fad::Exp::MemPoolStorage< T >::sz_
private

Derivative array size.

Definition at line 345 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
int Sacado::Fad::Exp::MemPoolStorage< T >::len_
private

Derivative array length.

Definition at line 348 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
T* Sacado::Fad::Exp::MemPoolStorage< T >::dx_
private

Derivative array.

Definition at line 351 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
MemPool* Sacado::Fad::Exp::MemPoolStorage< T >::defaultPool_
static

Default memory pool.

Definition at line 356 of file Sacado_Fad_Exp_MemPoolStorage.hpp.

template<typename T >
MemPool* Sacado::Fad::Exp::MemPoolStorage< T >::myPool_
protected

Memory pool.

Definition at line 361 of file Sacado_Fad_Exp_MemPoolStorage.hpp.


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