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 using CbcBranchingObject::print ;
00144 virtual void print();
00145
00148 virtual bool boundBranch() const;
00149
00150 protected:
00152 OsiRowCut down_;
00154 OsiRowCut up_;
00156 bool canFix_;
00157 };
00158
00159
00167 class CbcBranchToFixLots : public CbcBranchCut {
00168
00169 public:
00170
00171
00172 CbcBranchToFixLots ();
00173
00180 CbcBranchToFixLots (CbcModel * model, double djTolerance,
00181 double fractionFixed, int depth,
00182 int numberClean=0,
00183 const char * mark=NULL,
00184 bool alwaysCreate=false);
00185
00186
00187 CbcBranchToFixLots ( const CbcBranchToFixLots &);
00188
00190 virtual CbcObject * clone() const;
00191
00192
00193 CbcBranchToFixLots & operator=( const CbcBranchToFixLots& rhs);
00194
00195
00196 ~CbcBranchToFixLots ();
00197
00201 int shallWe() const;
00202
00203 using CbcObject::infeasibility ;
00205 virtual double infeasibility(int & preferredWay) const;
00206
00207 using CbcObject::createBranch ;
00209 virtual CbcBranchingObject * createBranch(int way);
00210
00211
00212 protected:
00214
00216 double djTolerance_;
00218 double fractionFixed_;
00220 char * mark_;
00222 CoinPackedMatrix matrixByRow_;
00224 int depth_;
00226 int numberClean_;
00228 bool alwaysCreate_;
00229 };
00230
00237 class CbcBranchAllDifferent : public CbcBranchCut {
00238
00239 public:
00240
00241
00242 CbcBranchAllDifferent ();
00243
00246 CbcBranchAllDifferent (CbcModel * model, int number,const int * which);
00247
00248
00249 CbcBranchAllDifferent ( const CbcBranchAllDifferent &);
00250
00252 virtual CbcObject * clone() const;
00253
00254
00255 CbcBranchAllDifferent & operator=( const CbcBranchAllDifferent& rhs);
00256
00257
00258 ~CbcBranchAllDifferent ();
00259
00260 using CbcObject::infeasibility ;
00262 virtual double infeasibility(int & preferredWay) const;
00263
00264 using CbcObject::createBranch ;
00266 virtual CbcBranchingObject * createBranch(int way);
00267
00268
00269 protected:
00271
00273 int numberInSet_;
00275 int * which_;
00276 };
00277 #endif