coin-Bcp
BB_cut.hpp
Go to the documentation of this file.
1 // Copyright (C) 2003, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 
4 #ifndef _BB_CUT_H
5 #define _BB_CUT_H
6 
7 #include "BCP_cut.hpp"
8 #include "BCP_mempool.hpp"
9 #include "OsiRowCut.hpp"
10 
11 class BCP_buffer;
12 
13 /****************************************************************************/
19 class BB_indexed_cut : public BCP_cut_algo {
20 
21 private:
22 
26 
27 private:
28 
30 
31  int index_;
32 
33 public:
34 
35  static inline void * operator new(size_t size) {
36  return memPool.alloc(size);
37  }
38 
39  static inline void operator delete(void *p, size_t size) {
40  memPool.free(p, size);
41  }
42 
44  void pack(BCP_buffer& buf) const;
45 
50 
52  BB_indexed_cut(int index, double lb, double ub);
53 
56 
57  inline int index() const { return index_; }
58 };
59 
60 
61 /****************************************************************************/
64 class BB_cut : public BCP_cut_algo, public OsiRowCut {
65 
66 private:
67 
69 
70 public:
71 
72  static inline void * operator new(size_t size) {
73  return memPool.alloc(size);
74  }
75 
76  static inline void operator delete(void *p, size_t size) {
77  memPool.free(p, size);
78  }
79 
81  void pack(BCP_buffer& buf) const;
82 
85  BB_cut(BCP_buffer& buf);
87 
89  BB_cut(const OsiRowCut& cut);
90 
92  ~BB_cut() {}
93 };
94 
95 #endif
96 
void pack(BCP_buffer &buf) const
Packing cut to a buffer.
int index() const
Constructor from content of buffer.
Definition: BB_cut.hpp:57
BB_indexed_cut & operator=(const BB_indexed_cut &)
Row Cut Class.
Definition: OsiRowCut.hpp:29
BB_cut(BCP_buffer &buf)
Constructor from content of buffer.
This is the class from which the user should derive her own algorithmic cuts.
Definition: BCP_cut.hpp:242
When doing a sprint sort of algorithm on the cuts (i.e., leave out a number of cuts at the beginning ...
Definition: BB_cut.hpp:19
double ub() const
Return the upper bound on the cut.
Definition: BCP_cut.hpp:84
~BB_cut()
Destructor.
Definition: BB_cut.hpp:92
static BCP_MemPool memPool
Definition: BB_cut.hpp:68
double lb() const
Return the lower bound on the cut.
Definition: BCP_cut.hpp:82
void free(void *p, size_t n)
Definition: BCP_mempool.hpp:68
void pack(BCP_buffer &buf) const
Packing cut to a buffer.
~BB_indexed_cut()
Destructor.
Definition: BB_cut.hpp:55
void * alloc(size_t n)
Definition: BCP_mempool.hpp:28
Simple representation of a cut by storing non zero coefficients only.
Definition: BB_cut.hpp:64
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
static BCP_MemPool memPool
Definition: BB_cut.hpp:29