-
Notifications
You must be signed in to change notification settings - Fork 2
/
opt_dict_tree.h
107 lines (82 loc) · 1.65 KB
/
opt_dict_tree.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#define MAX_EDGE_NUM 200000
typedef struct {
int vert1, vert2;
float mm_score;
} Edge;
typedef struct {
int total_edge_num;
Edge edges[MAX_EDGE_NUM];
} MarkMatchGraph;
#define MAX_TREE_NUM 2000
#define MAX_TREE_NODE_NUM 2000
typedef struct {
int total_node_num;
int nodes[MAX_TREE_NODE_NUM];
} TreeNodeSet;
#define MAX_NODE_DEGREE 200
typedef struct {
int edge;
int node;
} NodeEdgePair;
typedef struct {
int degree;
NodeEdgePair pairs[MAX_NODE_DEGREE];
} TreeNode;
#define MAX_CHILD_NUM 100
typedef struct {
int parent;
int child_num;
int child[MAX_CHILD_NUM];
float mm_score; /* mismatch with its parent */
} MarkMatchTree;
typedef struct {
int root_num;
int leaf_num;
int single_root_num;
int one_child_node_num;
int two_child_node_num;
int mult_child_node_num;
int biggest_node;
float total_mm;
} TreeInfo;
#define MAX_MATCH_PER_MARK 800
typedef struct {
Edge *edge;
int parent_offspring;
} MatchInfo;
typedef struct {
int match_num;
MatchInfo match_info[MAX_MATCH_PER_MARK];
} MarkMatchBuf;
#define VERY_BIG 2000000
typedef struct {
float mm_diff;
int new_ref;
} RelocInfo;
typedef struct {
float total_cost;
int child_num;
RelocInfo reloc_info[MAX_CHILD_NUM];
} CostAsLeaf;
typedef struct {
int ref_group;
int ref_mark;
float mm_score;
} GroupMatchInfo;
#define BIGGEST_GROUP 1000
typedef struct {
int total_entry_num;
int entries[BIGGEST_GROUP];
int leader;
} Group;
typedef struct {
Group *groups;
int group_num;
} GroupInfo;
#define LONGEST_CHAIN 500
typedef struct {
int chain[LONGEST_CHAIN];
int chain_size;
int loop_start, loop_end;
int break_point;
} Chain;