Changeset 593


Ignore:
Timestamp:
Jun 1, 2011 8:16:35 AM (9 years ago)
Author:
fmargot
Message:

Make sure artificial cutoff from option file works; fix small bug in CouenneChooseStrong?.cpp; Add ifdef FM_ALWAYS_SORT

Location:
trunk/Couenne/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/branch/CouenneChooseStrong.cpp

    r588 r593  
    2323//#define FM_MOD
    2424//#define FM_SORT_STRONG
     25//#define FM_ALWAYS_SORT
    2526//#define OLD_STYLE
    2627
     
    410411       
    411412        for(int ips=0; ips<cardIndForPseudo; ips++) {
    412           int iObject = list_[ips];
     413          int iObject = indForPseudo[ips];
    413414          const OsiObject * obj = object[iObject];
    414415          double
     
    12531254        if(card_vPriority > 0) {
    12541255          numberOnList_ = (card_vPriority < maximumStrong ? card_vPriority : maximumStrong);
     1256
     1257#ifdef FM_ALWAYS_SORT
     1258          bool alwaysSort = true;
     1259#else     
    12551260          bool alwaysSort = false;
     1261#endif
    12561262          if(alwaysSort) {
    12571263            sortFrom = 0;
  • trunk/Couenne/src/main/BonCouenneSetup.cpp

    r589 r593  
    880880  }
    881881
    882 #ifdef FM_UP_BND
    883882  double givenAllowFGap2 = 0.0;
    884883  options_->GetNumericValue(std::string("allowable_fraction_gap"),
     
    886885  double upval = 1e50;
    887886
    888   //options_->GetNumericValue(std::string("art_cutoff"),
    889   //                        upval, "bonmin.");
    890 
     887#ifdef FM_UP_BND
    891888  printf("CutOff value:\n");
    892889  scanf("%lf", &upval);
    893 
    894   double newCO = (1-givenAllowFGap2) * upval;
    895   couenneProb_->setCutOff(newCO);
    896   printf("CutOff set to %f\n", newCO);
     890#else /* not FM_UP_BND */
     891  options_->GetNumericValue(std::string("art_cutoff"), upval, "bonmin.");
     892#endif /* FM_UP_BND */
     893
     894  if(upval < 1e50) {
     895    double newCO = (1-givenAllowFGap2) * upval;
     896    couenneProb_->setCutOff(newCO);
     897    printf("CutOff set to %f\n", newCO);
    897898
    898899#ifdef FM_TRACE_OPTSOL
    899   if(couenneProb_->getRecordBestSol()->getHasSol()) {
    900     if(newCO < couenneProb_->getRecordBestSol()->getVal()) {
    901       couenneProb_->getRecordBestSol()->setVal(newCO);
     900    if(couenneProb_->getRecordBestSol()->getHasSol()) {
     901      if(newCO < couenneProb_->getRecordBestSol()->getVal()) {
     902        couenneProb_->getRecordBestSol()->setVal(newCO);
     903      }
    902904    }
    903   }
    904 #endif
    905 #endif /* FM_UP_BND */
    906 
     905#endif
     906  }
    907907}
Note: See TracChangeset for help on using the changeset viewer.