Sacado Package Browser (Single Doxygen Collection)  Version of the Day
Public Types | Public Member Functions | Protected Attributes | List of all members
Sacado::Fad::DynamicStorage< T, U > Class Template Reference

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

#include <Sacado_Fad_DynamicStorage.hpp>

Inheritance diagram for Sacado::Fad::DynamicStorage< T, U >:
Inheritance graph
[legend]

Public Types

typedef T value_type
 

Public Member Functions

template<typename S >
KOKKOS_INLINE_FUNCTION DynamicStorage (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
 Default constructor. 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 DynamicStorage &x)
 Copy constructor. More...
 
KOKKOS_INLINE_FUNCTION ~DynamicStorage ()
 Destructor. More...
 
KOKKOS_INLINE_FUNCTION DynamicStorageoperator= (const DynamicStorage &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 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...
 

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::DynamicStorage< T, U >

Derivative array storage class using dynamic memory allocation.

Definition at line 42 of file Sacado_Fad_DynamicStorage.hpp.

Member Typedef Documentation

◆ value_type

template<typename T, typename U = T>
typedef T Sacado::Fad::DynamicStorage< T, U >::value_type

Definition at line 46 of file Sacado_Fad_DynamicStorage.hpp.

Constructor & Destructor Documentation

◆ DynamicStorage() [1/3]

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

Default constructor.

Definition at line 51 of file Sacado_Fad_DynamicStorage.hpp.

◆ DynamicStorage() [2/3]

template<typename T, typename U = T>
KOKKOS_INLINE_FUNCTION Sacado::Fad::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 59 of file Sacado_Fad_DynamicStorage.hpp.

◆ DynamicStorage() [3/3]

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

Copy constructor.

Definition at line 69 of file Sacado_Fad_DynamicStorage.hpp.

◆ ~DynamicStorage()

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

Destructor.

Definition at line 76 of file Sacado_Fad_DynamicStorage.hpp.

Member Function Documentation

◆ operator=()

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

Assignment.

Definition at line 83 of file Sacado_Fad_DynamicStorage.hpp.

◆ size()

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

Returns number of derivative components.

Definition at line 105 of file Sacado_Fad_DynamicStorage.hpp.

◆ length()

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

Returns array length.

Definition at line 109 of file Sacado_Fad_DynamicStorage.hpp.

◆ resize()

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

Resize the derivative array to sz.

Note: This does not necessarily preserve derivative components.

Definition at line 116 of file Sacado_Fad_DynamicStorage.hpp.

◆ resizeAndZero()

template<typename T, typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::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 132 of file Sacado_Fad_DynamicStorage.hpp.

◆ expand()

template<typename T, typename U = T>
KOKKOS_INLINE_FUNCTION void Sacado::Fad::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 150 of file Sacado_Fad_DynamicStorage.hpp.

◆ zero()

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

Zero out derivative array.

Definition at line 166 of file Sacado_Fad_DynamicStorage.hpp.

◆ val() [1/2]

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

Returns value.

Definition at line 172 of file Sacado_Fad_DynamicStorage.hpp.

◆ val() [2/2]

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

Returns value.

Definition at line 176 of file Sacado_Fad_DynamicStorage.hpp.

◆ dx() [1/2]

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

Returns derivative array.

Definition at line 180 of file Sacado_Fad_DynamicStorage.hpp.

◆ dx() [2/2]

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

Returns derivative component i with bounds checking.

Definition at line 184 of file Sacado_Fad_DynamicStorage.hpp.

◆ fastAccessDx() [1/2]

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

Returns derivative component i without bounds checking.

Definition at line 188 of file Sacado_Fad_DynamicStorage.hpp.

◆ fastAccessDx() [2/2]

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

Returns derivative component i without bounds checking.

Definition at line 192 of file Sacado_Fad_DynamicStorage.hpp.

Member Data Documentation

◆ val_

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

Value.

Definition at line 197 of file Sacado_Fad_DynamicStorage.hpp.

◆ sz_

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

Derivative array size.

Definition at line 200 of file Sacado_Fad_DynamicStorage.hpp.

◆ len_

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

Derivative array length.

Definition at line 203 of file Sacado_Fad_DynamicStorage.hpp.

◆ dx_

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

Derivative array.

Definition at line 206 of file Sacado_Fad_DynamicStorage.hpp.


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