Changeset 195


Ignore:
Timestamp:
Oct 13, 2005 3:29:40 PM (14 years ago)
Author:
forrest
Message:

stuff

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcModel.cpp

    r188 r195  
    972972        */
    973973        const OsiRowCutDebugger *debugger = solver_->getRowCutDebugger() ;
    974         if (debugger)
    975           { if(debugger->onOptimalPath(*solver_)) {
    976             onOptimalPath=true;
    977             printf("On optimal path\n") ;
    978           } else {
    979             printf("Not on optimal path\n") ; }
    980           }
     974        if (debugger) {
     975          onOptimalPath=true;
     976          printf("On optimal path\n") ;
     977        }
    981978      }
    982979/*
  • trunk/CbcStrategy.cpp

    r182 r195  
    2222#include "CglClique.hpp"
    2323#include "CglFlowCover.hpp"
    24 #include "CglMixedIntegerRounding.hpp"
     24#include "CglMixedIntegerRounding2.hpp"
    2525
    2626// Heuristics
     
    111111  generator5.setRowCliqueReport(false);
    112112
    113   CglMixedIntegerRounding mixedGen;
     113  CglMixedIntegerRounding2 mixedGen;
    114114  CglFlowCover flowGen;
    115115 
     
    178178  for (iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
    179179    CglCutGenerator * generator = model.cutGenerator(iGenerator)->generator();
    180     CglMixedIntegerRounding * cgl = dynamic_cast<CglMixedIntegerRounding *>(generator);
    181     if (cgl) {
    182       found=true;
    183       break;
    184     }
    185   }
    186   if (!found)
    187     model.addCutGenerator(&mixedGen,setting,"MixedIntegerRounding");
     180    CglMixedIntegerRounding2 * cgl = dynamic_cast<CglMixedIntegerRounding2 *>(generator);
     181    if (cgl) {
     182      found=true;
     183      break;
     184    }
     185  }
     186  if (!found)
     187    model.addCutGenerator(&mixedGen,setting,"MixedIntegerRounding2");
    188188  // Say we want timings
    189189  int newNumberGenerators = model.numberCutGenerators();
     
    321321  generator5.setRowCliqueReport(false);
    322322
    323   CglMixedIntegerRounding mixedGen;
     323  CglMixedIntegerRounding2 mixedGen;
    324324  CglFlowCover flowGen;
    325325 
     
    331331  bool found;
    332332  found=false;
     333  int howOften=0;
    333334  for (iGenerator=0;iGenerator<numberParentGenerators;iGenerator++) {
    334335    CglCutGenerator * generator = parentModel_->cutGenerator(iGenerator)->generator();
     
    336337    if (cgl) {
    337338      found=true;
    338       break;
    339     }
    340   }
    341   if (found) {
     339      howOften = parentModel_->cutGenerator(iGenerator)->howOften();
     340      break;
     341    }
     342  }
     343  if (found&&howOften>=0) {
    342344    found=false;
    343345    for (iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
     
    358360    if (cgl) {
    359361      found=true;
    360       break;
    361     }
    362   }
    363   if (found) {
     362      howOften = parentModel_->cutGenerator(iGenerator)->howOften();
     363      break;
     364    }
     365  }
     366  if (found&&howOften>=0) {
    364367    found=false;
    365368    for (iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
     
    380383    if (cgl) {
    381384      found=true;
    382       break;
    383     }
    384   }
    385   if (found) {
     385      howOften = parentModel_->cutGenerator(iGenerator)->howOften();
     386      break;
     387    }
     388  }
     389  if (found&&howOften>=0) {
    386390    found=false;
    387391    for (iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
     
    402406    if (cgl) {
    403407      found=true;
    404       break;
    405     }
    406   }
    407   if (found) {
     408      howOften = parentModel_->cutGenerator(iGenerator)->howOften();
     409      break;
     410    }
     411  }
     412  if (found&&howOften>=0) {
    408413    found=false;
    409414    for (iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
     
    424429    if (cgl) {
    425430      found=true;
    426       break;
    427     }
    428   }
    429   if (found) {
     431      howOften = parentModel_->cutGenerator(iGenerator)->howOften();
     432      break;
     433    }
     434  }
     435  if (found&&howOften>=0) {
    430436    found=false;
    431437    for (iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
     
    443449  for (iGenerator=0;iGenerator<numberParentGenerators;iGenerator++) {
    444450    CglCutGenerator * generator = parentModel_->cutGenerator(iGenerator)->generator();
    445     CglMixedIntegerRounding * cgl = dynamic_cast<CglMixedIntegerRounding *>(generator);
    446     if (cgl) {
    447       found=true;
    448       break;
    449     }
    450   }
    451   if (found) {
     451    CglMixedIntegerRounding2 * cgl = dynamic_cast<CglMixedIntegerRounding2 *>(generator);
     452    if (cgl) {
     453      found=true;
     454      howOften = parentModel_->cutGenerator(iGenerator)->howOften();
     455      break;
     456    }
     457  }
     458  if (found&&howOften>=0) {
    452459    found=false;
    453460    for (iGenerator=0;iGenerator<numberGenerators;iGenerator++) {
    454461      CglCutGenerator * generator = model.cutGenerator(iGenerator)->generator();
    455       CglMixedIntegerRounding * cgl = dynamic_cast<CglMixedIntegerRounding *>(generator);
     462      CglMixedIntegerRounding2 * cgl = dynamic_cast<CglMixedIntegerRounding2 *>(generator);
    456463      if (cgl) {
    457464        found=true;
     
    460467    }
    461468    if (!found)
    462       model.addCutGenerator(&mixedGen,setting,"MixedIntegerRounding");
     469      model.addCutGenerator(&mixedGen,setting,"MixedIntegerRounding2");
    463470  }
    464471  // Say we want timings
  • trunk/CbcTreeLocal.cpp

    r190 r195  
    77#include "CoinPackedMatrix.hpp"
    88#include "CoinTime.hpp"
     9#include "OsiRowCutDebugger.hpp"
    910#include <cassert>
    1011#if 0
     
    594595    } else {
    595596      // special case when using as heuristic
     597      // Reverse cut weakly if lb -infinity
     598      reverseCut(4,rhs_);
    596599      // This will be last try (may hit max time0
    597600      lastTry=true;
     
    615618      printf("inserting cut - now %d cuts, rhs %g %g, cutspace %g, diversification %d\n",
    616619             n,rowCut->lb(),rowCut->ub(),rhs_,diversification_);
     620      const OsiRowCutDebugger *debugger = model_->solver()->getRowCutDebuggerAlways() ;
     621      if (debugger) {
     622        if(debugger->invalidCut(*rowCut))
     623          printf("ZZZZTree Global cut - cuts off optimal solution!\n");
     624      }
    617625      for (int i=0;i<n;i++) {
    618626        rowCut = global->rowCutPtr(i);
     
    775783    return;
    776784  }
     785  if (rowCut->lb()>-1.0e10)
     786    return;
    777787  // get smallest element
    778788  double smallest=COIN_DBL_MAX;
     
    792802  printf("new rhs %g %g, bias %g smallest %g ",
    793803         rowCut->lb(),rowCut->ub(),bias,smallest);
     804  const OsiRowCutDebugger *debugger = model_->solver()->getRowCutDebuggerAlways() ;
     805  if (debugger) {
     806    if(debugger->invalidCut(*rowCut))
     807      printf("ZZZZTree Global cut - cuts off optimal solution!\n");
     808  }
    794809}
    795810// Delete last cut branch
Note: See TracChangeset for help on using the changeset viewer.