MC_cut.cpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #include "BCP_buffer.hpp"
4 
5 #include "MC_cut.hpp"
6 
7 static const int cycle_cut = 0;
8 static const int explicit_dense_cut = 1;
9 
10 //#############################################################################
11 
12 void
14 {
15  const MC_cut_t type = MC_cut_t__cycle;
16  buf.pack(type).pack(pos_edges).pack(edges, cycle_len);
17 }
18 
20  BCP_cut_algo(-BCP_DBL_MAX, 0.0), cycle_len(0), pos_edges(0), edges(0)
21 {
23  set_ub(pos_edges-1.0);
24 }
25 
26 //#############################################################################
27 
28 void
30 {
32  buf.pack(type).pack(rhs).pack(coeffs, varnum);
33 }
34 
36  BCP_cut_algo(-BCP_DBL_MAX, 0.0), rhs(0.0), coeffs(0), varnum(0)
37 {
38  buf.unpack(rhs).unpack(coeffs, varnum);
39 }
40 
41 //#############################################################################
42 
BCP_buffer & pack(const T &value)
Pack a single object of type T.
Definition: BCP_buffer.hpp:177
BCP_buffer & unpack(T &value)
Unpack a single object of type T.
Definition: BCP_buffer.hpp:186
MC_explicit_dense_cut(const MC_explicit_dense_cut &)
This is the class from which the user should derive her own algorithmic cuts.
Definition: BCP_cut.hpp:242
static BCP_MemPool memPool
Definition: MC_cut.hpp:76
int * edges
Definition: MC_cut.hpp:50
static const int explicit_dense_cut
Definition: MC_cut.cpp:8
void pack(BCP_buffer &buf) const
Definition: MC_cut.cpp:13
#define BCP_DBL_MAX
Definition: BCP_math.hpp:6
static const int cycle_cut
Definition: MC_cut.cpp:7
int cycle_len
Definition: MC_cut.hpp:48
void pack(BCP_buffer &buf) const
Definition: MC_cut.cpp:29
MC_cycle_cut(const MC_cycle_cut &)
void set_ub(const double ub)
Set the upper bound on the cut.
Definition: BCP_cut.hpp:131
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
int pos_edges
Definition: MC_cut.hpp:49
static BCP_MemPool memPool
Definition: MC_cut.hpp:39
MC_cut_t
Definition: MC_cut.hpp:21