Closed GregorDeCillia closed 9 years ago
good job, thanks!
to make it more consistent with our other tests i would like to propose a few small adjustments:
double
instead of a 1D arraywhile( error < tolerance )
{
}
if possible
seems easy to do do, but will take a while because holidays. I will let you know when the adjustments are finished.
I just encounterd some problems when changing the state_type
from vector<double>
to double
. It seems the initialize
function does behave different for those two state types. The following script returns t=0, x=0
for double
and t=0.3, x=0.3
for vector<double>
. Am I missing something here?
#include <boost/numeric/odeint.hpp>
#include <iostream>
using namespace boost::numeric::odeint;
typedef double state_type;
//typedef std::vector<double> state_type;
void rhs( const state_type &x , state_type &dxdt , const double t ){
dxdt = 1;
//dxdt[0] = 1;
}
int main(){
double t = 0;
const double dt = 0.1;
state_type x = 0;
//state_type x(1); x[0] = 0;
adams_bashforth< 4, state_type > stepper;
stepper.initialize( runge_kutta_fehlberg78< state_type >(),
rhs, x, t, dt );
std::cout << "Initializing finished: t = " << t << ", x = "
<< x << std::endl;
// << x[0] << std::endl;
}
Strange. Let me look into that.
Indeed, for this case the wrong overloads of do_step were used. This should be fixed with 4cadbe5 now.
state_type
to double
, do-while
loop for estimating the order and rhs
to a (global) instance of a struct
. This struct contains the exponent as a member.very nice, thanks a lot one final request: put your name in the copyright notice in top of the test instead of ours ;)
Done! I hope the location test/numeric
is alright for the test.
yes, it's exactly the right place. I will do another quick review tonight and then merge it.
Thanks again, I've merged the code and made some further improvements, see f5079fb258d32ae4bc99b55b698e3b571bc608f5 For example, I added a template parameter for the the initializing stepper in the abm stepper, that allowed me to get rid of the initializing test case. Also, I changed the loop back to the for loop you had initially, sorry for the back and forth... and some minor cosmetic changes (e.g. camel case)
As discussed in https://github.com/headmyshoulder/odeint-v2/issues/145