1 # ifndef CPPAD_SPEED_ODE_EVALUATE_HPP
2 # define CPPAD_SPEED_ODE_EVALUATE_HPP
151 template <
class Float>
165 {
size_t n = y.
size();
167 for(
size_t k = 1; k < n; k++)
172 template <
class Float>
182 "ode_evaluate: p is not zero or one"
185 ((p==0) & (fp.
size()==n)) || ((p==1) & (fp.
size()==n*n)),
186 "ode_evaluate: the size of fp is not correct"
201 const VectorFloat& yi = x;
205 VectorFloat& yf = fp;
220 for(i = 0; i < n; i++)
221 {
for(j = 0; j < n; j++)
222 fp[ i * n + j ] = 0.0;
224 size_t factorial = 1;
225 for(k = 0; k < n; k++)
228 for(i = k; i < n; i++)
231 fp[ i * n + j ] += 1.0 / Float(factorial);
#define CPPAD_ASSERT_KNOWN(exp, msg)
Check that exp is true, if not print msg and terminate execution.
The CppAD Simple Vector template class.
size_t size(void) const
number of elements currently in this vector.
Vector Runge45(Fun &F, size_t M, const Scalar &ti, const Scalar &tf, const Vector &xi)
void Ode(const Float &t, const CppAD::vector< Float > &y, CppAD::vector< Float > &f)
void ode_evaluate(const CppAD::vector< Float > &x, size_t p, CppAD::vector< Float > &fp)
File used to define CppAD::vector and CppAD::vectorBool.