[CppAD] Need Help Using ForTwo(x, j, k)
Brad Bell
bradbell at seanet.com
Wed Sep 2 08:23:13 EDT 2009
The problem is that VectorSize_t is a template parameter to the routine
ForTwo, see the heading VectorSize_t on the web page
http://www.coin-or.org/CppAD/Doc/fortwo.xml#VectorSize_t
It is also a template parameter in the ForTwoCases function of the example
http://www.coin-or.org/CppAD/Doc/fortwo.cpp.xml
At the bottom of this example file, you will note that the corresponding
choices for VectorSize_t that are tested are
std::vector<size_t>
CppAD::vector<size_t>
std::valarray<size_t>
I think that if you replace VectorSize_t by any of these choices, you
will not have this problem
bradbell at seanet.com wrote:
>> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }
>> How should I declare j and k ?
>> I included
>>
>> #include
>> , but I still get error messages that VectorSize_t and VectorBase
>> are
>> undeclared identifier
>> I am using CppAD with Ipopt
>> Tks,
>> Eduardo
>> _______________________________________________
>> CppAD mailing list
>> CppAD at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/cppad
>>
>>
>
> Is it possible for you to create a short C++ file that uses CppAD::ForTwo
> and that generates the error message when it is compiled ? If so, would
> you please e-mail a copy of the routine.
>
>
einglez at terra.com.br wrote:
>
>
> Sure. Follow a brief of the code.
>
> #include
> ......
> //Ipopt Function BODY { font-family:Arial, Helvetica,
> sans-serif;font-size:12px; }
>
> bool HS071_NLP::get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
> Index& nnz_h_lag, IndexStyleEnum& index_style)
> {
> ......
> CppAD::ADFun f3(X, Y);
> ......
> CPPAD_TEST_VECTOR otp(1*n);
> size_t pp = 2;
> VectorSize_t jj(pp);
>
> VectorSize_t kk(pp);
>
> ddy = f3.ForTwo(xad,jj,kk);
> ......
> }
More information about the CppAD
mailing list