[Ipopt] dynamic_cast<OrigIpoptNLP*>(GetRawPtr(ip_cq->GetIpoptNLP())) returns NULL-Pointer during restoration phase
holger ackermann
ipopt at schwedenstuhl.de
Wed Jun 17 08:16:17 EDT 2009
Hello to the list,
this is my first post, so I'll write a few words about my "project". I'm
currently writing my master thesis in structural engineering about a new
algorithm to solve nonlinear constraint conditions in a spatial
framework analysis software. I already included Ipopt in this software
and my work is almost done except for this strange thing.
I need to evaluate the intermediate solution of the untransformed
problem in TNLP::intermediate_callback. I found this post
(http://list.coin-or.org/pipermail/ipopt/2008-November/001375.html) and
the proposed solution works fine except when I have problems that enter
the restoration phase. Say, when
SolverReturn resto_status = resto_alg_->Optimize(true);
is called instead of
status = p2alg->Optimize();
I'm using the C++ interface to Ipopt 3.6.1 and this is the code for
MY_NLP::intermediate_callback so far:
-->
OrigIpoptNLP* orignlp =
dynamic_cast<OrigIpoptNLP*>(GetRawPtr(ip_cq->GetIpoptNLP()));
assert(orignlp);
TNLPAdapter* tnlp_adapter =
dynamic_cast<TNLPAdapter*>(GetRawPtr(orignlp->nlp()));
assert(tnlp_adapter);
Number* my_x = new Number[size_x];
tnlp_adapter->ResortX(*(Vector*)(GetRawPtr(ip_data->curr()->x())), my_x);
return check(my_x);
<--
During restoration phase
dynamic_cast<OrigIpoptNLP*>(GetRawPtr(ip_cq->GetIpoptNLP())) returns a
NULL-Pointer with which I cannot proceed as intended.
I'm not quite sure what "restoration phase" means as I'm not very
familiar with the theory of Ipopt, but maybe someone can give me a
hint if it's possible to get the intermediate solution during
restoration phase and (if yes) how to obtain it.
Any help is greatly appreciated, thanks in advance.
Holger
More information about the Ipopt
mailing list