10 #ifndef SACADO_FAD_STATICSTORAGE_HPP
11 #define SACADO_FAD_STATICSTORAGE_HPP
15 #ifdef SACADO_NEW_FAD_DESIGN_IS_DEFAULT
22 template <
typename T,
int N>
23 using StaticStorage = Exp::StaticStorage<T,N>;
42 template <
typename T,
int Num>
62 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
64 throw "StaticStorage::StaticStorage() Error: Supplied derivative dimension exceeds maximum length.";
107 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
109 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
121 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
123 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
137 #if defined(SACADO_DEBUG) && !defined(__CUDA_ARCH__ )
139 throw "StaticStorage::resize() Error: Supplied derivative dimension exceeds maximum length.";
192 #endif // SACADO_NEW_FAD_DESIGN_IS_DEFAULT
194 #endif // SACADO_FAD_STATICSTORAGE_HPP
Derivative array storage class using static memory allocation.
#define SACADO_ENABLE_VALUE_CTOR_DECL
SACADO_INLINE_FUNCTION void resizeAndZero(int sz)
Resize the derivative array to sz.
SACADO_INLINE_FUNCTION T dx(int i) const
Returns derivative component i with bounds checking.
SACADO_INLINE_FUNCTION int size() const
Returns number of derivative components.
SACADO_INLINE_FUNCTION T & fastAccessDx(int i)
Returns derivative component i without bounds checking.
SACADO_INLINE_FUNCTION const T & val() const
Returns value.
SACADO_INLINE_FUNCTION void resize(int sz)
Resize the derivative array to sz.
SACADO_INLINE_FUNCTION const T & fastAccessDx(int i) const
Returns derivative component i without bounds checking.
T dx_[Num]
Derivative array.
SACADO_INLINE_FUNCTION int length() const
Returns array length.
DerivInit
Enum use to signal whether the derivative array should be initialized in AD object constructors...
int sz_
Size of derivative array.
SACADO_INLINE_FUNCTION ~StaticStorage()
Destructor.
SACADO_INLINE_FUNCTION StaticStorage(const int sz, const T &x, const DerivInit zero_out=InitDerivArray)
Constructor with size sz.
static SACADO_INLINE_FUNCTION void zero(T *dest, int sz)
Zero out array dest of length sz.
SACADO_INLINE_FUNCTION StaticStorage(const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
Default constructor.
Initialize the derivative array.
SACADO_INLINE_FUNCTION StaticStorage & operator=(const StaticStorage &x)
Assignment.
SACADO_INLINE_FUNCTION T & val()
Returns value.
#define SACADO_INLINE_FUNCTION
SACADO_INLINE_FUNCTION void zero()
Zero out derivative array.
SACADO_INLINE_FUNCTION void expand(int sz)
Expand derivative array to size sz.
SACADO_INLINE_FUNCTION const T * dx() const
Returns derivative array.
SACADO_INLINE_FUNCTION StaticStorage(const StaticStorage &x)
Copy constructor.