[Coin-discuss] Cbc question: Adding SOS data to a preprocessed problem
Kish Shen
kish.shen at crosscoreop.com
Mon Sep 11 17:20:16 EDT 2006
Hi,
I am trying to add SOS data to a problem to my code. Currently, my code use
OsiClpSolverInterface to setup a problem. To solve a MIP problem, I create a
preprocessed copy of the problem:
mipsolver = process.preProcess(*lpd->lp->Solver, false, 5);
where lpd->lp->Solver is the `original' problem, and is OsiClpSolverInterface*,
mipsolver is a OsiSolverInterface*.
The CbcModel for the problem is then created by:
mipmodel = new CbcModel(static_cast<OsiSolverInterface &>(*mipsolver));
Looking at the example Cbc code sample4, SOS data can be added to a CbcModel
using
mipmodel->addObjects(nsos,objects);
where objects is an array of CbcObjects constructed using CbcSOS.
However, the construction of the CbcObjects are done using the column indexes from
the original problem, not the preprocessed problem that was assigned to mipmodel. So
I assume I cannot simply call addObjects as above. Is there anyway I can add these SOS
to the problem?
Thanks in advance for any information/help!
Cheers,
Kish
More information about the Coin-discuss
mailing list