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...
|
|
| ViewStorage () |
| | Default constructor (needed to satisfy interface)
|
| |
|
| ViewStorage (T *v, const int arg_size=0, const int arg_stride=0) |
| | Constructor.
|
| |
|
| ViewStorage (T *arg_dx, T *arg_val, const int arg_size=0, const int arg_stride=0) |
| | Constructor.
|
| |
| template<typename TT > |
| | ViewStorage (const ViewStorage< TT, static_length, static_stride, U > &x, typename std::enable_if< std::is_same< TT, T >::value||std::is_same< const TT, T >::value >::type *=0) |
| | Copy constructor.
|
| |
|
| ~ViewStorage () |
| | Destructor.
|
| |
|
ViewStorage & | operator= (const ViewStorage &x) |
| | Assignment.
|
| |
|
constexpr int | size () const |
| | Returns number of derivative components.
|
| |
|
constexpr int | length () const |
| | Returns array length.
|
| |
| void | resize (int sz) |
| | Resize the derivative array to sz.
|
| |
| void | resizeAndZero (int sz) |
| | Resize the derivative array to sz.
|
| |
|
void | expand (int sz) |
| | Expand derivative array to size sz.
|
| |
|
void | zero () |
| | Zero out derivative array.
|
| |
|
const T & | val () const |
| | Returns value.
|
| |
|
T & | val () |
| | Returns value.
|
| |
|
const T * | dx () const |
| | Returns derivative array.
|
| |
|
T | dx (int i) const |
| | Returns derivative component i with bounds checking.
|
| |
|
T & | fastAccessDx (int i) |
| | Returns derivative component i without bounds checking.
|
| |
|
const T & | fastAccessDx (int i) const |
| | Returns derivative component i without bounds checking.
|
| |
|
ViewFadPtr< T, static_length, static_stride, U > | operator& () const |
| | Overload of addressof operator.
|
| |
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.
template<typename T , unsigned static_length, unsigned static_stride, typename U >
template<typename TT >
| Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::ViewStorage |
( |
const ViewStorage< TT, static_length, static_stride, U > & |
x, |
|
|
typename std::enable_if< std::is_same< TT, T >::value||std::is_same< const TT, T >::value >::type * |
= 0 |
|
) |
| |
|
inline |
Copy constructor.
Allow, e.g., ViewStorage<double,...>(ViewStorage<double,...>), ViewStorage<const double,...>(ViewStorage<double,...>), and ViewStorage<const double,...>(ViewStorage<const double,...>) but not ViewStorage<double,...>(ViewStorage<const double,...>).
template<typename T , unsigned static_length, unsigned static_stride, typename U >
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.
References Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::dx_, Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::stride_, Sacado::ds_array< T, isScalar >::strided_zero(), and Sacado::Fad::ViewStorage< T, static_length, static_stride, U >::sz_.
template<typename T , unsigned static_length, unsigned static_stride, typename U >
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.