coin-Bcp
MCF1_data.hpp
Go to the documentation of this file.
1 #ifndef MCF1_data_hpp
2 #define MCF1_data_hpp
3 
4 #include <iostream>
5 #include "BCP_buffer.hpp"
6 
7 //#############################################################################
8 
9 // This structure holds the input data
10 
11 class MCF1_data {
12 public:
13  struct arc {
14  int tail;
15  int head;
16  int lb;
17  int ub;
18  double weight;
19  };
20  struct commodity {
21  int source;
22  int sink;
23  int demand;
24  };
25  char* problem_name;
28  int numarcs;
29  int numnodes;
31 
32 public:
34  arcs(NULL), commodities(NULL),
35  numarcs(0), numnodes(0), numcommodities(0) {}
36 
38  delete[] arcs;
39  delete[] commodities;
40  delete[] problem_name;
41  }
42 
43  int readDimacsFormat(std::istream& s, bool addDummyArcs);
44  void pack(BCP_buffer& buf) const;
45  void unpack(BCP_buffer& buf);
46 };
47 
48 //#############################################################################
49 
51 {
52 public:
53  int arc_index;
54  int lb;
55  int ub;
56 public:
57  MCF1_branch_decision() : arc_index(-1), lb(0), ub(0) {}
58  MCF1_branch_decision(int i, int l, int u) : arc_index(i), lb(l), ub(u) {}
59 };
60 
61 #endif
void unpack(BCP_buffer &buf)
char * problem_name
Definition: MCF1_data.hpp:25
void pack(BCP_buffer &buf) const
int numnodes
Definition: MCF1_data.hpp:29
int readDimacsFormat(std::istream &s, bool addDummyArcs)
MCF1_branch_decision(int i, int l, int u)
Definition: MCF1_data.hpp:58
int numarcs
Definition: MCF1_data.hpp:28
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
commodity * commodities
Definition: MCF1_data.hpp:27
int numcommodities
Definition: MCF1_data.hpp:30
arc * arcs
Definition: MCF1_data.hpp:26