00001
00002
00003 #ifndef CbcBranchCut_H
00004 #define CbcBranchCut_H
00005
00006 #include "CbcBranchBase.hpp"
00007 #include "OsiRowCut.hpp"
00008 #include "CoinPackedMatrix.hpp"
00009
00014 class CbcBranchCut : public CbcObject {
00015
00016 public:
00017
00018
00019 CbcBranchCut ();
00020
00023 CbcBranchCut (CbcModel * model);
00024
00025 CbcBranchCut ( const CbcBranchCut &);
00026
00028 virtual CbcObject * clone() const;
00029
00030
00031 CbcBranchCut & operator=( const CbcBranchCut& rhs);
00032
00033
00034 ~CbcBranchCut ();
00035
00036 using CbcObject::infeasibility ;
00038 virtual double infeasibility(int & preferredWay) const;
00039
00040 using CbcObject::feasibleRegion ;
00050 virtual void feasibleRegion();
00051
00054 virtual bool boundBranch() const ;
00055
00056 using CbcObject::createBranch ;
00058 virtual CbcBranchingObject * createBranch(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
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
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
00218 CbcBranchToFixLots ( const CbcBranchToFixLots &);
00219
00221 virtual CbcObject * clone() const;
00222
00223
00224 CbcBranchToFixLots & operator=( const CbcBranchToFixLots& rhs);
00225
00226
00227 ~CbcBranchToFixLots ();
00228
00232 int shallWe() const;
00233
00234 using CbcObject::infeasibility ;
00236 virtual double infeasibility(int & preferredWay) const;
00237
00238 using CbcObject::createBranch ;
00240 virtual CbcBranchingObject * createBranch(int way);
00241
00242
00243 protected:
00245
00247 double djTolerance_;
00249 double fractionFixed_;
00251 char * mark_;
00253 CoinPackedMatrix matrixByRow_;
00255 int depth_;
00257 int numberClean_;
00259 bool alwaysCreate_;
00260 };
00261
00268 class CbcBranchAllDifferent : public CbcBranchCut {
00269
00270 public:
00271
00272
00273 CbcBranchAllDifferent ();
00274
00277 CbcBranchAllDifferent (CbcModel * model, int number,const int * which);
00278
00279
00280 CbcBranchAllDifferent ( const CbcBranchAllDifferent &);
00281
00283 virtual CbcObject * clone() const;
00284
00285
00286 CbcBranchAllDifferent & operator=( const CbcBranchAllDifferent& rhs);
00287
00288
00289 ~CbcBranchAllDifferent ();
00290
00291 using CbcObject::infeasibility ;
00293 virtual double infeasibility(int & preferredWay) const;
00294
00295 using CbcObject::createBranch ;
00297 virtual CbcBranchingObject * createBranch(int way);
00298
00299
00300 protected:
00302
00304 int numberInSet_;
00306 int * which_;
00307 };
00308 #endif