<font face="arial,helvetica,sans-serif">Hi Alexis,<br><br>Just to understand what is happening:<br><br>Why you are using CBC if your code apparently depends only of CLP ?<br><br><br></font><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Fri, Nov 16, 2012 at 7:35 PM, Alexis Guigue <span dir="ltr">&lt;<a href="mailto:aguigue@softree.com" target="_blank">aguigue@softree.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I am playing around with handlers now and I have come across the following. In words (but<br>
I can provide more code if needed).<br>
<br>
- I have derived a class OptEventHandler from ClpEventHandler.<br>
- I am creating an instance m_osiClpSolver of OsiClpSolverInterface and populate it with some data<br>
- Then comes setting the handler<br>
        OptEventHandler handler;<br>
m_osiClpSolver.getModelPtr()-&gt;<u></u>passInEventHandler(&amp;handler);<br>
- And finally, the call to optimization<br>
    m_osiClpSolver.initialSolve();<br>
<br>
My function int OptEventHandler::event(Event whichEvent) is quite trivial, i.e.,<br>
 if (whichEvent == endOfIteration) {<br>
        int numIter = model_-&gt;getIterationCount();<br>
        cout &lt;&lt; numIter  &lt;&lt; &quot;\n&quot;;<br>
end<br>
<br>
For the first problem I try, everything goes well, the iteration number displays and<br>
the problem solves to optimality. I checked, the algorithm used is -1.<br>
<br>
For my second problem (almost the same), the iteration number keeps at 0.<br>
However, the problem solves to optimality, and I checked the algorithm in<br>
model_ is 0.<br>
<br>
I know it is somewhat a rough description, but any idea why I am not able<br>
to get the iteration number in the second case (note, I am still with CBC 2.7.1).<br>
<br>
Cheers<br>
<br>
Thanks<span class="HOEnZb"><font color="#888888"><br>
<br>
Alexis<br>
<br>
<br>
-- <br>
Software Engineer/Research Engineer<br>
Softree Technical Systems Inc.<br>
<a href="http://www.softree.com" target="_blank">www.softree.com</a><br>
Engineering an Easier Way<br>
<br>
______________________________<u></u>_________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/cbc" target="_blank">http://list.coin-or.org/<u></u>mailman/listinfo/cbc</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><span style="font-family:courier new,monospace">=============================================================<br>Haroldo Gambini Santos<br>Computing Department<br>
Universidade Federal de Ouro Preto - UFOP<br>email: haroldo [at ] <a href="http://iceb.ufop.br" target="_blank">iceb.ufop.br</a><br>home/research page: <a href="http://www.decom.ufop.br/haroldo/" target="_blank">www.decom.ufop.br/haroldo</a><br>
</span><br>
</div>