Cbc trunk
|
00001 // $Id$ 00002 // Copyright (C) 2002, 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 // Edwin 11/10/2009-- carved out of CbcBranchActual 00007 00008 #ifndef CbcFollowOn_H 00009 #define CbcFollowOn_H 00010 00011 #include "CbcBranchBase.hpp" 00012 #include "CoinPackedMatrix.hpp" 00013 00023 class CbcFollowOn : public CbcObject { 00024 00025 public: 00026 00027 // Default Constructor 00028 CbcFollowOn (); 00029 00032 CbcFollowOn (CbcModel * model); 00033 00034 // Copy constructor 00035 CbcFollowOn ( const CbcFollowOn &); 00036 00038 virtual CbcObject * clone() const; 00039 00040 // Assignment operator 00041 CbcFollowOn & operator=( const CbcFollowOn& rhs); 00042 00043 // Destructor 00044 ~CbcFollowOn (); 00045 00047 virtual double infeasibility(const OsiBranchingInformation * info, 00048 int &preferredWay) const; 00049 00050 using CbcObject::feasibleRegion ; 00052 virtual void feasibleRegion(); 00053 00055 virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ; 00057 virtual int gutsOfFollowOn(int & otherRow, int & preferredWay) const; 00058 00059 protected: 00062 CoinPackedMatrix matrix_; 00064 CoinPackedMatrix matrixByRow_; 00066 int * rhs_; 00067 }; 00068 00072 class CbcFixingBranchingObject : public CbcBranchingObject { 00073 00074 public: 00075 00076 // Default Constructor 00077 CbcFixingBranchingObject (); 00078 00079 // Useful constructor 00080 CbcFixingBranchingObject (CbcModel * model, 00081 int way, 00082 int numberOnDownSide, const int * down, 00083 int numberOnUpSide, const int * up); 00084 00085 // Copy constructor 00086 CbcFixingBranchingObject ( const CbcFixingBranchingObject &); 00087 00088 // Assignment operator 00089 CbcFixingBranchingObject & operator=( const CbcFixingBranchingObject& rhs); 00090 00092 virtual CbcBranchingObject * clone() const; 00093 00094 // Destructor 00095 virtual ~CbcFixingBranchingObject (); 00096 00097 using CbcBranchingObject::branch ; 00099 virtual double branch(); 00100 00101 #ifdef JJF_ZERO 00102 // No need to override. Default works fine. 00106 virtual void previousBranch(); 00107 #endif 00108 00109 using CbcBranchingObject::print ; 00112 virtual void print(); 00113 00115 virtual CbcBranchObjType type() const { 00116 return FollowOnBranchObj; 00117 } 00118 00126 virtual int compareOriginalObject(const CbcBranchingObject* brObj) const; 00127 00136 virtual CbcRangeCompare compareBranchingObject 00137 (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false); 00138 00139 private: 00142 int numberDown_; 00144 int numberUp_; 00146 int * downList_; 00148 int * upList_; 00149 }; 00150 00151 #endif 00152