Changeset 445 for branches/devel


Ignore:
Timestamp:
Oct 12, 2006 3:21:50 PM (13 years ago)
Author:
forrest
Message:

for OsiSOS and add more stats to cut generators

Location:
branches/devel/Cbc/src
Files:
7 edited

Legend:

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

    r439 r445  
    154154OsiBranchingObject *
    155155CbcObject::createBranch(OsiSolverInterface * solver, int way) const
     156{
     157  assert (solver==model_->solver());
     158  CbcObject * fudge = const_cast<CbcObject *>(this);
     159  return fudge->createBranch(way);
     160}
     161/* Create a branching object and indicate which way to branch first.
     162     
     163      The branching object has to know how to create branches (fix
     164      variables, etc.)
     165*/
     166OsiBranchingObject *
     167CbcObject::createBranch(OsiSolverInterface * solver,const OsiBranchingInformation * info, int way) const
    156168{
    157169  assert (solver==model_->solver());
  • branches/devel/Cbc/src/CbcBranchBase.hpp

    r439 r445  
    145145  */
    146146  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver, int way) const;
     147  /** Create a branching object and indicate which way to branch first.
     148     
     149      The branching object has to know how to create branches (fix
     150      variables, etc.)
     151  */
     152  virtual OsiBranchingObject * createBranch(OsiSolverInterface * solver,const OsiBranchingInformation * info, int way) const;
    147153  /** Create an OsiSolverBranch object
    148154
  • branches/devel/Cbc/src/CbcCutGenerator.cpp

    r424 r445  
    3737    numberCuts_(0),
    3838    numberColumnCuts_(0),
    39     numberCutsActive_(0)
     39    numberCutsActive_(0),
     40    numberCutsAtRoot_(0),
     41    numberActiveCutsAtRoot_(0)
    4042{
    4143}
     
    5759    numberCuts_(0),
    5860    numberColumnCuts_(0),
    59     numberCutsActive_(0)
     61    numberCutsActive_(0),
     62    numberCutsAtRoot_(0),
     63    numberActiveCutsAtRoot_(0)
    6064{
    6165  model_ = model;
     
    97101  numberColumnCuts_ = rhs.numberColumnCuts_;
    98102  numberCutsActive_ = rhs.numberCutsActive_;
     103  numberCutsAtRoot_  = rhs.numberCutsAtRoot_;
     104  numberActiveCutsAtRoot_ = rhs.numberActiveCutsAtRoot_;
    99105}
    100106
     
    126132    numberColumnCuts_ = rhs.numberColumnCuts_;
    127133    numberCutsActive_ = rhs.numberCutsActive_;
     134    numberCutsAtRoot_  = rhs.numberCutsAtRoot_;
     135    numberActiveCutsAtRoot_ = rhs.numberActiveCutsAtRoot_;
    128136  }
    129137  return *this;
  • branches/devel/Cbc/src/CbcCutGenerator.hpp

    r395 r445  
    227227  inline void setSwitchedOff(bool yesNo)
    228228  { switchedOff_=yesNo;};
     229  /// Number of cuts generated at root
     230  inline int numberCutsAtRoot() const
     231  { return numberCutsAtRoot_;};
     232  inline void setNumberCutsAtRoot(int value)
     233  { numberCutsAtRoot_ = value;};
     234  /// Number of cuts active at root
     235  inline int numberActiveCutsAtRoot() const
     236  { return numberActiveCutsAtRoot_;};
     237  inline void setNumberActiveCutsAtRoot(int value)
     238  { numberActiveCutsAtRoot_ = value;};
    229239  //@}
    230240 
     
    287297  /// Total number of cuts active after (at end of n cut passes at each node)
    288298  int numberCutsActive_;
     299  /// Number of cuts generated at root
     300  int numberCutsAtRoot_;
     301  /// Number of cuts active at root
     302  int numberActiveCutsAtRoot_;
    289303};
    290304
  • branches/devel/Cbc/src/CbcModel.cpp

    r441 r445  
    48024802    delete [] count ;
    48034803    if( !numberNodes_) {
     4804      // save statistics
     4805      for (i = 0;i<numberCutGenerators_;i++) {
     4806        generator_[i]->setNumberCutsAtRoot(generator_[i]->numberCutsInTotal());
     4807        generator_[i]->setNumberActiveCutsAtRoot(generator_[i]->numberCutsActive());
     4808      }
    48044809      // decide on pseudo cost strategy
    48054810      int howOften = iProbing>=0 ? generator_[iProbing]->howOften() : 0;
  • branches/devel/Cbc/src/CbcNode.cpp

    r439 r445  
    41244124      const OsiObject * obj = model->object(choose->bestObject());
    41254125      //const OsiSolverInterface * solver = usefulInfo->solver_;
    4126       branch_ = obj->createBranch(model->solver(),obj->whichWay());
     4126      branch_ = obj->createBranch(model->solver(),usefulInfo,obj->whichWay());
    41274127    }
    41284128  }
  • branches/devel/Cbc/src/CoinSolve.cpp

    r441 r445  
    9696#endif
    9797//#############################################################################
     98// To use USERCBC uncomment the following define and add in your fake main program here
     99//#define USER_HAS_FAKE_MAIN
    98100//  Start any fake main program
     101#ifdef USER_HAS_FAKE_MAIN
     102#endif
    99103//  End any fake main program
    100104//#############################################################################
     
    37273731            // Replace the sample code by whatever you want
    37283732            if (goodModel) {
    3729 #if 1
     3733#ifndef USER_HAS_FAKE_MAIN
    37303734              printf("Dummy user cbc code - model has %d rows and %d columns\n",
    37313735                     model.getNumRows(),model.getNumCols());
Note: See TracChangeset for help on using the changeset viewer.