-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
41 lines (28 loc) · 1.38 KB
/
graph.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Created by Mark Van der Merwe, Summer 2018
//
#ifndef CUPGM_PARALLEL_REPRESENTATION_GRAPH_H_
#define CUPGM_PARALLEL_REPRESENTATION_GRAPH_H_
#include <string>
#include <map>
#include <vector>
// We need our graph for four operations:
// node id -> incoming edges => used in calculating final marginals.
// node id -> outgoing edges => will be used for RS traversals from selected nodes.
// edge id -> incoming edges => used in message update.
// edge id -> outgoing edges => will be used for RBP + RS updates/traversals.
class graph {
public:
std::vector<int> node_idx_to_incoming_edges;
std::vector<int> node_incoming_edges;
std::vector<int> node_idx_to_outgoing_edges;
std::vector<int> node_outgoing_edges;
std::vector<int> edge_idx_to_incoming_edges;
std::vector<int> edge_incoming_edges;
std::vector<int> edge_idx_to_outgoing_edges;
std::vector<int> edge_outgoing_edges;
std::vector<int> edge_idx_to_dest_node_idx;
graph(std::vector<int> node_idx_to_incoming_edges, std::vector<int> node_incoming_edges, std::vector<int> node_idx_to_outgoing_edges, std::vector<int> node_outgoing_edges, std::vector<int> edge_idx_to_incoming_edges, std::vector<int> edge_incoming_edges, std::vector<int> edge_idx_to_outgoing_edges, std::vector<int> edge_outgoing_edges, std::vector<int> edge_idx_to_dest_node_idx);
void print();
};
#endif // CUPGM_PARALLEL_REPRESENTATION_GRAPH_H_