Go to the documentation of this file.00001
00002 #ifndef CbcGeneralDepth_H
00003 #define CbcGeneralDepth_H
00004
00005 #include "CbcGeneral.hpp"
00006 #include "CbcBranchBase.hpp"
00007 #include "CbcSubProblem.hpp"
00008
00009 #ifdef COIN_HAS_CLP
00010
00014 #include "ClpSimplex.hpp"
00015 #include "ClpNode.hpp"
00016
00017
00018 class CbcGeneralDepth : public CbcGeneral {
00019
00020 public:
00021
00022
00023 CbcGeneralDepth ();
00024
00031 CbcGeneralDepth (CbcModel * model, int maximumDepth);
00032
00033
00034 CbcGeneralDepth ( const CbcGeneralDepth &);
00035
00037 virtual CbcObject * clone() const;
00038
00039
00040 CbcGeneralDepth & operator=( const CbcGeneralDepth& rhs);
00041
00042
00043 ~CbcGeneralDepth ();
00044
00046 virtual double infeasibility(const OsiBranchingInformation * info,
00047 int &preferredWay) const;
00048
00049 using CbcObject::feasibleRegion ;
00051 virtual void feasibleRegion();
00052
00054 virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
00056 inline int maximumNodes() const {
00057 return maximumNodes_;
00058 }
00060 inline int maximumDepth() const {
00061 return maximumDepth_;
00062 }
00064 inline void setMaximumDepth(int value) {
00065 maximumDepth_ = value;
00066 }
00068 inline int whichSolution() const {
00069 return whichSolution_;
00070 }
00072 inline ClpNode * nodeInfo(int which) {
00073 return nodeInfo_->nodeInfo_[which];
00074 }
00075
00077 virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
00078
00079 protected:
00082 int maximumDepth_;
00084 int maximumNodes_;
00086 mutable int whichSolution_;
00088 mutable int numberNodes_;
00090 mutable ClpNodeStuff * nodeInfo_;
00091 };
00095 class CbcNode;
00096 class CbcGeneralBranchingObject : public CbcBranchingObject {
00097
00098 public:
00099
00100
00101 CbcGeneralBranchingObject ();
00102
00103
00104 CbcGeneralBranchingObject (CbcModel * model);
00105
00106
00107 CbcGeneralBranchingObject ( const CbcGeneralBranchingObject &);
00108
00109
00110 CbcGeneralBranchingObject & operator=( const CbcGeneralBranchingObject& rhs);
00111
00113 virtual CbcBranchingObject * clone() const;
00114
00115
00116 virtual ~CbcGeneralBranchingObject ();
00117
00118 using CbcBranchingObject::branch ;
00120 virtual double branch();
00123 virtual void checkIsCutoff(double cutoff);
00124
00125 using CbcBranchingObject::print ;
00128 virtual void print();
00130 void state(double & objectiveValue, double & sumInfeasibilities,
00131 int & numberUnsatisfied, int which) const;
00133 inline void setNode(CbcNode * node) {
00134 node_ = node;
00135 }
00137 virtual CbcBranchObjType type() const {
00138 return GeneralDepthBranchObj;
00139 }
00140
00148 virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
00149
00158 virtual CbcRangeCompare compareBranchingObject
00159 (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00161 inline int numberSubProblems() const {
00162 return numberSubProblems_;
00163 }
00165 inline int decrementNumberLeft() {
00166 numberSubLeft_--;
00167 return numberSubLeft_;
00168 }
00170 inline int whichNode() const {
00171 return whichNode_;
00172 }
00174 inline void setWhichNode(int value) {
00175 whichNode_ = value;
00176 }
00177
00178 const CbcSubProblem * subProblem(int which) const {
00179 return subProblems_ + which;
00180 }
00181
00182 public:
00184
00185 CbcSubProblem * subProblems_;
00187 CbcNode * node_;
00189 int numberSubProblems_;
00191 int numberSubLeft_;
00193 int whichNode_;
00195 int numberRows_;
00196 };
00200 class CbcOneGeneralBranchingObject : public CbcBranchingObject {
00201
00202 public:
00203
00204
00205 CbcOneGeneralBranchingObject ();
00206
00207
00208 CbcOneGeneralBranchingObject (CbcModel * model,
00209 CbcGeneralBranchingObject * object,
00210 int whichOne);
00211
00212
00213 CbcOneGeneralBranchingObject ( const CbcOneGeneralBranchingObject &);
00214
00215
00216 CbcOneGeneralBranchingObject & operator=( const CbcOneGeneralBranchingObject& rhs);
00217
00219 virtual CbcBranchingObject * clone() const;
00220
00221
00222 virtual ~CbcOneGeneralBranchingObject ();
00223
00224 using CbcBranchingObject::branch ;
00226 virtual double branch();
00229 virtual void checkIsCutoff(double cutoff);
00230
00231 using CbcBranchingObject::print ;
00234 virtual void print();
00236 virtual CbcBranchObjType type() const {
00237 return OneGeneralBranchingObj;
00238 }
00239
00247 virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
00248
00257 virtual CbcRangeCompare compareBranchingObject
00258 (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00259
00260 public:
00263 CbcGeneralBranchingObject * object_;
00265 int whichOne_;
00266 };
00267 #endif //COIN_HAS_CLP
00268 #endif
00269