<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi Tom,<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thank you for the alternative solution Tom, however I implemented the solution proposed by John Forrest and it works well!</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Andrea<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Da:</b> Cbc <cbc-bounces@coin-or.org> per conto di Tom Anderson <twic@urchin.earth.li><br>
<b>Inviato:</b> mercoledì 21 marzo 2018 14:40:21<br>
<b>A:</b> cbc@list.coin-or.org<br>
<b>Oggetto:</b> Re: [Cbc] CBC stand-alone vs callable</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Andrea,<br>
<br>
Alternatively, if you have a command line using the stand-alone cbc which <br>
you are happy with, then you can add the -cpp flag to it to generate C++ <br>
code which will reproduce the command-line use. The help text says:<br>
<br>
cpp(Generate) : Generates C++ code<br>
Once you like what the stand-alone solver does then this allows you<br>
to generate user_driver.cpp which approximates the code.  0 gives<br>
simplest driver, 1 generates saves and restores, 2 generates saves<br>
and restores even for variables at default value. 4 bit in cbc generates<br>
size dependent code rather than computed values.  This is now deprecated<br>
as you can call stand-alone solver - see Cbc/examples/driver4.cpp.<br>
<br>
Although this is deprecated in favour of calling CbcMain1 directly, it <br>
still works as far as i can tell. It's useful if you want to write your <br>
own heuristics, or do other funky stuff that you can't express through the <br>
command-line interface (which i do!).<br>
<br>
Regards,<br>
tom<br>
<br>
On Wed, 21 Mar 2018, John Forrest wrote:<br>
<br>
> Andrea,<br>
><br>
> If you use CbcMain0 and CbcMain1 you can get the same functionality.  Look at <br>
> the various driver*.cpp examples in Cbc/examples.<br>
><br>
> John Forrest<br>
><br>
> On 21/03/18 11:17, Andrea Manno wrote:<br>
>> <br>
>> Dear all,<br>
>> <br>
>> <br>
>> I would kindly ask you two questions about the usage of CBC.<br>
>> <br>
>> <br>
>> 1) I am using the callable version of CBC as the MILP solver unit embedded <br>
>> in a c++ code. So what I am doing is nothing but including all the needed <br>
>> CBC, OSI and CGL  header file and linking all the necessary library in <br>
>> order to use the branchAnbBound() method of the CbcModel class. However I <br>
>> would like to replicate exactly the performance of the stand-alone <br>
>> executable version of cbc that I have used on the same instances as AMPL <br>
>> solver. Anyone knows the setting of the stand-alone executable version of <br>
>> cbc? I'am referring to the default options of presolve/preprocess, <br>
>> heuristics and cuts in the stand-alone version.<br>
>> <br>
>> <br>
>> 2) In case preprocess/presolve is needed for the answer of question 1), <br>
>> which is the right way to invoke the preprocess/presolve before the <br>
>> branchAnbBound() method (It si not so clear from the examples and from the <br>
>> user guide). It si possible to have a simple example?<br>
>> <br>
>> <br>
>> Thank you so much,<br>
>> <br>
>> <br>
>> Andrea Manno<br>
>> <br>
>> <br>
>> <br>
>> _______________________________________________<br>
>> Cbc mailing list<br>
>> Cbc@list.coin-or.org<br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwID-g&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=O8sJm66476KNQb0_wC5yq8bL2q13RBM-tS6AWZrDuUY&m=LR24XktatkwP7m66AJbNNQHZbR8RJaQfKTA82MfX6EE&s=etpU9PEI9BoOCyxoLReE4a9zywuzqGFr2WN7_AVPkZ8&e=">
https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cbc&d=DwID-g&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=O8sJm66476KNQb0_wC5yq8bL2q13RBM-tS6AWZrDuUY&m=LR24XktatkwP7m66AJbNNQHZbR8RJaQfKTA82MfX6EE&s=etpU9PEI9BoOCyxoLReE4a9zywuzqGFr2WN7_AVPkZ8&e=</a><br>
><br>
><br>
><br>
<br>
-- <br>
My opinion is that some platforms and frameworks come bundled with a set<br>
of philosophical characteristics that most practitioners adopt. Some<br>
popular open source web frameworks include a poster of Knuth's famous<br>
quote about premature optimization and adopters consider that quote<br>
to mean than it does, thereby expressly avoiding spending time thinking<br>
about performance because doing so might lead to time spent on optimizing<br>
code and that is evil. -- bhauer</div>
</span></font></div>
</body>
</html>