34 template <
typename OrdinalType,
typename ValueType>
36 Vector(OrdinalType vec_size, OrdinalType deriv_sz,
38 deriv_size_(deriv_sz), orient_(orient), stride_(1), vec_(vec_size)
49 for (OrdinalType i=0; i<vec_size; i++)
54 for (OrdinalType i=0; i<vec_size; i++)
59 template <
typename OrdinalType,
typename ValueType>
62 deriv_size_(fv.deriv_size_), orient_(fv.orient_), stride_(fv.stride_),
65 OrdinalType vec_size = fv.size();
74 for (OrdinalType i=0; i<vec_size; i++) {
80 for (OrdinalType i=0; i<vec_size; i++) {
87 template <
typename OrdinalType,
typename ValueType>
92 if (vec_.size() > 0) {
95 if (deriv_size_ > 0) {
102 template <
typename OrdinalType,
typename ValueType>
111 template <
typename OrdinalType,
typename ValueType>
116 if (vec_.size() == 0)
118 return &(vec_[0].val());
121 template <
typename OrdinalType,
typename ValueType>
126 if (vec_.size() == 0)
128 return &(vec_[0].val());
131 template <
typename OrdinalType,
typename ValueType>
136 if (vec_.size() == 0 || deriv_size_ == 0)
138 return &(vec_[0].fastAccessDx(0));
141 template <
typename OrdinalType,
typename ValueType>
146 if (vec_.size() == 0 || deriv_size_ == 0)
148 return &(vec_[0].fastAccessDx(0));
static KOKKOS_INLINE_FUNCTION void destroy_and_release(T *m, int sz)
Destroy array elements and release memory.
A class for storing a contiguously allocated array of Fad objects. This is a general definition that ...
static KOKKOS_INLINE_FUNCTION T * get_and_fill(int sz)
Get memory for new array of length sz and fill with zeros.
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.