Closed dtamayo closed 11 years ago
You can use a std::vector
as state type. It can change its size dynamically during runtime. It works out of the box with odeint, just pass the vector as state type to odeints steppers.
Sorry for the uninformed question. Thanks for the very quick reply! Worked perfectly.
Hi,
I'm not the best programmer and am mostly working off one of the examples, so I apologize if there's an easy fix for this. (At least in the example) the function rhs takes two boost::array<double, n>'s, where n is the number of equations in the system. In the application I want to code, n is not known until runtime, since it has to be read from an input file. I almost don't want to make a suggestion, since it's probably quite naive, but would it not be possible to code things using vectors instead to avoid this problem?
Thanks,
Dan