Changeset 1081


Ignore:
Timestamp:
Sep 19, 2008 11:25:22 AM (11 years ago)
Author:
forrest
Message:

for ratiogap

Location:
trunk/Cbc/src
Files:
2 edited

Legend:

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

    r1069 r1081  
    77867786    double heuristicValue = getCutoff() ;
    77877787    int found = -1; // no solution found
    7788     for (int i = 0;i<numberHeuristics_;i++) {
     7788    if (feasible) {
     7789      for (int i = 0;i<numberHeuristics_;i++) {
    77897790#if MODEL3
    7790       // skip if can't run here
    7791       if (!heuristic_[i]->shouldHeurRun())
    7792         continue;
    7793 #endif
    7794       // see if heuristic will do anything
    7795       double saveValue = heuristicValue ;
    7796       int ifSol = heuristic_[i]->solution(heuristicValue,
    7797                                           newSolution);
    7798       if (ifSol>0) {
    7799         // better solution found
    7800         heuristic_[i]->incrementNumberSolutionsFound();
    7801         found = i ;
    7802         incrementUsed(newSolution);
    7803         lastHeuristic_ = heuristic_[found];
    7804         setBestSolution(CBC_ROUNDING,heuristicValue,newSolution) ;
    7805       } else {
    7806         heuristicValue = saveValue ;
     7791        // skip if can't run here
     7792        if (!heuristic_[i]->shouldHeurRun())
     7793          continue;
     7794#endif
     7795        // see if heuristic will do anything
     7796        double saveValue = heuristicValue ;
     7797        int ifSol = heuristic_[i]->solution(heuristicValue,
     7798                                            newSolution);
     7799        if (ifSol>0) {
     7800          // better solution found
     7801          heuristic_[i]->incrementNumberSolutionsFound();
     7802          found = i ;
     7803          incrementUsed(newSolution);
     7804          lastHeuristic_ = heuristic_[found];
     7805          setBestSolution(CBC_ROUNDING,heuristicValue,newSolution) ;
     7806        } else {
     7807          heuristicValue = saveValue ;
     7808        }
    78077809      }
    78087810    }
  • trunk/Cbc/src/CbcSolver.cpp

    r1071 r1081  
    39943994   
    39953995    double djFix=1.0e100;
    3996     double gapRatio=1.0e100;
    39973996    double tightenFactor=0.0;
    39983997    const char dirsep =  CoinFindDirSeparator();
     
    44484447                    <<CoinMessageEol;
    44494448                }
    4450                 break;
    4451               case GAPRATIO:
    4452                 gapRatio=value;
    44534449                break;
    44544450              case TIGHTENFACTOR:
     
    65316527              }
    65326528              osiclp->setSpecialOptions(mipOptions);
    6533               if (gapRatio < 1.0e100) {
    6534                 double value = babModel_->solver()->getObjValue() ;
    6535                 double value2 = gapRatio*(1.0e-5+fabs(value)) ;
    6536                 babModel_->setAllowableGap(value2) ;
    6537                 std::cout << "Continuous " << value
    6538                           << ", so allowable gap set to "
    6539                           << value2 << std::endl ;
    6540               }
    65416529              // probably faster to use a basis to get integer solutions
    65426530              babModel_->setSpecialOptions(babModel_->specialOptions()|2);
Note: See TracChangeset for help on using the changeset viewer.