We should have easier functions for the ODE source (not very intuitive this way) -> provide a function to get the derivative f at a given state x (time t not necesarry):
This is in linear time. Maybe change the std::vector to a std::list? It would be in constant time then. But: the size() function in std::list is in linear time!