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
00037 virtual double infeasibility(int & preferredWay) const;
00038
00048 virtual void feasibleRegion();
00049
00052 virtual bool boundBranch() const ;
00054 virtual CbcBranchingObject * createBranch(int way) ;
00055
00071 virtual CbcBranchingObject * preferredNewFeasible() const;
00072
00082 virtual CbcBranchingObject * notPreferredNewFeasible() const ;
00083
00089 virtual void resetBounds();
00090
00091
00092 protected:
00094
00095 };
00096
00097
00103 class CbcCutBranchingObject : public CbcBranchingObject {
00104
00105 public:
00106
00108 CbcCutBranchingObject ();
00109
00115 CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up, bool canFix);
00116
00118 CbcCutBranchingObject ( const CbcCutBranchingObject &);
00119
00121 CbcCutBranchingObject & operator= (const CbcCutBranchingObject& rhs);
00122
00124 virtual CbcBranchingObject * clone() const;
00125
00127 virtual ~CbcCutBranchingObject ();
00128
00133 virtual double branch(bool normalBranch=false);
00134
00137 virtual void print(bool normalBranch);
00138
00141 virtual bool boundBranch() const;
00142
00143 protected:
00145 OsiRowCut down_;
00147 OsiRowCut up_;
00149 bool canFix_;
00150 };
00151
00152
00160 class CbcBranchToFixLots : public CbcBranchCut {
00161
00162 public:
00163
00164
00165 CbcBranchToFixLots ();
00166
00173 CbcBranchToFixLots (CbcModel * model, double djTolerance,
00174 double fractionFixed, int depth,
00175 int numberClean=0,
00176 const char * mark=NULL,
00177 bool alwaysCreate=false);
00178
00179
00180 CbcBranchToFixLots ( const CbcBranchToFixLots &);
00181
00183 virtual CbcObject * clone() const;
00184
00185
00186 CbcBranchToFixLots & operator=( const CbcBranchToFixLots& rhs);
00187
00188
00189 ~CbcBranchToFixLots ();
00190
00194 int shallWe() const;
00196 virtual double infeasibility(int & preferredWay) const;
00197
00199 virtual CbcBranchingObject * createBranch(int way);
00200
00201
00202 protected:
00204
00206 double djTolerance_;
00208 double fractionFixed_;
00210 char * mark_;
00212 CoinPackedMatrix matrixByRow_;
00214 int depth_;
00216 int numberClean_;
00218 bool alwaysCreate_;
00219 };
00220
00227 class CbcBranchAllDifferent : public CbcBranchCut {
00228
00229 public:
00230
00231
00232 CbcBranchAllDifferent ();
00233
00236 CbcBranchAllDifferent (CbcModel * model, int number,const int * which);
00237
00238
00239 CbcBranchAllDifferent ( const CbcBranchAllDifferent &);
00240
00242 virtual CbcObject * clone() const;
00243
00244
00245 CbcBranchAllDifferent & operator=( const CbcBranchAllDifferent& rhs);
00246
00247
00248 ~CbcBranchAllDifferent ();
00249
00251 virtual double infeasibility(int & preferredWay) const;
00252
00254 virtual CbcBranchingObject * createBranch(int way);
00255
00256
00257 protected:
00259
00261 int numberInSet_;
00263 int * which_;
00264 };
00265 #endif