[Cbc-tickets] [COIN-OR Branch-and-Cut MIP Solver] #113: DiveCoefficient heuristic error

COIN-OR Branch-and-Cut MIP Solver coin-trac at coin-or.org
Mon May 30 11:33:57 EDT 2011


#113: DiveCoefficient heuristic error
---------------------+------------------------------------------------------
Reporter:  tsliwins  |       Owner:  tkr            
    Type:  defect    |      Status:  new            
Priority:  major     |   Component:  Cbc            
 Version:  2.7       |    Keywords:  DiveCoefficient
---------------------+------------------------------------------------------
 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];

-- 
Ticket URL: <https://projects.coin-or.org/Cbc/ticket/113>
COIN-OR Branch-and-Cut MIP Solver <http://projects.coin-or.org/Cbc>
An LP-based branch-and-cut MIP solver.



More information about the Cbc-tickets mailing list