Opened 8 years ago

Closed 7 weeks ago

#113 closed defect (migrated)

DiveCoefficient heuristic error

Reported by: tsliwins Owned by: tkr
Priority: major Component: Cbc
Version: 2.7 Keywords: DiveCoefficient
Cc:

Description

In the code below, the numberIntegers variable taken from the current model_ is sometimes (in really rare cases) bigger than the space allocated for downLocks_ table (used later), thus giving some runetime memory access exceptions. I checked this creating additional field holding the real size of the downLocks_ table, and comparing it to the numberIntegers variable.

Program compiled under MSVC 2008. NOT parallel version of the CBC. I haven't noticed the behaviour in gcc.

Best regards, Tomasz Sliwinski

bool

69 CbcHeuristicDiveCoefficient::selectVariableToBranch(OsiSolverInterface?* solver, 70 const double* newSolution, 71 int& bestColumn, 72 int& bestRound) 73 { 74 int numberIntegers = model_->numberIntegers(); 75 const int * integerVariable = model_->integerVariable(); 76 double integerTolerance = model_->getDblParam(CbcModel::CbcIntegerTolerance?); 77 78 bestColumn = -1; 79 bestRound = -1; -1 rounds down, +1 rounds up 80 double bestFraction = DBL_MAX; 81 int bestLocks = COIN_INT_MAX; 82 bool allTriviallyRoundableSoFar = true; 83 for (int i = 0; i < numberIntegers; i++) { 84 int iColumn = integerVariable[i]; 85 double value = newSolution[iColumn]; 86 double fraction = value - floor(value); 87 int round = 0; 88 if (fabs(floor(value + 0.5) - value) > integerTolerance) { 89 int nDownLocks = downLocks_[i]; 90 int nUpLocks = upLocks_[i];

Change History (1)

comment:1 Changed 7 weeks ago by stefan

  • Resolution set to migrated
  • Status changed from new to closed

This ticket has been migrated to GitHub and will be resolved there: https://github.com/coin-or/Cbc/issues/113

Note: See TracTickets for help on using tickets.