-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommonStruct.h
More file actions
53 lines (46 loc) · 1.22 KB
/
commonStruct.h
File metadata and controls
53 lines (46 loc) · 1.22 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
//
// Created by sbian on 2019/9/3.
//
#ifndef BIM_COMMONSTRUCT_H
#define BIM_COMMONSTRUCT_H
/// Node list
typedef std::vector<uint32_t> Nodelist;
/// Edge structure, neighbor id and the edge weight
typedef std::pair<uint32_t, float> Edge;
/// Edgelist structure from one source/target node
typedef std::vector<Edge> Edgelist;
/// Graph structure
typedef std::vector<Edgelist> Graph;
/// One forward reachable set
typedef std::vector<size_t> FRset;
/// A set of forward reachable sets
typedef std::vector<FRset> FRsets;
/// One reverse reachable set
typedef std::vector<uint32_t> RRset;
/// A set of reverse reachable sets
typedef std::vector<RRset> RRsets;
/// Cascade models: IC, LT
enum CascadeModel { IC, LT };
/// Node element with id and a property value
typedef struct NodeElement
{
int id;
double value;
} NodeEleType;
/// Smaller operation for node element
struct smaller
{
bool operator()(const NodeEleType& Ele1, const NodeEleType& Ele2) const
{
return (Ele1.value < Ele2.value);
}
};
/// Greater operation for node element
struct greater
{
bool operator()(const NodeEleType& Ele1, const NodeEleType& Ele2) const
{
return (Ele1.value > Ele2.value);
}
};
#endif //BIM_COMMONSTRUCT_H