/home/coin/SVN-release/Cbc-2.4.2/Cbc/src/CbcBranchCut.hpp

Go to the documentation of this file.
00001 /* $Id: CbcBranchCut.hpp 1271 2009-11-05 15:57:25Z forrest $ */
00002 // Copyright (C) 2004, International Business Machines
00003 // Corporation and others.  All Rights Reserved.
00004 #ifndef CbcBranchCut_H
00005 #define CbcBranchCut_H
00006 
00007 #include "CbcBranchBase.hpp"
00008 #include "OsiRowCut.hpp"
00009 #include "CoinPackedMatrix.hpp"
00010 
00015 class CbcBranchCut : public CbcObject {
00016 
00017 public:
00018 
00019   // Default Constructor 
00020   CbcBranchCut ();
00021 
00024   CbcBranchCut (CbcModel * model);
00025   // Copy constructor 
00026   CbcBranchCut ( const CbcBranchCut &);
00027    
00029   virtual CbcObject * clone() const;
00030 
00031   // Assignment operator 
00032   CbcBranchCut & operator=( const CbcBranchCut& rhs);
00033 
00034   // Destructor 
00035   ~CbcBranchCut ();
00036   
00038   virtual double infeasibility(const OsiBranchingInformation * info,
00039                                int &preferredWay) const;
00040 
00041   using CbcObject::feasibleRegion ;
00051   virtual void feasibleRegion();
00052 
00055   virtual bool boundBranch() const ;
00056 
00058   virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver,const OsiBranchingInformation * info, int way) ;
00059 
00075   virtual CbcBranchingObject * preferredNewFeasible() const;
00076   
00086   virtual CbcBranchingObject * notPreferredNewFeasible() const ;
00087   
00088   using CbcObject::resetBounds ;
00094   virtual void resetBounds();
00095   
00096 
00097 protected:
00099 
00100 };
00101 
00102 
00108 class CbcCutBranchingObject : public CbcBranchingObject {
00109 
00110 public:
00111 
00113   CbcCutBranchingObject ();
00114 
00120   CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up, bool canFix);
00121   
00123   CbcCutBranchingObject ( const CbcCutBranchingObject &);
00124    
00126   CbcCutBranchingObject & operator= (const CbcCutBranchingObject& rhs);
00127 
00129   virtual CbcBranchingObject * clone() const;
00130 
00132   virtual ~CbcCutBranchingObject ();
00133   
00134   using CbcBranchingObject::branch ;
00139   virtual double branch();
00140 
00141 #if 0
00142   // No need to override. Default works fine.
00146   virtual void previousBranch();
00147 #endif
00148 
00149   using CbcBranchingObject::print ;
00152   virtual void print();
00153 
00156   virtual bool boundBranch() const;
00157 
00159   virtual int type() const { return 200; }
00160 
00168   virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
00169 
00178   virtual CbcRangeCompare compareBranchingObject
00179   (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00180 
00181 protected:
00183   OsiRowCut down_;
00185   OsiRowCut up_;
00187   bool canFix_;
00188 };
00189 
00190 
00198 class CbcBranchToFixLots : public CbcBranchCut {
00199 
00200 public:
00201 
00202   // Default Constructor 
00203   CbcBranchToFixLots ();
00204 
00211   CbcBranchToFixLots (CbcModel * model, double djTolerance,
00212                       double fractionFixed, int depth,
00213                       int numberClean=0,
00214                       const char * mark=NULL,
00215                       bool alwaysCreate=false);
00216   
00217   // Copy constructor 
00218   CbcBranchToFixLots ( const CbcBranchToFixLots &);
00219    
00221   virtual CbcObject * clone() const;
00222 
00223   // Assignment operator 
00224   CbcBranchToFixLots & operator=( const CbcBranchToFixLots& rhs);
00225 
00226   // Destructor 
00227   ~CbcBranchToFixLots ();
00228 
00232   int shallWe() const;
00233 
00235   virtual double infeasibility(const OsiBranchingInformation * info,
00236                                int &preferredWay) const;
00239   virtual bool canDoHeuristics() const 
00240   {return true;}
00241 
00243   virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver,const OsiBranchingInformation * info, int way) ;
00245   virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
00246 
00247 
00248 protected:
00250 
00252   double djTolerance_;
00254   double fractionFixed_;
00256   char * mark_;
00258   CoinPackedMatrix matrixByRow_; 
00260   int depth_;
00262   int numberClean_;
00264   bool alwaysCreate_;
00265 };
00266 
00273 class CbcBranchAllDifferent : public CbcBranchCut {
00274 
00275 public:
00276 
00277   // Default Constructor 
00278   CbcBranchAllDifferent ();
00279 
00282   CbcBranchAllDifferent (CbcModel * model, int number,const int * which);
00283   
00284   // Copy constructor 
00285   CbcBranchAllDifferent ( const CbcBranchAllDifferent &);
00286    
00288   virtual CbcObject * clone() const;
00289 
00290   // Assignment operator 
00291   CbcBranchAllDifferent & operator=( const CbcBranchAllDifferent& rhs);
00292 
00293   // Destructor 
00294   ~CbcBranchAllDifferent ();
00295 
00297   virtual double infeasibility(const OsiBranchingInformation * info,
00298                                int &preferredWay) const;
00299 
00301   virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver,const OsiBranchingInformation * info, int way) ;
00302 
00303 
00304 protected:
00306 
00308   int numberInSet_;
00310   int * which_;
00311 };
00312 #endif

Generated on Sat May 22 03:07:43 2010 by  doxygen 1.4.7