| 1 |
// (C) Copyright International Business Machines Corporation 2006, 2007 |
| 2 |
// All Rights Reserved. |
| 3 |
// This code is published under the Eclipse Public License. |
| 4 |
// |
| 5 |
// Authors : |
| 6 |
// Laszlo Ladanyi, International Business Machines Corporation |
| 7 |
// Pierre Bonami, Carnegie Mellon University |
| 8 |
|
| 9 |
#ifndef _BB_CUT_H |
| 10 |
#define _BB_CUT_H |
| 11 |
|
| 12 |
#include "BCP_cut.hpp" |
| 13 |
#include "BCP_mempool.hpp" |
| 14 |
#include "OsiRowCut.hpp" |
| 15 |
|
| 16 |
class BCP_buffer; |
| 17 |
|
| 18 |
/** Simple representation of a cut by storing non zero coefficients only */ |
| 19 |
|
| 20 |
/****************************************************************************/ |
| 21 |
class BB_cut : public BCP_cut_algo, public OsiRowCut { |
| 22 |
|
| 23 |
private: |
| 24 |
|
| 25 |
static BCP_MemPool memPool; |
| 26 |
|
| 27 |
public: |
| 28 |
|
| 29 |
static inline void * operator new(size_t size) { |
| 30 |
return memPool.alloc(size); |
| 31 |
} |
| 32 |
|
| 33 |
static inline void operator delete(void *p, size_t size) { |
| 34 |
memPool.free(p, size); |
| 35 |
} |
| 36 |
|
| 37 |
/// Packing cut to a buffer |
| 38 |
void pack(BCP_buffer& buf) const; |
| 39 |
|
| 40 |
/**@name Constructors and destructors */ |
| 41 |
//@{ |
| 42 |
/// Constructor from content of buffer |
| 43 |
BB_cut(BCP_buffer& buf); |
| 44 |
|
| 45 |
/// Constructor from an OsiRowCut |
| 46 |
BB_cut(const OsiRowCut& cut); |
| 47 |
|
| 48 |
/// Destructor |
| 49 |
~BB_cut() {} |
| 50 |
}; |
| 51 |
|
| 52 |
#endif |