Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | Private Types | List of all members
Sacado::Fad::ViewStorage< T, static_length, static_stride, U > Class Template Reference

Derivative array storage class that is a view into a contiguous memory allocation. It does not provide proper value semantics and thus should not be used in a general-purpose scalar type. More...

#include <Sacado_Fad_ViewStorage.hpp>

Public Types

typedef T value_type
 

Public Member Functions

template<typename S >
KOKKOS_INLINE_FUNCTION ViewStorage (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
 Default constructor (needed to satisfy interface) More...
 
KOKKOS_INLINE_FUNCTION ViewStorage (const int sz, const T &x, const DerivInit zero_out=InitDerivArray)
 Constructor with size sz (needed to satisfy interface) More...
 
KOKKOS_INLINE_FUNCTION ViewStorage (T *v, const int arg_size=0, const int arg_stride=0)
 Constructor. More...
 
KOKKOS_INLINE_FUNCTION ViewStorage (T *arg_dx, T *arg_val, const int arg_size=0, const int arg_stride=0)
 Constructor. More...
 
KOKKOS_INLINE_FUNCTION ViewStorage (const ViewStorage &x)
 Copy constructor. More...
 
KOKKOS_INLINE_FUNCTION ~ViewStorage ()
 Destructor. More...
 
KOKKOS_INLINE_FUNCTION
ViewStorage
operator= (const ViewStorage &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)
 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 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...
 

Protected Attributes

const
mpl::integral_nonzero_constant
< int, static_length > 
sz_
 Derivative array size. More...
 
const
mpl::integral_nonzero_constant
< int, static_stride > 
stride_
 Derivative array stride. More...
 
Tval_
 Value. More...
 
Tdx_
 Derivative array. More...
 

Private Types

enum  { stride_one = 1 == static_stride }
 

Detailed Description

template<typename T, unsigned static_length, unsigned static_stride, typename U>
class Sacado::Fad::ViewStorage< T, static_length, static_stride, U >

Derivative array storage class that is a view into a contiguous memory allocation. It does not provide proper value semantics and thus should not be used in a general-purpose scalar type.

Definition at line 73 of file Sacado_Fad_ViewStorage.hpp.

Member Typedef Documentation

template<typename T , unsigned static_length, unsigned static_stride, typename U >
typedef T Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::value_type

Definition at line 82 of file Sacado_Fad_ViewStorage.hpp.

Member Enumeration Documentation

template<typename T , unsigned static_length, unsigned static_stride, typename U >
anonymous enum
private
Enumerator
stride_one 

Definition at line 78 of file Sacado_Fad_ViewStorage.hpp.

Constructor & Destructor Documentation

template<typename T , unsigned static_length, unsigned static_stride, typename U >
template<typename S >
KOKKOS_INLINE_FUNCTION Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::ViewStorage ( const S &  x,
SACADO_ENABLE_VALUE_CTOR_DECL   
)
inline

Default constructor (needed to satisfy interface)

Definition at line 87 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::ViewStorage ( const int  sz,
const T x,
const DerivInit  zero_out = InitDerivArray 
)
inline

Constructor with size sz (needed to satisfy interface)

Definition at line 92 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::ViewStorage ( T v,
const int  arg_size = 0,
const int  arg_stride = 0 
)
inline

Constructor.

Definition at line 97 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::ViewStorage ( T arg_dx,
T arg_val,
const int  arg_size = 0,
const int  arg_stride = 0 
)
inline

Constructor.

Definition at line 102 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::ViewStorage ( const ViewStorage< T, static_length, static_stride, U > &  x)
inline

Copy constructor.

Definition at line 108 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::~ViewStorage ( )
inline

Destructor.

Definition at line 113 of file Sacado_Fad_ViewStorage.hpp.

Member Function Documentation

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION ViewStorage& Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::operator= ( const ViewStorage< T, static_length, static_stride, U > &  x)
inline

Assignment.

Definition at line 117 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION int Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::size ( ) const
inline

Returns number of derivative components.

Definition at line 134 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION int Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::length ( ) const
inline

Returns array length.

Definition at line 138 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION void Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::resize ( int  sz)
inline

Resize the derivative array to sz.

Since we can't actually resize, we check for resizes to zero, which signify assigning a constant. Thus we zero out the derivative components.

Definition at line 147 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION void Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::resizeAndZero ( int  )
inline

Resize the derivative array to sz.

We don't do anything here as this is used in the context of resizing the derivative array to zero and then back to some size > 0. Instead we zero out components when it is resized to zero above.

Definition at line 158 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION void Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::expand ( int  sz)
inline

Expand derivative array to size sz.

Definition at line 162 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION void Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::zero ( )
inline

Zero out derivative array.

Definition at line 166 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION const T& Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::val ( ) const
inline

Returns value.

Definition at line 172 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION T& Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::val ( )
inline

Returns value.

Definition at line 176 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION const T* Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::dx ( ) const
inline

Returns derivative array.

Definition at line 180 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION T Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::dx ( int  i) const
inline

Returns derivative component i with bounds checking.

Definition at line 184 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION T& Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::fastAccessDx ( int  i)
inline

Returns derivative component i without bounds checking.

Definition at line 190 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
KOKKOS_INLINE_FUNCTION const T& Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::fastAccessDx ( int  i) const
inline

Returns derivative component i without bounds checking.

Definition at line 196 of file Sacado_Fad_ViewStorage.hpp.

Member Data Documentation

template<typename T , unsigned static_length, unsigned static_stride, typename U >
const mpl::integral_nonzero_constant< int, static_length > Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::sz_
protected

Derivative array size.

Definition at line 203 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
const mpl::integral_nonzero_constant< int, static_stride > Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::stride_
protected

Derivative array stride.

Definition at line 206 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
T* Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::val_
protected

Value.

Definition at line 209 of file Sacado_Fad_ViewStorage.hpp.

template<typename T , unsigned static_length, unsigned static_stride, typename U >
T* Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::dx_
protected

Derivative array.

Definition at line 212 of file Sacado_Fad_ViewStorage.hpp.


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