/home/coin/SVN-release/Cbc-1.1.1/Cbc/src/CbcCutGenerator.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2003, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef CbcCutGenerator_H
00004 #define CbcCutGenerator_H
00005 
00006 #include "OsiSolverInterface.hpp"
00007 #include "OsiCuts.hpp"
00008 #include "CglCutGenerator.hpp"
00009 
00010 class CbcModel;
00011 class OsiRowCut;
00012 class OsiRowCutDebugger;
00013 
00014 //#############################################################################
00015 
00045 class CbcCutGenerator  {
00046   
00047 public:
00048     
00066   bool generateCuts( OsiCuts &cs, bool fullScan,CbcNode * node); 
00068 
00069     
00072 
00073   CbcCutGenerator (); 
00074 
00076   CbcCutGenerator(CbcModel * model,CglCutGenerator * generator,
00077                   int howOften=1, const char * name=NULL,
00078                   bool normal=true, bool atSolution=false, 
00079                   bool infeasible=false,int howOftenInsub=-100,
00080                   int whatDepth=-1, int whatDepthInSub=-1,int switchOffIfLessThan=0);
00081  
00083   CbcCutGenerator (const CbcCutGenerator &);
00084 
00086   CbcCutGenerator & operator=(const CbcCutGenerator& rhs);
00087 
00089   ~CbcCutGenerator ();
00091 
00099   void refreshModel(CbcModel * model);
00100 
00102   inline const char * cutGeneratorName() const
00103   { return generatorName_;};
00104 
00119   void setHowOften(int value) ;
00120 
00122   inline int howOften() const
00123   { return whenCutGenerator_;};
00125   inline int howOftenInSub() const
00126   { return whenCutGeneratorInSub_;};
00127 
00138   void setWhatDepth(int value) ;
00140   void setWhatDepthInSub(int value) ;
00142   inline int whatDepth() const
00143   { return depthCutGenerator_;};
00145   inline int whatDepthInSub() const
00146   { return depthCutGeneratorInSub_;};
00147 
00149   inline bool normal() const
00150   { return normal_;};
00152   inline void setNormal(bool value) 
00153   { normal_=value;};
00155   inline bool atSolution() const
00156   { return atSolution_;};
00158   inline void setAtSolution(bool value) 
00159   { atSolution_=value;};
00163   inline bool whenInfeasible() const
00164   { return whenInfeasible_;};
00168   inline void setWhenInfeasible(bool value) 
00169   { whenInfeasible_=value;};
00171   inline bool timing() const
00172   { return timing_;};
00174   inline void setTiming(bool value) 
00175   { timing_=value; timeInCutGenerator_=0.0;};
00177   inline double timeInCutGenerator() const
00178   { return timeInCutGenerator_;};
00180   inline CglCutGenerator * generator() const
00181   { return generator_;};
00183   inline int numberTimesEntered() const
00184   { return numberTimes_;};
00185   inline void setNumberTimesEntered(int value)
00186   { numberTimes_ = value;};
00187   inline void incrementNumberTimesEntered(int value=1)
00188   { numberTimes_ += value;};
00190   inline int numberCutsInTotal() const
00191   { return numberCuts_;};
00192   inline void setNumberCutsInTotal(int value)
00193   { numberCuts_ = value;};
00194   inline void incrementNumberCutsInTotal(int value=1)
00195   { numberCuts_ += value;};
00197   inline int numberColumnCuts() const
00198   { return numberColumnCuts_;};
00199   inline void setNumberColumnCuts(int value)
00200   { numberColumnCuts_ = value;};
00201   inline void incrementNumberColumnCuts(int value=1)
00202   { numberColumnCuts_ += value;};
00204   inline int numberCutsActive() const
00205   { return numberCutsActive_;};
00206   inline void setNumberCutsActive(int value)
00207   { numberCutsActive_ = value;};
00208   inline void incrementNumberCutsActive(int value=1)
00209   { numberCutsActive_ += value;};
00210   inline void setSwitchOffIfLessThan(int value) 
00211   { switchOffIfLessThan_ = value;};
00212   inline int switchOffIfLessThan() const
00213   { return switchOffIfLessThan_;};
00215   inline bool needsOptimalBasis() const
00216   { return generator_->needsOptimalBasis();};
00218   inline bool mustCallAgain() const
00219   { return mustCallAgain_;};
00221   inline void setMustCallAgain(bool yesNo)
00222   { mustCallAgain_=yesNo;};
00224   inline bool switchedOff() const
00225   { return switchedOff_;};
00227   inline void setSwitchedOff(bool yesNo)
00228   { switchedOff_=yesNo;};
00230   
00231 private:
00233   CbcModel *model_;
00234 
00235   // The CglCutGenerator object
00236   CglCutGenerator * generator_;
00237 
00241   int whenCutGenerator_;
00245   int whenCutGeneratorInSub_;
00248   int switchOffIfLessThan_;
00249 
00253   int depthCutGenerator_;
00254 
00259   int depthCutGeneratorInSub_;
00260 
00262   char * generatorName_;
00263 
00265   bool normal_;
00266 
00268   bool atSolution_;
00269 
00271   bool whenInfeasible_;
00273   bool mustCallAgain_;
00275   bool switchedOff_;
00277   bool timing_;
00279   double timeInCutGenerator_;
00280   
00282   int numberTimes_;
00284   int numberCuts_;
00286   int numberColumnCuts_;
00288   int numberCutsActive_;
00289 };
00290 
00291 #endif

Generated on Thu May 15 21:59:04 2008 by  doxygen 1.4.7