Sacado Package Browser (Single Doxygen Collection)
Version of the Day
|
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 > | |
SACADO_INLINE_FUNCTION | ViewStorage (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL) |
Default constructor (needed to satisfy interface) More... | |
SACADO_INLINE_FUNCTION | ViewStorage (const int sz, const T &x, const DerivInit zero_out=InitDerivArray) |
Constructor with size sz (needed to satisfy interface) More... | |
SACADO_INLINE_FUNCTION | ViewStorage (T *v, const int arg_size=0, const int arg_stride=0) |
Constructor. More... | |
SACADO_INLINE_FUNCTION | ViewStorage (T *arg_dx, T *arg_val, const int arg_size=0, const int arg_stride=0) |
Constructor. More... | |
SACADO_INLINE_FUNCTION | ViewStorage (const ViewStorage &x) |
Copy constructor. More... | |
SACADO_INLINE_FUNCTION | ~ViewStorage () |
Destructor. More... | |
SACADO_INLINE_FUNCTION ViewStorage & | operator= (const ViewStorage &x) |
Assignment. More... | |
SACADO_INLINE_FUNCTION int | size () const |
Returns number of derivative components. More... | |
SACADO_INLINE_FUNCTION int | length () const |
Returns array length. More... | |
SACADO_INLINE_FUNCTION void | resize (int sz) |
Resize the derivative array to sz. More... | |
SACADO_INLINE_FUNCTION void | resizeAndZero (int) |
Resize the derivative array to sz. More... | |
SACADO_INLINE_FUNCTION void | expand (int sz) |
Expand derivative array to size sz. More... | |
SACADO_INLINE_FUNCTION void | zero () |
Zero out derivative array. More... | |
SACADO_INLINE_FUNCTION const T & | val () const |
Returns value. More... | |
SACADO_INLINE_FUNCTION T & | val () |
Returns value. More... | |
SACADO_INLINE_FUNCTION const T * | dx () const |
Returns derivative array. More... | |
SACADO_INLINE_FUNCTION T | dx (int i) const |
Returns derivative component i with bounds checking. More... | |
SACADO_INLINE_FUNCTION T & | fastAccessDx (int i) |
Returns derivative component i without bounds checking. More... | |
SACADO_INLINE_FUNCTION const T & | fastAccessDx (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... | |
T * | val_ |
Value. More... | |
T * | dx_ |
Derivative array. More... | |
Private Types | |
enum | { stride_one = 1 == static_stride } |
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 53 of file Sacado_Fad_ViewStorage.hpp.
typedef T Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::value_type |
Definition at line 62 of file Sacado_Fad_ViewStorage.hpp.
|
private |
Enumerator | |
---|---|
stride_one |
Definition at line 58 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Default constructor (needed to satisfy interface)
Definition at line 67 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Constructor with size sz
(needed to satisfy interface)
Definition at line 72 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Constructor.
Definition at line 77 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Constructor.
Definition at line 82 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Copy constructor.
Definition at line 88 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Destructor.
Definition at line 93 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Assignment.
Definition at line 97 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns number of derivative components.
Definition at line 114 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns array length.
Definition at line 118 of file Sacado_Fad_ViewStorage.hpp.
|
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 127 of file Sacado_Fad_ViewStorage.hpp.
|
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 138 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Expand derivative array to size sz.
Definition at line 142 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Zero out derivative array.
Definition at line 146 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns value.
Definition at line 152 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns value.
Definition at line 156 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns derivative array.
Definition at line 160 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns derivative component i
with bounds checking.
Definition at line 164 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns derivative component i
without bounds checking.
Definition at line 170 of file Sacado_Fad_ViewStorage.hpp.
|
inline |
Returns derivative component i
without bounds checking.
Definition at line 176 of file Sacado_Fad_ViewStorage.hpp.
|
protected |
Derivative array size.
Definition at line 183 of file Sacado_Fad_ViewStorage.hpp.
|
protected |
Derivative array stride.
Definition at line 186 of file Sacado_Fad_ViewStorage.hpp.
|
protected |
Definition at line 189 of file Sacado_Fad_ViewStorage.hpp.
|
protected |
Derivative array.
Definition at line 192 of file Sacado_Fad_ViewStorage.hpp.