Skip to content

Commit

Permalink
Make sure sign correct when maximizing
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Oct 6, 2023
1 parent 64bc9e9 commit ef1f8ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/CbcSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8890,11 +8890,13 @@ int CbcMain1(std::deque<std::string> inputQueue, CbcModel &model,
babModel_->assignSolver(saveSolver);
memcpy(bestSolution, babModel_->solver()->getColSolution(),
n * sizeof(double));
babModel_->setObjValue(babModel_->solver()->getObjValue());
} else {
n = babModel_->solver()->getNumCols();
bestSolution = new double[n];
memcpy(bestSolution, babModel_->solver()->getColSolution(),
n * sizeof(double));
babModel_->setObjValue(babModel_->solver()->getObjValue());
#ifndef CBC_OTHER_SOLVER
// and put back bounds in very original solver
ClpSimplex *original = originalSolver->getModelPtr();
Expand Down

0 comments on commit ef1f8ea

Please sign in to comment.