<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">If you update Cbc stable and add</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"> -DKEEP_ORIGINAL_SOLVER</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">to CXXDEFS in configure then solver
will stay same.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Remember that the bounds on integer
variables will have been changed to give an integer solution.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">John Forrest<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 05/01/2019 23:12, Wendel Melo wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAATj=845ooLpKqT=H0fdDLu7oUEKe2cM3vJjV8nNYfKoKMMv=A@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">Dear friends<br>
<br>
I am giving my first steps with CBC to Mixed Integer Linear
Programming (MILP) by means of the C++ API. My current goal is
to turn Cbc one of the MILP solvers supported in Muriqui
Optimizer, a free MINLP solver (<a
href="http://www.wendelmelo.net/software"
moz-do-not-send="true">www.wendelmelo.net/software</a>).<br>
<br>
Due to design questions, I have been constructing an object of
the CbcModel class using an empty OsiSolverInterface object:<br>
<br>
OsiClpSolverInterface clp ;<br>
CbcModel *model = new (std::nothrow) CbcModel(clp);<br>
<br>
After that, I have been set the coefficients of my MILP
problem by means of the pointer returned by the method
CbcModel::solver, for example:<br>
<br>
OsiSolverInterface *solver = model->solver()<br>
<br>
solver->addCol(0, NULL, NULL, 0.0, 1000.0, 1.0);<br>
<br>
I am performing in this way to avoid delay copping the
OsiSolverInterface object in the CbcModel constructor since I
need to solve a sequence where the same MILP problem has to be
solved several times just changing some parameters.<br>
<br>
But I have been getting some problems. After calling method
CbcModel::branchAndBound by the second time, the pointer
returned by CbcModel::solver is getting a different value of
the previous call, for example:<br>
<br>
std::cout << "before BB solver pointer: " <<
model->solver() << std::endl;<br>
model->branchAndBound()<br>
std::cout << "after BB solver pointer: " <<
model->solver() << std::endl;<br>
<br>
The code above prints:<br>
<br>
before BB solver pointer: 0x1455a628<br>
after BB solver pointer: 0x14887f88<br>
<br>
So, we can see the solver pointer in CbcModel object was
changed. Why is it happening? I believe creating new solver
objects is bad because increase the computations. Is there a
way to avoid the changing of solver object pointer? Are there
other methods in CbcModel that can provoke the changing of the
solver pointer?<br>
<br>
Thanks in advanced<br>
<br>
Best regards<br>
<br>
<br>
Wendel Melo<br>
<a href="http://www.wendeldelo.net" moz-do-not-send="true">www.wendeldelo.net</a><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Cbc mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="https://list.coin-or.org/mailman/listinfo/cbc">https://list.coin-or.org/mailman/listinfo/cbc</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>