Ignore:
Timestamp:
Feb 16, 2007 5:17:39 PM (14 years ago)
Author:
forrest
Message:

for nonlinear

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcModel.cpp

    r534 r539  
    1313//#define CHECK_NODE_FULL
    1414//#define NODE_LOG
    15 //#define GLOBAL_CUTS_JUST_POINTERS
     15#define GLOBAL_CUTS_JUST_POINTERS
    1616#include <cassert>
    1717#include <cmath>
     
    554554          } else if (isInteger(iColumn)) {
    555555            object_[numberIntegers_] =
    556               new CbcSimpleInteger(this,numberIntegers_,iColumn);
     556              new CbcSimpleInteger(this,iColumn);
    557557            integerVariable_[numberIntegers_++]=iColumn;
    558558          }
     
    889889     Could use last parameter for subtle differences */
    890890  solver_->setHintParam(OsiDoInBranchAndCut,true,OsiHintDo,NULL) ;
    891 /*
    892   Create a copy of the solver, thus capturing the original (root node)
    893   constraint system (aka the continuous system).
    894 */
    895   continuousSolver_ = solver_->clone() ;
    896891#ifdef COIN_HAS_CLP
    897892 {
     
    899894     = dynamic_cast<OsiClpSolverInterface *> (solver_);
    900895   if (clpSolver) {
     896     // Try and re-use regions
     897     clpSolver->getModelPtr()->setPersistenceFlag(1);
    901898     if ((specialOptions_&32)==0) {
    902899       ClpSimplex * clpSimplex = clpSolver->getModelPtr();
     
    911908 }
    912909#endif
     910/*
     911  Create a copy of the solver, thus capturing the original (root node)
     912  constraint system (aka the continuous system).
     913*/
     914  continuousSolver_ = solver_->clone() ;
    913915
    914916  numberRowsAtContinuous_ = getNumRows() ;
     
    46974699              cuts.insert(globalCuts_.rowCut(i)) ;
    46984700#else
    4699               cuts.insert(globalCuts_.rowCutPtr(i)) ;
     4701              OsiRowCut * rowCutPointer = globalCuts_.rowCutPtr(i);
     4702              cuts.insert(rowCutPointer) ;
    47004703#endif
    47014704            }
     
    50585061      }
    50595062    }
    5060   } else if (numberCutGenerators_) {
    5061     int i;
    5062     // add to counts anyway
    5063     for (i = 0;i<numberCutGenerators_;i++)
    5064       generator_[i]->incrementNumberCutsInTotal(countRowCuts[i]);
    5065     // What if not feasible as cuts may have helped
    5066     if (feasible) {
    5067       for (i = 0;i<numberNewCuts_;i++) {
    5068         int iGenerator = whichGenerator_[i];
    5069         if (iGenerator>=0)
    5070           generator_[iGenerator]->incrementNumberCutsActive();
     5063  } else {
     5064#ifdef COIN_HAS_CLP
     5065    OsiClpSolverInterface * clpSolver
     5066      = dynamic_cast<OsiClpSolverInterface *> (solver_);
     5067    if (clpSolver) {
     5068      // Maybe solver might like to know only column bounds will change
     5069      //int options = clpSolver->specialOptions();
     5070      //clpSolver->setSpecialOptions(options|128);
     5071      clpSolver->synchronizeModel();
     5072    }
     5073#endif
     5074    if (numberCutGenerators_) {
     5075      int i;
     5076      // add to counts anyway
     5077      for (i = 0;i<numberCutGenerators_;i++)
     5078        generator_[i]->incrementNumberCutsInTotal(countRowCuts[i]);
     5079      // What if not feasible as cuts may have helped
     5080      if (feasible) {
     5081        for (i = 0;i<numberNewCuts_;i++) {
     5082          int iGenerator = whichGenerator_[i];
     5083          if (iGenerator>=0)
     5084            generator_[iGenerator]->incrementNumberCutsActive();
     5085        }
    50715086      }
    50725087    }
     
    59896004      else if (type==1)
    59906005        object_[numberIntegers_] =
    5991           new CbcSimpleIntegerPseudoCost(this,numberIntegers_,iColumn,0.3);
     6006          new CbcSimpleIntegerPseudoCost(this,iColumn,0.3);
    59926007      integerVariable_[numberIntegers_++]=iColumn;
    59936008    }
     
    82248239{
    82258240  OsiRowCut newCut(*cut);
    8226   newCut.setGloballyValid(2);
     8241  newCut.setGloballyValidAsInteger(2);
    82278242  newCut.mutableRow().setTestForDuplicateIndex(false);
    82288243  globalCuts_.insert(newCut) ;
     
    87988813      } else if (isInteger(iColumn)) {
    87998814        object_[numberIntegers_] =
    8800           new CbcSimpleInteger(this,numberIntegers_,iColumn);
     8815          new CbcSimpleInteger(this,iColumn);
    88018816        integerVariable_[numberIntegers_++]=iColumn;
    88028817      }
Note: See TracChangeset for help on using the changeset viewer.