Cbc trunk
|
00001 /* $Id$ */ 00002 // Copyright (C) 2004, International Business Machines 00003 // Corporation and others. All Rights Reserved. 00004 // This code is licensed under the terms of the Eclipse Public License (EPL). 00005 00006 #ifndef CbcBranchCut_H 00007 #define CbcBranchCut_H 00008 00009 #include "CbcBranchBase.hpp" 00010 #include "OsiRowCut.hpp" 00011 #include "CoinPackedMatrix.hpp" 00012 00017 class CbcBranchCut : public CbcObject { 00018 00019 public: 00020 00021 // Default Constructor 00022 CbcBranchCut (); 00023 00026 CbcBranchCut (CbcModel * model); 00027 // Copy constructor 00028 CbcBranchCut ( const CbcBranchCut &); 00029 00031 virtual CbcObject * clone() const; 00032 00033 // Assignment operator 00034 CbcBranchCut & operator=( const CbcBranchCut& rhs); 00035 00036 // Destructor 00037 ~CbcBranchCut (); 00038 00040 virtual double infeasibility(const OsiBranchingInformation * info, 00041 int &preferredWay) const; 00042 00043 using CbcObject::feasibleRegion ; 00053 virtual void feasibleRegion(); 00054 00057 virtual bool boundBranch() const ; 00058 00060 virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ; 00061 00077 virtual CbcBranchingObject * preferredNewFeasible() const; 00078 00088 virtual CbcBranchingObject * notPreferredNewFeasible() const ; 00089 00090 using CbcObject::resetBounds ; 00096 virtual void resetBounds(); 00097 00098 00099 protected: 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 00151 virtual CbcBranchObjType type() const { 00152 return CutBranchingObj; 00153 } 00154 00162 virtual int compareOriginalObject(const CbcBranchingObject* brObj) const; 00163 00172 virtual CbcRangeCompare compareBranchingObject 00173 (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false); 00174 00175 protected: 00177 OsiRowCut down_; 00179 OsiRowCut up_; 00181 bool canFix_; 00182 }; 00183 #endif