<br>
<br><tt><font size=2>coin-discuss-bounces@list.coin-or.org wrote on 11/08/2006
10:33:01 AM:<br>
<br>
> Hi all,<br>
> <br>
> I used CbcMain.cpp as an example for constructing my own solver.<br>
> All compiled fine but I don't understand the methods preProcess and
<br>
> postProcess from the class CglPreProcess:<br>
> <br>
> OsiSolverInterface * preProcess( OsiSolverInterface & model, bool
<br>
> makeEquality=false, int numberPasses=5)<br>
> void postProcess(OsiSolverInterface &model);<br>
></font></tt>
<br>
<br><tt><font size=2>You might do better to use sample2.cpp rather than
CbcMain.cpp (or CoinSolve.cpp).</font></tt>
<br><tt><font size=2>The idea is (non Cbc specific) that you can do certain
things once to try and improve model. So preProcess does repeated
normal presolves, tries to fix variables but also finds duplicate rows
and tries to strengthen constraints etc etc. </font></tt>
<br>
<br><tt><font size=2>If you prefer you can pass in CbcStrategy to CbcModel
to do preprocessing inside CbcModel. You should find that a lot simpler
(again see sample2.cpp). You could also use the magic -cpp 0 option
to generate a driver (from "cbc").</font></tt>
<br><tt><font size=2><br>
> More specific I have the following questions:<br>
> <br>
> - Should preProcess be called before or after adding cut generators
to the <br>
> model?</font></tt>
<br>
<br><tt><font size=2>I don't think it makes any difference with any of
the current cut generators. Unless you need to know structure before,
you might as well do it after.<br>
> <br>
> - Why is the first parameter of preProcess called "model"
while it is a <br>
> solver?</font></tt>
<br>
<br><tt><font size=2>Well it really is an LP model - but I agree. <br>
> I find this confusing because at the moment I call preProcess I have
already <br>
> assigned a solver to my CbcModel.</font></tt>
<br>
<br><tt><font size=2>Better to assign it afterwards as CbcModel clones
the solver it is given.</font></tt>
<br>
<br><tt><font size=2>I apologize for preprocessing being a bit of a mess
but some things were difficult with OsiSolverInterface lacking features.</font></tt>
<br>
<br><tt><font size=2>John Forrest</font></tt>
<br><tt><font size=2><br>
</font></tt>