12 template <
typename OrdinalType,
typename ValueType>
14 Vector(OrdinalType vec_size, OrdinalType deriv_sz,
16 deriv_size_(deriv_sz), orient_(orient), stride_(1), vec_(vec_size)
27 for (OrdinalType
i=0;
i<vec_size;
i++)
32 for (OrdinalType
i=0;
i<vec_size;
i++)
37 template <
typename OrdinalType,
typename ValueType>
40 deriv_size_(fv.deriv_size_), orient_(fv.orient_), stride_(fv.stride_),
43 OrdinalType vec_size = fv.size();
52 for (OrdinalType
i=0;
i<vec_size;
i++) {
58 for (OrdinalType
i=0;
i<vec_size;
i++) {
67 template <
typename OrdinalType,
typename ValueType>
68 Vector< OrdinalType, DVFad<ValueType> >::
72 if (vec_.size() > 0) {
73 ValueType *v = vals();
75 if (deriv_size_ > 0) {
84 template <
typename OrdinalType,
typename ValueType>
93 template <
typename OrdinalType,
typename ValueType>
100 return &(vec_[0].val());
103 template <
typename OrdinalType,
typename ValueType>
108 if (vec_.size() == 0)
110 return &(vec_[0].val());
113 template <
typename OrdinalType,
typename ValueType>
118 if (vec_.size() == 0 || deriv_size_ == 0)
120 return &(vec_[0].fastAccessDx(0));
123 template <
typename OrdinalType,
typename ValueType>
128 if (vec_.size() == 0 || deriv_size_ == 0)
130 return &(vec_[0].fastAccessDx(0));
A class for storing a contiguously allocated array of Fad objects. This is a general definition that ...
static SACADO_INLINE_FUNCTION void destroy_and_release(T *m, int sz)
Destroy array elements and release memory.
Forward-mode AD class using dynamic memory allocation and expression templates.
std::vector< FadType > vec_
Vector of Fad's.
OrdinalType deriv_size_
Size of derivative array.
Base template specification for ValueType.
static SACADO_INLINE_FUNCTION T * get_and_fill(int sz)
Get memory for new array of length sz and fill with zeros.