[Ipopt] Ipopt report issue

Sebastian Ferrera Ferrera sebastian.ferrera at corpbanca.cl
Fri Dec 3 15:14:22 EST 2010

Thanks for the help Stefan,

I am using a precompiled dll (Ipopt38.dll) and a class called Ipopt.cs

This Ipopt.cs has some dll methods declarations that can be used in my project:

        unsafe private static extern int IpoptSolve(
            IntPtr ipopt_problem, double* x, double* g, double* obj_val, double* mult_g, double* mult_x_L, double* mult_x_U, void* user_data); 

        unsafe private static extern IntPtr CreateIpoptProblem(int n, double* x_L, double* x_U, int m, double* g_L, double* g_U,  int nele_jac, 
            int nele_hess, int index_style, Eval_F_CB eval_f, Eval_G_CB eval_g, Eval_Grad_F_CB eval_grad_f, Eval_Jac_G_CB eval_jac_g, Eval_H_CB eval_h);

The way that I use the class is:

using (Ipopt problem = new Ipopt(initialGuess.Length, xLowerLimit, xUpperLimit, fConstraint.nRows, fLowerLimit, fUpperLimit, (fConstraint.nRows * fConstraint.nCols), objectiveGradient.Length, eval_f, eval_g, eval_grad_f, eval_jac_g, eval_h));


problem.SolveProblem(initialGuess, out obj, null, null, null, null);

So, can I use your solution with my actual 

Ps: the class was written under c#

-----Mensaje original-----
De: Stefan Vigerske [mailto:stefan at math.hu-berlin.de] 
Enviado el: Viernes, 03 de Diciembre de 2010 15:10
Para: Sebastian Ferrera Ferrera
CC: ipopt at list.coin-or.org
Asunto: Re: [Ipopt] Ipopt report issue


Ipopt has the concept of Journals that can be used to redirect output to 
whereever you like.

When you create the IpoptApplication object, just give it as argument a 
"false", so it does not create the default journal:
        ipopt = new IpoptApplication(false);

Then you can create your own journal and pass it to Ipopt. It should be 
called "console", otherwise Ipopt may create another one later, if I 
rembember correct.
   SmartPtr<Journal> jrnl = new MyJournal(gev, "console", J_ITERSUMMARY);
   jrnl->SetPrintLevel(J_DBG, J_NONE);
   if (!ipopt->Jnlst()->AddJournal(jrnl))
     std::cerr << "Failed to register MyJournal for IPOPT output."
               << std::endl;

There are also some Journals implemented already, you may be interested 
in the StreamJournal, which you can give a stringstream, that you can 
transform into a string object afterwards.


Am 03.12.2010 15:05, schrieb Sebastian Ferrera Ferrera:
> Hello friends,
> I am currently working on a project using the Ipopt minimization.
> I am writing because I would like to know whether it is posible to configure Ipopt so that the report does not appear in the Windows command prompt but e.g. in a string variable.
> Thank you and regards,
> Atte.,
> Sebastián Ferrera.
> Ingeniero Financiero en Sistemas Junior
> Ingeniería Financiera
> Rosario Norte Nº 660 Piso 7
> Fono: 660 2413
> E-mail : sebastian.ferrera at corpbanca.cl<mailto:david.matamala at corpbanca.cl>
> www.corpbanca.cl<http://www.corpbanca.cl/>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt

More information about the Ipopt mailing list