[CppAD] Bug in Optimize function

Dominik Skanda Dominik.Skanda at biologie.uni-freiburg.de
Tue Nov 10 10:32:11 EST 2009


Hello all,
I have found a bug in the optimize() function.


Following code doesn't work:


#include <iostream>
#include "BDF_integrator.hpp"
#include "cppad/cppad.hpp"


using namespace std;


int main()
	{
		unsigned int i,j;
		vector< CppAD::AD<double> >    x(3);
		vector< CppAD::AD<double> > xdot(3);
		
		x[ 0]= 1;
		x[ 1]= 2;
		x[ 2]= 3;

		
		CppAD::Independent(x);
		
		vector< CppAD::AD<double> > A(1);
		
		
		A[0]=CppAD::pow(x[0],3.3);

		for (i=0;i<3;i++)
			xdot[i]=A[0]+x[i];
			
	    	CppAD::ADFun<double> RHS;
		RHS.Dependent(x, xdot);
		//RHS.optimize();
		
		return 0;
	}



This is cause in the CppAD::pow function the exponent is double and not
a integer!!!!

Please HELP


Kind regards,
Dominik



More information about the CppAD mailing list