MicroModelicaCCompiler  4.5.3
graph.hpp
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  This file is part of QSS Solver.
4 
5  QSS Solver is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  QSS Solver is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QSS Solver. If not, see <http://www.gnu.org/licenses/>.
17 
18  ******************************************************************************/
19 
20 #ifndef MMO_UTIL_GRAPH_H_
21 #define MMO_UTIL_GRAPH_H_
22 
23 #include <map>
24 #include <set>
25 
26 #include "graph_profile.hpp"
27 
28 using namespace std;
29 
30 class Graph {
31  public:
37  Graph(int states, int events);
41  ~Graph();
46  map<int, set<int>> graph();
51  map<int, set<int>> hyperGraph();
57  void addGraphEdge(int orig, int dest);
63  void addHyperGraphEdge(int orig, int dest);
70  int graphEdgeWeight(int node, int inf);
77  int hyperGraphEdgeWeight(int node);
81  void connectGraphs();
86  int graphEdges();
92  int graphNodeEdges(int node);
97  bool empty();
102  int hyperGraphEdges();
106  int nodeWeight(int node);
110  void addNodeWeight(int node, int weight);
111 
112  private:
113  int edgeWeight(int node);
114  int _states;
115  int _events;
116  int _nvtxs;
118  map<int, set<int>> _graph;
119  map<int, set<int>> _graphInputs;
120  map<int, int> _graphDiscretes;
121  map<int, set<int>> _hyperGraph;
122  map<int, set<int>> _wmap;
123  map<int, set<int>> _hwmap;
125 };
126 
127 #endif /* MMO_UTIL_GRAPH_H_ */
Graph::_hyperGraph
map< int, set< int > > _hyperGraph
Definition: graph.hpp:121
Graph::_graphEdges
int _graphEdges
Definition: graph.hpp:117
Graph::_wmap
map< int, set< int > > _wmap
Definition: graph.hpp:122
Graph::_nvtxs
int _nvtxs
Definition: graph.hpp:116
graph_profile.hpp
Graph::_profile
GRP_graphProfile _profile
Definition: graph.hpp:124
Graph::_graph
map< int, set< int > > _graph
Definition: graph.hpp:118
Graph::_graphDiscretes
map< int, int > _graphDiscretes
Definition: graph.hpp:120
Graph::_graphInputs
map< int, set< int > > _graphInputs
Definition: graph.hpp:119
Graph::_states
int _states
Definition: graph.hpp:114
Graph::_events
int _events
Definition: graph.hpp:115
Graph::_hwmap
map< int, set< int > > _hwmap
Definition: graph.hpp:123
Graph
Definition: graph.hpp:30
GRP_graphProfile_
Definition: graph_profile.hpp:69