[Coin-discuss] Matthieu.Bolt at klm.com
John J Forrest
jjforre at us.ibm.com
Wed Nov 8 12:39:38 EST 2006
coin-discuss-bounces at list.coin-or.org wrote on 11/08/2006 10:33:01 AM:
> Hi all,
>
> I used CbcMain.cpp as an example for constructing my own solver.
> All compiled fine but I don't understand the methods preProcess and
> postProcess from the class CglPreProcess:
>
> OsiSolverInterface * preProcess( OsiSolverInterface & model, bool
> makeEquality=false, int numberPasses=5)
> void postProcess(OsiSolverInterface &model);
>
You might do better to use sample2.cpp rather than CbcMain.cpp (or
CoinSolve.cpp).
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.
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").
> More specific I have the following questions:
>
> - Should preProcess be called before or after adding cut generators to
the
> model?
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.
>
> - Why is the first parameter of preProcess called "model" while it is a
> solver?
Well it really is an LP model - but I agree.
> I find this confusing because at the moment I call preProcess I have
already
> assigned a solver to my CbcModel.
Better to assign it afterwards as CbcModel clones the solver it is given.
I apologize for preprocessing being a bit of a mess but some things were
difficult with OsiSolverInterface lacking features.
John Forrest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20061108/145d4da3/attachment.html>
More information about the Coin-discuss
mailing list