[Bonmin] can't redirect certain message via jounalist

ycollet at freesurf.fr ycollet at freesurf.fr
Thu Apr 30 03:32:56 EDT 2009


Finally, I found a simpler solution. A good method was hidden somewhere
(damn C++).

the nonlinearSolver return the good pointer.

BonminSetup * bonmin = NULL;
bonmin = new BonminSetup;

printer = new CoinMessageHandler();
bonmin->nonlinearSolver()->passInMessageHandler(printer);

Thanks for the infos.

Yann

> You need to provide also a CoinMessageHandler. However, it is a bit
> tricky to make Bonmin use it, since you need to fool the BonminSetup.
>
> Instead of doing
> BonminSetup bonmin_setup;
> bonmin_setup.initializeBonmin(minlp);
>
> you can do something like
>
> OsiTMINLPInterface ositminlp;
> ositminlp.initialize(roptions, options, journalist, minlp);
> ositminlp.passInMessageHandler(&messagehandler);
> bonmin_setup.initialize(ositminlp); // this clones first_osi_tminlp
>
> But next to the minlp, you then also need to create the
> RegisteredOptions, Options, and Journalist by yourself.
> Or maybe I have not seen a simpler way. My code is here:
> https://projects.coin-or.org/GAMSlinks/browser/stable/0.4/GAMSlinks/src/Bonmin/GamsBonmin.cpp#L133
>
> The cleaner way is probably to create your own BonminSetup class. I
> think that is what they have done for the ampl interface.
>
> Stefan
>




More information about the Bonmin mailing list