-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcycleConvex.h
172 lines (139 loc) · 4.5 KB
/
cycleConvex.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
$Id: cycleConvex.h,v 1.5 1999/07/15 01:30:19 dbader Exp $
$Log: cycleConvex.h,v $
Revision 1.5 1999/07/15 01:30:19 dbader
Added MALLOC_DEBUG support.
Revision 1.4 1999/07/11 13:57:34 dbader
Removed old Packed Convex Graph (PCG) representation code.
Revision 1.3 1999/07/11 03:56:50 dbader
Added Packed Interval Graph (PIG) representation, analog to
the Packed Express Graph (PEG). Instead of storing express arcs,
intervals are saved instead. Intervals can be used since the input
contains convex bipartite graphs on each processor. This
drastically reduces the packed graph size.
Revision 1.2 1999/07/05 01:44:06 dbader
Split Express Graph LUT into entr and exit vertices, and
removed entrLUT.
Revision 1.1 1999/07/03 23:03:44 dbader
Initial revision
Revision 1.1 1999/07/03 23:02:53 dbader
Initial revision
Revision 1.5 1999/06/01 13:15:12 dbader
Added new field to pExpGraph
Revision 1.4 1999/05/29 15:52:28 dbader
Added new auxiliary fields for the packed express graph.
Revision 1.3 1999/05/27 19:22:55 dbader
Daily Update 990526
Revision 1.2 1999/05/27 19:20:54 dbader
Daily Update 990525
Revision 1.1 1999/05/27 19:09:08 dbader
Initial revision
*/
#ifndef CYCLE_H
#define CYCLE_H
#ifdef DEBUG_MALLOC
#include "rmalloc.h"
#endif
#define BLACK 0
#define WHITE 1
#define GREEN 2
#define RED 3
typedef struct arc_s {
int head; /* vertex at head of arc */
int assn; /* node assignment of the head vertex */
} *arc_t;
typedef struct vertex_s {
int label; /* My vertex label */
int arcs; /* Number of adjacent vertices */
arc_t alist; /* Array of arcs */
} *vertex_t;
typedef struct reachlist_s {
int idx;
struct reachlist_s *next;
} *reachlist_t;
typedef struct vertexList_s {
int num; /* Number of vertices */
vertex_t vlist; /* Array of vertices */
unsigned char *color; /* Color of each vertex */
reachlist_t R; /* list of outgoing transarc tail vertices */
} *vertexList_t;
typedef struct expVertex_s {
transArc_t *transArc;
int expArcsNum;
struct expArc_s *expArcs;
struct expVertex_s *next;
} *expVertex_t;
typedef struct expArc_s {
expVertex_t headVertex;
struct expArc_s *next;
} *expArc_t;
typedef struct labelLookup_s {
int label;
expVertex_t expVertex;
} *labelLookup_t;
#define ENTR_LUT 0
typedef struct eGraph_s {
int entrNum; /* Number of entrance vertices */
int exitNum; /* Number of exit vertices */
expVertex_t entrV; /* Entrance vertices */
expVertex_t exitV; /* Exit vertices */
#if ENTR_LUT
labelLookup_t entrLUT; /* Table from vertex label -> express vertex */
int entrLUTNum; /* Number of filled LUT entries */
#endif
labelLookup_t exitLUT; /* Table from vertex label -> express vertex */
int exitLUTNum; /* Number of filled LUT entries */
} *eGraph_t;
/***************************************************************/
typedef struct pArc_s {
int idx;
int head;
struct pArc_s *next;
} *pArc_t;
typedef struct pArcFlat_s {
int idx;
int head;
} *pArcFlat_t;
typedef struct pExpGraph_s {
int entrNum; /* Number of entrance vertices */
int exitNum; /* Number of exit vertices */
int arcNum; /* Number of express arcs */
int *data; /* Data of packed express graph */
/********************************************************/
struct pArc_s *newArcs; /* Additional express arcs to merge in */
int deadEntr;
int deadExit;
int deadArc;
int newArc;
BOOL *deadEntrMask;
BOOL *deadExitMask;
} *pExpGraph_t;
/***************************************************************/
typedef struct pInterval_s {
int idx;
int C0;
int C1;
struct pInterval_s *next;
} *pInterval_t;
typedef struct pIntervalFlat_s {
int idx;
int C0;
int C1;
} *pIntervalFlat_t;
typedef struct pIntervalGraph_s {
int entrNum; /* Number of entrance vertices */
int exitNum; /* Number of exit vertices */
int intervalNum; /* Number of intervals */
int *data; /* Data of packed express graph */
/********************************************************/
int **intList; /* Array of pointers to each entrV's intervals */
int deadEntr;
int deadExit;
BOOL *deadEntrMask;
BOOL *deadExitMask;
pInterval_t newIntervals;
int deadInt;
int newInt;
} *pIntervalGraph_t;
/***************************************************************/
#endif