[Coin-ipopt] A problem using IPOPT with QT library

Andreas Waechter andreasw at watson.ibm.com
Wed Jul 5 13:25:59 EDT 2006


Hi Yang,

I have no experience with QT, and I don't know why the contructor would 
fail.  Maybe someone else reading this mailing list has an idea?

Andreas

On Tue, 4 Jul 2006, Yang Liu wrote:

> Dear all,
>
> Does anyone use IPOPT in QT(Trolltech QT GUI library) program?
>
> My program always failed in the constructor of IpoptApplication.
>
> I traced back to ipipoptapplication.cpp,  and I found the variables
> jnlst_, options_  are not created by new operator.
>
> IpoptApplication::IpoptApplication(bool create_console_out)
>     :
>     jnlst_(new Journalist()),
>     options_(new OptionsList()),
>     statistics_(NULL),
>     alg_(NULL),
>     nlp_adapter_(NULL)
>
>
> The problem only occurs in QT environment.
>
> The following is my main code.
>
> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> #include <QtGui/QApplication>
> #include "qtest.h"
> #include "IpIpoptApplication.hpp"
> #include "IpSolveStatistics.hpp"
> #include "MyNLP.hpp"  //The example from Itopt library using namespace Ipopt;
>
> int main(int argc, char *argv[])
> {
>
> 	// Create an instance of your nlp...
> 	SmartPtr<TNLP> mynlp = new MyNLP();
>
> 	// Create an instance of the IpoptApplication
>               //The program failed here
> 	SmartPtr<IpoptApplication> app = new IpoptApplication();
> 		// Initialize the IpoptApplication and process the options
> 	app->Initialize();
>
> 	ApplicationReturnStatus status = app->OptimizeTNLP(mynlp);
>
>
>   QApplication a(argc, argv);
>   qtest w;
>   w.show();
>   a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
>   return a.exec();
> }
>
> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
> Many thanks.
>
>
> Best regards,
>
> Yang Liu
> PhD Candidate
> Department of Computer Science,
> The University of Hong Kong
> _______________________________________________
> Coin-ipopt mailing list
> Coin-ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-ipopt
>



More information about the Coin-ipopt mailing list