BB_cut.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2003, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 // File from COIN project Examples/Bac/BB_cut.hpp
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 
00015 /****************************************************************************/
00016 class BB_cut : public BCP_cut_algo, public OsiRowCut {
00017 
00018 private:
00019 
00020     static BCP_MemPool memPool;
00021 
00022 public:
00023 
00024     static inline void * operator new(size_t size) {
00025         return memPool.alloc(size);
00026     }
00027 
00028     static inline void operator delete(void *p, size_t size) {
00029         memPool.free(p, size);
00030     }
00031 
00033     void pack(BCP_buffer& buf) const;
00034 
00037 
00038     BB_cut(BCP_buffer& buf);
00039 
00041     BB_cut(const OsiRowCut& cut);
00042 
00044     ~BB_cut() {}
00045 };
00046 
00047 /****************************************************************************/
00048 
00049 static inline void
00050 BB_pack_cut(const BCP_cut_algo* cut, BCP_buffer& buf)
00051 {
00052     const BB_cut* bb_cut = dynamic_cast<const BB_cut*>(cut);
00053     if (!bb_cut)
00054         throw BCP_fatal_error("pack_cut_algo() : unknown cut type!\n");
00055     bb_cut->pack(buf);
00056 }
00057 
00058 static inline BCP_cut_algo*
00059 BB_unpack_cut(BCP_buffer& buf)
00060 {
00061     return new BB_cut(buf);
00062 }
00063 
00064 /****************************************************************************/
00065 
00066 #endif

Generated on Fri May 16 21:05:57 2008 for Bonmin by  doxygen 1.4.7