<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">El dom., 6 ene. 2019 a las 13:27, John Forrest (<<a href="mailto:john.forrest@fastercoin.com">john.forrest@fastercoin.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <div class="gmail-m_-5057512837296354997moz-cite-prefix">If you update Cbc stable and add</div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix"> -DKEEP_ORIGINAL_SOLVER</div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix">to CXXDEFS in configure then solver
      will stay same.</div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix">Remember that the bounds on integer
      variables will have been changed to give an integer solution.</div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5057512837296354997moz-cite-prefix">John Forrest<br>
    </div>
    </div></blockquote><div><br></div>Thank you John! You were really fast to take care of my question. But I think this solution is not the ideal to me, since before use Muriqui Optimizer, users would have to install CBC by themselves, and probably they will not use -DKEEP_ORIGINAL_SOLVER. <br><br>>From my point of view, it would be better if there were a parameter in CbcModel to be set. For example, if I would set a hypothetical parameter CbcKeepOriginalSolver to 1, the original solver is kept. Or maybe a method in CbcClass to set this behavior, like this:<br><br>void keepOriginalSolver (bool value);<br><br>Thanks for your attention.<br><br>Wendel Melo<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
    <div class="gmail-m_-5057512837296354997moz-cite-prefix">On 05/01/2019 23:12, Wendel Melo wrote:<br>
    </div>
    <blockquote type="cite">
      <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="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.wendelmelo.net_software&d=DwMDaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=vF3oHShdseEsl9rfkG3oDqswH4nxi3dKxBlIUpKfP9I&s=Xab9Z8MBD4MYd7iPauJrXypCU1gGdGvKVvcivCdX9OM&e=" target="_blank">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="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.wendeldelo.net&d=DwMDaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=vF3oHShdseEsl9rfkG3oDqswH4nxi3dKxBlIUpKfP9I&s=bS4fzYTpGhS1fjOrU5uvoQyqlePAhVZ612Mm_CJ_rZA&e=" target="_blank">www.wendeldelo.net</a><br>
        </div>
      </div>
      <br>
      <fieldset class="gmail-m_-5057512837296354997mimeAttachmentHeader"></fieldset>
      <pre class="gmail-m_-5057512837296354997moz-quote-pre">_______________________________________________
Cbc mailing list
<a class="gmail-m_-5057512837296354997moz-txt-link-abbreviated" href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a>
<a class="gmail-m_-5057512837296354997moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwMDaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=vF3oHShdseEsl9rfkG3oDqswH4nxi3dKxBlIUpKfP9I&s=quCvwOIaRK375syP7lDh6Lr3th1N40SaGOiNE2b6XZo&e=" target="_blank">https://list.coin-or.org/mailman/listinfo/cbc</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </div>

_______________________________________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=vF3oHShdseEsl9rfkG3oDqswH4nxi3dKxBlIUpKfP9I&s=quCvwOIaRK375syP7lDh6Lr3th1N40SaGOiNE2b6XZo&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=vF3oHShdseEsl9rfkG3oDqswH4nxi3dKxBlIUpKfP9I&s=quCvwOIaRK375syP7lDh6Lr3th1N40SaGOiNE2b6XZo&e=</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Wendel</div></div></div>