Changed rk4 to use generic matrix interface.

This commit is contained in:
jgoppert 2015-11-14 08:55:34 -05:00
parent b9924820e1
commit f2c0669c0d

View File

@ -6,12 +6,12 @@ namespace matrix {
template<typename Type, size_t M, size_t N>
int integrate_rk4(
Vector<Type, M> (*f)(Type, const Vector<Type, M> &x, const Vector<Type, N> & u),
const Vector<Type, M> & y0,
const Vector<Type, N> & u,
Vector<Type, M> (*f)(Type, const Matrix<Type, M, 1> &x, const Matrix<Type, N, 1> & u),
const Matrix<Type, M, 1> & y0,
const Matrix<Type, N, 1> & u,
Type t0,
Type h,
Vector<Type, M> & y1
Matrix<Type, M, 1> & y1
)
{
// https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods