[Coin-discuss] sychronising the solution for OsiCbc after branch and bound
Kish Shen
kish.shen at crosscoreop.com
Thu Jun 29 23:36:57 EDT 2006
Hi,
I have been trying to improve the performance of the MIP search while using
the OsiCbcSolverInterface. Instead of just calling the branchAndBound()
method, I tried to use the code from the sample2.cpp example in Cbc's Sample
directory.
I can see from the message that the MIP search seem to work correctly, but
trying to access the solution state via OsiCbcSolverInterface does not work.
I think this is because the sample2 code clones the solver before doing the
search.
I tried to do a dynamic cast (as John suggested in answer to another post of
mine):
model.branchAndBound();
lpd->lp->Solver = dynamic_cast< OsiCbcSolverInterface*>(model.solver());
where model is a CbcModel, and lpd->lp->Solver is a OsiCbcSolverInterface *.
This however seg faults as soon as I make the next call using lpd->lp->Solver.
I assume this is because model.solver() is the clp solver, rather than Cbc?
How should I set the state of lpd->lp->Solver to the model's?
I also need to preserve the reference solver of the original CbcModel pointer
of lpd->lp->Solver, because I saved the original state of the problem before
going into the branch and bound.
Thanks in advance for any help!
Cheers,
Kish Shen
More information about the Coin-discuss
mailing list