[Ipopt] intermediate_callback

Dominik Skanda dominik.skanda at web.de
Thu Nov 27 10:59:33 EST 2008


I have inserted your example code in mine and now I get this Error Message "Fehler: »OrigIpoptNLP« wurde in diesem Gültigkeitsbereich nicht definiert" (in English: »OrigIpoptNLP« was not defined in this region ) so I searched in the internet and found that this class is defined in IpOrigIpoptNLP.hpp, so I put "#include <IpOrigIpoptNLP.hpp>" in my code, but now I get a second error message that the compiler doen't find that hpp. So I looked at my IpOPT folder and didn't found the file. So I'm a little stranded! Has IpOPT changed ? Do you know what to do?

Thanks a lot in advonce 
Dominik




> -----Ursprüngliche Nachricht-----
> Von: "Stefan Vigerske" <stefan at vigerske.de>
> Gesendet: 27.11.08 16:08:03
> An: Dominik Skanda <dominik.skanda at web.de>
> CC: ipopt at list.coin-or.org
> Betreff: Re: [Ipopt] intermediate_callback


> Hi,
> 
> > Thank you for your reply, 
> > this seems to me very non intuitive ;-), can you give me an example so that I get an array back like in the eval_f function ( eval_f(... const Number* x ...) )
> 
> OK, you caught me. I forgot to mention that you get the vector of the
> "transformed" problem, i.e., not the problem as you specify in TNLP, but
> with slacks included and fixed variables removed.
> It's a bit tricky to sort the vector back into the TNLP space, since you
> need the TNLPAdapter. This is what Andreas once told me how to get the
> TNLPAdapter:
> 1. Use IpoptCalculatedQuantities::GetIpoptNLP() to get a pointer to an
> Ipopt::IpoptNLP.
> 2. Cast this Ipopt::IpoptNLP to an Ipopt::OrigIpoptNLP
> 3. Use Ipopt::OrigIpoptNLP::nlp() to get the Ipopt::NLP
> 4. This Ipopt::NLP is actually the TNLPAdapter
> 
> In code, this would be
> OrigIpoptNLP* orignlp =
> dynamic_cast<OrigIpoptNLP*>(GetRawPtr(ip_cq->GetIpoptNLP()));
> assert(ip_cq);
> TNLPAdapter* tnlp_adapter =
> dynamic_cast<TNLPAdapter*>(GetRawPtr(orignlp->nlp()));
> assert(tnlp_adapter);
> 
> Then you could use curr()->x() from IpoptData and ResortX from
> TNLPAdapter to sort it back:
> 
> double* my_x = new double[... dimension in TNLP problem ...];
> tnlp_adapter->ResortX(data->curr()->x(), my_x);
> 
> Best,
> Stefan
> 


_________________________________________________________________________
Sensationsangebot nur bis 30.11: WEB.DE FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.web.de/?ac=OM.AD.AD008K13805B7069a




More information about the Ipopt mailing list