Ignore:
Timestamp:
Nov 6, 2014 11:17:38 AM (5 years ago)
Author:
forrest
Message:

changes for diving heuristic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristicDiveCoefficient.cpp

    r1899 r2093  
    8181    int bestLocks = COIN_INT_MAX;
    8282    bool allTriviallyRoundableSoFar = true;
     83    int bestPriority = COIN_INT_MAX;
    8384    for (int i = 0; i < numberIntegers; i++) {
    8485        int iColumn = integerVariable[i];
     
    117118                    fraction *= 1000.0;
    118119
     120                // if priorities then use
     121                if (priority_) {
     122                  int thisRound=static_cast<int>(priority_[i].direction);
     123                  if ((thisRound&1)!=0)
     124                    round = ((thisRound&2)==0) ? -1 : +1;
     125                  if (priority_[i].priority>bestPriority) {
     126                    nLocks=COIN_INT_MAX;
     127                  } else if (priority_[i].priority<bestPriority) {
     128                    bestPriority=static_cast<int>(priority_[i].priority);
     129                    bestLocks=COIN_INT_MAX;
     130                  }
     131                }
    119132                if (nLocks < bestLocks || (nLocks == bestLocks &&
    120133                                           fraction < bestFraction)) {
Note: See TracChangeset for help on using the changeset viewer.