[CppAD] Bug in Optimize function
bradbell at seanet.com
bradbell at seanet.com
Thu Nov 12 09:12:17 EST 2009
Thank you for the bug report. It has been fixed by the changes is
https://projects.coin-or.org/CppAD/changeset/1580
(Part of the optimize testing was commented out by mistake. This was fixed
in change set 1581.)
The fix is immediately available using subversion to download the CppAD
source.
http://www.coin-or.org/CppAD/Doc/subversion.xml
If you use the tarballs at
http://www.coin-or.org/download/source/CppAD/
you will have to wait for version 20091113 for higher.
> 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
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
>
More information about the CppAD
mailing list