adevs
Main Page
Namespaces
Classes
Files
File List
include
adevs_lp_graph.h
1
31
#ifndef adevs_lp_graph_h
32
#define adevs_lp_graph_h
33
#include <vector>
34
#include <map>
35
36
namespace
adevs
37
{
38
46
class
LpGraph
47
{
48
public
:
50
LpGraph
():nodes(0){}
52
void
addEdge
(
int
A,
int
B)
53
{
54
if
(E.find(A) == E.end()
55
&& I.find(A) == I.end())
56
nodes++;
57
if
(E.find(B) == E.end()
58
&& I.find(B) == I.end())
59
nodes++;
60
E[A].push_back(B);
61
I[B].push_back(A);
62
}
64
int
getLPCount
()
const
{
return
nodes; }
66
const
std::vector<int>&
getI
(
int
B) {
return
I[B]; }
68
const
std::vector<int>&
getE
(
int
A) {
return
E[A]; }
70
~LpGraph
(){}
71
private
:
72
// Number of nodes in the graph
73
int
nodes;
74
// Influencee graph
75
std::map<int,std::vector<int> > E;
76
// Complimentary influencer graph
77
std::map<int,std::vector<int> > I;
78
};
79
80
}
81
82
#endif
Generated by
1.8.3.1