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 | Private Attributes | List of all members
Sacado::Fad::Exp::VectorDynamicStorage< T, U > Class Template Reference

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

#include <Sacado_Fad_Exp_VectorDynamicStorage.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 VectorDynamicStorage ()
 Default constructor. More...
 
KOKKOS_INLINE_FUNCTION VectorDynamicStorage (const T &x)
 Constructor with value. More...
 
KOKKOS_INLINE_FUNCTION VectorDynamicStorage (const int sz, const T &x, const DerivInit zero_out)
 Constructor with size sz. More...
 
KOKKOS_INLINE_FUNCTION VectorDynamicStorage (const int sz, T *x, U *dx_p, const int stride, bool zero_out)
 Constructor with supplied memory. More...
 
KOKKOS_INLINE_FUNCTION VectorDynamicStorage (const VectorDynamicStorage &x)
 Copy constructor. More...
 
KOKKOS_INLINE_FUNCTION ~VectorDynamicStorage ()
 Destructor. More...
 
KOKKOS_INLINE_FUNCTION
VectorDynamicStorage
operator= (const VectorDynamicStorage &x)
 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 void setMemory (int sz, T *x, U *dx_p, int stride)
 Set value/derivative array memory. 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
 

Private Attributes

T v_
 
bool owns_mem
 Do we own the val/dx storage. More...
 
int sz_
 Derivative array size. More...
 
int len_
 Derivative array length. More...
 
int stride_
 Derivative array stride. More...
 
Tval_
 Value. More...
 
U * dx_
 Derivative array. More...
 

Detailed Description

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

Derivative array storage class using dynamic memory allocation.

Definition at line 45 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

Member Typedef Documentation

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

Definition at line 49 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 67 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Constructor with value.

Definition at line 73 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::VectorDynamicStorage< T, U >::VectorDynamicStorage ( 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 82 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::Exp::VectorDynamicStorage< T, U >::VectorDynamicStorage ( const int  sz,
T x,
U *  dx_p,
const int  stride,
bool  zero_out 
)
inline

Constructor with supplied memory.

Definition at line 92 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Copy constructor.

Definition at line 102 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Destructor.

Definition at line 110 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

Member Function Documentation

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

Assignment.

Definition at line 119 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns number of derivative components.

Definition at line 145 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns array length.

Definition at line 149 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Resize the derivative array to sz.

Note: This does not necessarily preserve derivative components.

Definition at line 156 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Exp::VectorDynamicStorage< 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 176 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Exp::VectorDynamicStorage< 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 198 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Zero out derivative array.

Definition at line 218 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::Exp::VectorDynamicStorage< T, U >::setMemory ( int  sz,
T x,
U *  dx_p,
int  stride 
)
inline

Set value/derivative array memory.

Definition at line 224 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns value.

Definition at line 243 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns value.

Definition at line 247 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns derivative array.

Definition at line 251 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns derivative component i with bounds checking.

Definition at line 255 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns derivative component i without bounds checking.

Definition at line 259 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Returns derivative component i without bounds checking.

Definition at line 263 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

Member Data Documentation

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

Definition at line 50 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

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

Definition at line 51 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
T Sacado::Fad::Exp::VectorDynamicStorage< T, U >::v_
private

Definition at line 267 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
bool Sacado::Fad::Exp::VectorDynamicStorage< T, U >::owns_mem
private

Do we own the val/dx storage.

Definition at line 272 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
int Sacado::Fad::Exp::VectorDynamicStorage< T, U >::sz_
private

Derivative array size.

Definition at line 275 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
int Sacado::Fad::Exp::VectorDynamicStorage< T, U >::len_
private

Derivative array length.

Definition at line 278 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
int Sacado::Fad::Exp::VectorDynamicStorage< T, U >::stride_
private

Derivative array stride.

Definition at line 281 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
T* Sacado::Fad::Exp::VectorDynamicStorage< T, U >::val_
private

Value.

Definition at line 284 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.

template<typename T , typename U = T>
U* Sacado::Fad::Exp::VectorDynamicStorage< T, U >::dx_
private

Derivative array.

Definition at line 287 of file Sacado_Fad_Exp_VectorDynamicStorage.hpp.


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