[Ipopt] re-use AmplTNLP

Andreas Waechter andreasw at watson.ibm.com
Tue May 26 10:30:45 EDT 2009


Hi Ali,

What you suggest might be enough - you are now changing the internal data 
structure of the Ampl Solver Library.  That might work.

What I would have done is to write a new TNLP class that is a wrapper for 
the Ampl TNLP class (AmplTNLP).  It would have an AmplTNLP as a member, 
and it would pass the calls of all methods directly to the same method of 
the AmplTNLP, except for get_bounds_info, where you could now return your 
own bounds (not the ones that AmplTNLP returns).

Regards,

Andreas

On Tue, 19 May 2009, Ali Baharev wrote:

> Is the following below enough? (Because it seems to work...)
>
> (from ampl_ipopt.cpp)
>
> retval = app->OptimizeTNLP(ampl_tnlp);
>
> AmplTNLP* raw_ptr = static_cast<AmplTNLP*>(GetRawPtr(ampl_tnlp));
>
> ASL_pfgh* asl = raw_ptr->AmplSolverObject();
>
> for (int i=0; i<n_var; ++i)
>  havex0[i] = 1;
>
> // Change the initial point here
>
> X0[0] = 0.1167;
> X0[1] = 0.0370;
>
> // etc ...
>
> // Change bounds on the variables here
>
> LUv[0] = 0.02;
> LUv[1] = 0.20;
>
> LUv[2] = 0.01;
> LUv[3] = 0.05;
>
> // etc ...
>
> retval = app->ReOptimizeTNLP(ampl_tnlp);
>
> // etc...
>
> Any help is greatly appreciated.
>
> Ali
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>
>



More information about the Ipopt mailing list