00001 /* $Id: CbcBranchCut.hpp 1389 2009-12-10 15:17:35Z caphillSNL $ */ 00002 // Copyright (C) 2004, International Business Machines 00003 // Corporation and others. All Rights Reserved. 00004 #ifndef CbcBranchCut_H 00005 #define CbcBranchCut_H 00006 00007 #include "CbcBranchBase.hpp" 00008 #include "OsiRowCut.hpp" 00009 #include "CoinPackedMatrix.hpp" 00010 00015 class CbcBranchCut : public CbcObject { 00016 00017 public: 00018 00019 // Default Constructor 00020 CbcBranchCut (); 00021 00024 CbcBranchCut (CbcModel * model); 00025 // Copy constructor 00026 CbcBranchCut ( const CbcBranchCut &); 00027 00029 virtual CbcObject * clone() const; 00030 00031 // Assignment operator 00032 CbcBranchCut & operator=( const CbcBranchCut& rhs); 00033 00034 // Destructor 00035 ~CbcBranchCut (); 00036 00038 virtual double infeasibility(const OsiBranchingInformation * info, 00039 int &preferredWay) const; 00040 00041 using CbcObject::feasibleRegion ; 00051 virtual void feasibleRegion(); 00052 00055 virtual bool boundBranch() const ; 00056 00058 virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, 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 }; 00106 class CbcCutBranchingObject : public CbcBranchingObject { 00107 00108 public: 00109 00111 CbcCutBranchingObject (); 00112 00118 CbcCutBranchingObject (CbcModel * model, OsiRowCut & down, OsiRowCut &up, bool canFix); 00119 00121 CbcCutBranchingObject ( const CbcCutBranchingObject &); 00122 00124 CbcCutBranchingObject & operator= (const CbcCutBranchingObject& rhs); 00125 00127 virtual CbcBranchingObject * clone() const; 00128 00130 virtual ~CbcCutBranchingObject (); 00131 00132 using CbcBranchingObject::branch ; 00137 virtual double branch(); 00138 00139 using CbcBranchingObject::print ; 00142 virtual void print(); 00143 00146 virtual bool boundBranch() const; 00147 00149 virtual CbcBranchObjType type() const { 00150 return CutBranchingObj; 00151 } 00152 00160 virtual int compareOriginalObject(const CbcBranchingObject* brObj) const; 00161 00170 virtual CbcRangeCompare compareBranchingObject 00171 (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false); 00172 00173 protected: 00175 OsiRowCut down_; 00177 OsiRowCut up_; 00179 bool canFix_; 00180 }; 00181 #endif