Dip-All  0.91.0
MCF_Instance.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the Decomp Solver Framework. //
3 // //
4 // Decomp is distributed under the Common Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Author: Matthew Galati, Lehigh University //
8 // //
9 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
10 // All Rights Reserved. //
11 //===========================================================================//
12 
13 #ifndef MCF_INSTANCE_INCLUDED
14 #define MCF_INSTANCE_INCLUDED
15 
16 //===========================================================================//
17 #include "UtilMacros.h"
18 //===========================================================================//
19 class MCF_Param;
20 using namespace std;
21 //===========================================================================//
22 
23 //===========================================================================//
36 //===========================================================================//
37 class MCF_Instance {
38 public:
40  struct arc {
41  int tail;
42  int head;
43  int lb;
44  int ub;
45  double weight;
46  };
47  struct commodity {
48  int source;
49  int sink;
50  int demand;
51  };
52  string m_problemName;
56  int m_numArcs;
58 
59 public:
61  int readInstance(string& fileName,
62  bool addDummyArcs = true);
63 
64  inline void initMembers() {
65  m_problemName = "";
66  m_arcs = NULL;
67  m_commodities = NULL;
68  m_numNodes = 0;
69  m_numArcs = 0;
70  m_numCommodities = 0;
71  }
72 
73 public:
78  initMembers();
79  };
80 
82  MCF_Instance(string& fileName) {
83  initMembers();
84  readInstance(fileName);
85  }
86 
89  UTIL_DELARR(m_arcs);
90  UTIL_DELARR(m_commodities);
91  };
92 };
93 
94 #endif
int m_numCommodities
Definition: MCF_Instance.h:57
#define UTIL_DELARR(x)
Definition: UtilMacros.h:29
string m_problemName
Definition: MCF_Instance.h:52
~MCF_Instance()
Default destructor.
Definition: MCF_Instance.h:88
void initMembers()
Definition: MCF_Instance.h:64
MCF_Instance problem instance data.
Definition: MCF_Instance.h:40
commodity * m_commodities
Definition: MCF_Instance.h:54
MCF_Instance()
Default constructor.
Definition: MCF_Instance.h:77
MCF_Instance(string &fileName)
Default constructor.
Definition: MCF_Instance.h:82