Skip to content

Commit 42de27a

Browse files
committed
possible error in two CbcHeuristicDive*.cpp'
1 parent f993225 commit 42de27a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/CbcHeuristicDiveLineSearch.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ bool CbcHeuristicDiveLineSearch::selectVariableToBranch(OsiSolverInterface *solv
7070
double integerTolerance = model_->getDblParam(CbcModel::CbcIntegerTolerance);
7171

7272
// get the LP relaxation solution at the root node
73-
double *rootNodeLPSol = model_->continuousSolution();
73+
const double *rootNodeLPSol = model_->continuousSolution();
74+
if (!rootNodeLPSol)
75+
rootNodeLPSol = model_->solver()->getColSolution();
7476

7577
bestColumn = -1;
7678
bestRound = -1; // -1 rounds down, +1 rounds up

src/CbcHeuristicDivePseudoCost.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ bool CbcHeuristicDivePseudoCost::selectVariableToBranch(OsiSolverInterface *solv
7171
double integerTolerance = model_->getDblParam(CbcModel::CbcIntegerTolerance);
7272

7373
// get the LP relaxation solution at the root node
74-
double *rootNodeLPSol = model_->continuousSolution();
74+
const double *rootNodeLPSol = model_->continuousSolution();
75+
if (!rootNodeLPSol)
76+
rootNodeLPSol = model_->solver()->getColSolution();
7577

7678
// get pseudo costs
7779
double *pseudoCostDown = downArray_;

0 commit comments

Comments
 (0)