Dip  0.92.4
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 // Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9 // Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10 // //
11 // Copyright (C) 2002-2019, Lehigh University, Matthew Galati, and Ted Ralphs//
12 // All Rights Reserved. //
13 //===========================================================================//
14 
15 #ifndef MCF_INSTANCE_INCLUDED
16 #define MCF_INSTANCE_INCLUDED
17 
18 //===========================================================================//
19 #include "UtilMacros.h"
20 //===========================================================================//
21 class MCF_Param;
22 using namespace std;
23 //===========================================================================//
24 
25 //===========================================================================//
38 //===========================================================================//
39 class MCF_Instance {
40 public:
42  struct arc {
43  int tail;
44  int head;
45  int lb;
46  int ub;
47  double weight;
48  };
49  struct commodity {
50  int source;
51  int sink;
52  int demand;
53  };
54  string m_problemName;
58  int m_numArcs;
60 
61 public:
63  int readInstance(string& fileName,
64  bool addDummyArcs = true);
65 
66  inline void initMembers() {
67  m_problemName = "";
68  m_arcs = NULL;
69  m_commodities = NULL;
70  m_numNodes = 0;
71  m_numArcs = 0;
72  m_numCommodities = 0;
73  }
74 
75 public:
80  initMembers();
81  };
82 
84  MCF_Instance(string& fileName) {
85  initMembers();
86  readInstance(fileName);
87  }
88 
91  UTIL_DELARR(m_arcs);
92  UTIL_DELARR(m_commodities);
93  };
94 };
95 
96 #endif
int m_numCommodities
Definition: MCF_Instance.h:59
#define UTIL_DELARR(x)
Definition: UtilMacros.h:29
string m_problemName
Definition: MCF_Instance.h:54
~MCF_Instance()
Default destructor.
Definition: MCF_Instance.h:90
void initMembers()
Definition: MCF_Instance.h:66
MCF_Instance problem instance data.
Definition: MCF_Instance.h:42
commodity * m_commodities
Definition: MCF_Instance.h:56
MCF_Instance()
Default constructor.
Definition: MCF_Instance.h:79
MCF_Instance(string &fileName)
Default constructor.
Definition: MCF_Instance.h:84