<div dir="ltr">Thank you Robert!<div><br></div><div>I will give the OSI API a try. It is what I am looking for: an API.</div><div><br></div><div>Thank you very much.</div><div><br></div><div>Robinson</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-21 20:54 GMT-04:00 Lacroix, Robert <span dir="ltr"><<a href="mailto:ralacroix@hydro.mb.ca" target="_blank">ralacroix@hydro.mb.ca</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-CA" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Robinson,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I can see why you are having a problem. The CLP user guide is falling apart. All the CLP example source code hosted on IBM’s web site is gone!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="http://www.coin-or.org/Clp/userguide/ch04.html" target="_blank">http://www.coin-or.org/Clp/userguide/ch04.html</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Apart from this, I recommend using the COIN-OR Open Solver Interface (OSI) API. You can load the rows and columns of the LP into a CoinPackedMatrix then present
 it to the solver through the OSI API. First use Gurobi as the back-end solver to validate that you are correctly loading the LP into the matrix and getting back the answers you expect. Then after you are satisfied that your API usage is correct, switch the
 solver engine to CLP.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I do not recommend using MPS files when you can use an API. If you must use MPS files, try to use the printed IEEE format for values.<u></u><u></u></span></p>
<p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>1)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">MPS is a text file format. Most numbers printed as decimal differ in value and precision form the internal IEEE double precision representation -
 not a good way to transfer data between iterations, especially on sensitive problems where tiny changes can lead to different solutions.
<u></u><u></u></span></p>
<p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>2)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Writing MPS files takes several orders of magnitude more time, compared to copying arrays of data in memory. Would you wait 25 minutes to create the
 MPS file for an iteration that takes only 33 seconds to solve? (from our experience trying this with LPs considerably smaller than the sparse 38000 row and 96000 column problems we formulate these days).<u></u><u></u></span></p>
<p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>3)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you use the Gurobi API only to formulate the problem and send it to the MPS file, then you are still using Gurobi, just not as a solver.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Robert Lacroix<br>
Manitoba Hydro<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Clp [mailto:<a href="mailto:clp-bounces@coin-or.org" target="_blank">clp-bounces@coin-or.org</a>]
<b>On Behalf Of </b>Robinson Lemos<br>
<b>Sent:</b> Monday, July 18, 2016 10:02 AM<br>
<b>To:</b> <a href="mailto:clp@list.coin-or.org" target="_blank">clp@list.coin-or.org</a><br>
<b>Subject:</b> [Clp] Hello and Help to start using clp.<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hello from Brazil.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I am Robinson Lemos.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">First i want to apologize my English and I hope it all makes sense.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have read the tutorials at <a href="https://projects.coin-or.org/Clp" target="_blank">https://projects.coin-or.org/Clp</a>, but I did not understand a way to read a model from memory or construct it.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I want to leave gurobi and start using clp only.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">My deal is the following:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I use an algorithm, and each iteration i need to change and solve a LP model some times. In the MPS way i will need to create, save and read about 30-600 MPS files per iteration.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is there any tutorial showing how to use the loadProblem() variations?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Robinson Lemos.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div></div></div>
</div>

<br>_______________________________________________<br>
Clp mailing list<br>
<a href="mailto:Clp@list.coin-or.org">Clp@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/clp" rel="noreferrer" target="_blank">http://list.coin-or.org/mailman/listinfo/clp</a><br>
<br></blockquote></div><br></div>