00001 // Copyright (C) 2003, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 00004 #ifndef _BB_CUT_H 00005 #define _BB_CUT_H 00006 00007 #include "BCP_cut.hpp" 00008 #include "BCP_mempool.hpp" 00009 #include "OsiRowCut.hpp" 00010 00011 class BCP_buffer; 00012 00013 /****************************************************************************/ 00019 class BB_indexed_cut : public BCP_cut_algo { 00020 00021 private: 00022 00023 BB_indexed_cut(); 00024 BB_indexed_cut(const BB_indexed_cut&); 00025 BB_indexed_cut& operator=(const BB_indexed_cut&); 00026 00027 private: 00028 00029 static BCP_MemPool memPool; 00030 00031 int index_; 00032 00033 public: 00034 00035 static inline void * operator new(size_t size) { 00036 return memPool.alloc(size); 00037 } 00038 00039 static inline void operator delete(void *p, size_t size) { 00040 memPool.free(p, size); 00041 } 00042 00044 void pack(BCP_buffer& buf) const; 00045 00048 00049 BB_indexed_cut(BCP_buffer& buf); 00050 00052 BB_indexed_cut(int index, double lb, double ub); 00053 00055 ~BB_indexed_cut() {} 00056 00057 inline int index() const { return index_; } 00058 }; 00059 00060 00061 /****************************************************************************/ 00064 class BB_cut : public BCP_cut_algo, public OsiRowCut { 00065 00066 private: 00067 00068 static BCP_MemPool memPool; 00069 00070 public: 00071 00072 static inline void * operator new(size_t size) { 00073 return memPool.alloc(size); 00074 } 00075 00076 static inline void operator delete(void *p, size_t size) { 00077 memPool.free(p, size); 00078 } 00079 00081 void pack(BCP_buffer& buf) const; 00082 00085 00086 BB_cut(BCP_buffer& buf); 00087 00089 BB_cut(const OsiRowCut& cut); 00090 00092 ~BB_cut() {} 00093 }; 00094 00095 #endif 00096