1 # ifndef CPPAD_CORE_REV_TWO_HPP
2 # define CPPAD_CORE_REV_TWO_HPP
144 template <
typename Base>
145 template <
typename VectorBase,
typename VectorSize_t>
148 const VectorSize_t &i,
149 const VectorSize_t &j)
160 CheckSimpleVector<Base, VectorBase>();
163 CheckSimpleVector<size_t, VectorSize_t>();
167 "RevTwo: Length of x not equal domain dimension for f."
170 i.size() == j.size(),
171 "RevTwo: Lenght of the i and j vectors are not equal."
177 VectorBase ddw(n * p);
181 for(j1 = 0; j1 < n; j1++)
186 for(i1 = 0; i1 < m; i1++)
193 for(l = 0; l < p; l++)
198 "RevTwo: an eleemnt of i not less than range dimension for f."
202 "RevTwo: an element of j not less than domain dimension for f."
207 for(j1 = 0; j1 < n; j1++)
209 bool first_done =
false;
210 for(l = 0; l < p; l++)
if( j[l] == j1 )
226 for(k = 0; k < n; k++)
227 ddw[k * p + l] = r[k * 2 + 1];
#define CPPAD_ASSERT_KNOWN(exp, msg)
Check that exp is true, if not print msg and terminate execution.
VectorBase RevTwo(const VectorBase &x, const VectorSize_t &I, const VectorSize_t &J)
reverse mode calculation of a subset of second order partials