Skip to content

Commit

Permalink
define cbc model before it's file handler
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Oct 11, 2023
1 parent a6f6855 commit 90558d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/multisolver_interface/SolverCbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ SolverCbc::SolverCbc(const std::shared_ptr<const SolverAbstract> toCopy)
// Try to cast the solver in fictif to a SolverCbc
if (const auto c = dynamic_cast<const SolverCbc *>(toCopy.get())) {
_clp_inner_solver = OsiClpSolverInterface(c->_clp_inner_solver);

defineCbcModelFromInnerSolver();
_fp = toCopy->_fp;
if (_fp) {
_clp_inner_solver.messageHandler()->setFilePointer(_fp);
_cbc.messageHandler()->setFilePointer(_fp);
}
defineCbcModelFromInnerSolver();
} else {
_NumberOfProblems -= 1;
throw InvalidSolverForCopyException(toCopy->get_solver_name(), name_,
Expand Down

0 comments on commit 90558d3

Please sign in to comment.