Changeset 238


Ignore:
Timestamp:
Jan 31, 2006 11:39:18 AM (14 years ago)
Author:
forrest
Message:

small stuff

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcBranchLotsize.cpp

    r201 r238  
    546546{
    547547  OsiSolverInterface * solver = model_->solver();
    548   double value = model_->testSolution()[columnNumber_];
    549 
    550   assert (findRange(value));
     548
     549  assert (findRange(model_->testSolution()[columnNumber_]));
    551550  double dj = solver->getObjSense()*solver->getReducedCost()[columnNumber_];
    552551  CbcLotsizeBranchingObject * object = NULL;
  • trunk/CbcCutGenerator.cpp

    r208 r238  
    214214        }
    215215      }
     216      returnCode = !solver->basisIsAvailable();
    216217    }
    217218    if (timing_)
  • trunk/CbcModel.cpp

    r231 r238  
    11041104      int saveNumber = numberIterations_;
    11051105      feasible = solveWithCuts(cuts,maximumCutPasses_,node);
     1106      if ((specialOptions_&1)!=0&&onOptimalPath) {
     1107        const OsiRowCutDebugger *debugger = solver_->getRowCutDebugger() ;
     1108        assert (debugger) ;
     1109      }
    11061110      if (statistics_) {
    11071111        assert (numberNodes2_);
     
    11351139        use variable() (i.e., presence of a branching variable). Equivalent?
    11361140*/
    1137         if (onOptimalPath)
     1141        if (onOptimalPath) {
     1142          if (!feasible) {
     1143            printf("infeas2\n");
     1144            solver_->writeMps("infeas");
     1145            CoinWarmStartBasis *slack =
     1146              dynamic_cast<CoinWarmStartBasis *>(solver_->getEmptyWarmStart()) ;
     1147            solver_->setWarmStart(slack);
     1148            delete slack ;
     1149            solver_->setHintParam(OsiDoReducePrint,false,OsiHintDo,0) ;
     1150            solver_->initialSolve();
     1151            assert (!solver_->isProvenOptimal());
     1152          }
    11381153          assert (feasible);
     1154        }
    11391155        bool checkingNode=false;
    11401156        if (feasible)
     
    49554971      int numberColumnCutsBefore = theseCuts.sizeColCuts() ;
    49564972      if (i<numberCutGenerators_) {
    4957         if (generator_[i]->normal()) {
     4973        bool generate = generator_[i]->normal();
     4974        // skip if not optimal and should be (maybe a cut generator has fixed variables)
     4975        if (generator_[i]->needsOptimalBasis()&&!solver_->basisIsAvailable())
     4976          generate=false;
     4977        if (generate) {
    49584978          bool mustResolve =
    49594979            generator_[i]->generateCuts(theseCuts,fullScan,node) ;
     
    55085528    double totalCuts = 0.0 ;
    55095529    //#define JUST_ACTIVE
    5510     for (i = 0;i<numberCutGenerators_;i++)
     5530    for (i = 0;i<numberCutGenerators_;i++) {
    55115531      if (countRowCuts[i]||countColumnCuts[i])
    55125532        numberActiveGenerators++;
     
    55165536      totalCuts += countRowCuts[i] + 5.0*countColumnCuts[i] ;
    55175537#endif
     5538    }
    55185539    double small = (0.5* totalCuts) /
    55195540      ((double) numberActiveGenerators) ;
     
    67436764    int lastNumberCuts=0;
    67446765    for (i=0;i<numberCutGenerators_;i++) {
    6745       if (generator_[i]->atSolution()) {
     6766      bool generate = generator_[i]->atSolution();
     6767      // skip if not optimal and should be (maybe a cut generator has fixed variables)
     6768      if (generator_[i]->needsOptimalBasis()&&!solver_->basisIsAvailable())
     6769        generate=false;
     6770      if (generate) {
    67466771        generator_[i]->generateCuts(theseCuts,true,NULL);
    67476772        int numberCuts = theseCuts.sizeRowCuts();
  • trunk/include/CbcCutGenerator.hpp

    r202 r238  
    66#include "OsiSolverInterface.hpp"
    77#include "OsiCuts.hpp"
     8#include "CglCutGenerator.hpp"
    89
    910class CbcModel;
    1011class OsiRowCut;
    1112class OsiRowCutDebugger;
    12 class CglCutGenerator;
    1313
    1414//#############################################################################
     
    205205  inline int switchOffIfLessThan() const
    206206  { return switchOffIfLessThan_;};
     207  /// Say if optimal basis needed
     208  inline bool needsOptimalBasis() const
     209  { return generator_->needsOptimalBasis();};
    207210  //@}
    208211 
Note: See TracChangeset for help on using the changeset viewer.