ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
struct.h
Go to the documentation of this file.
1 /*
2  * Copyright 1997, Regents of the University of Minnesota
3  *
4  * struct.h
5  *
6  * This file contains data structures for ILU routines.
7  *
8  * Started 9/26/95
9  * George
10  *
11  * $Id: struct.h,v 1.1 1998/11/27 17:59:31 karypis Exp $
12  */
13 
14 /* Undefine the following #define in order to use short int as the idxtype */
15 
16 /* Indexes are as long as integers for now */
17 typedef int idxtype;
18 
19 #define MAXIDX (1<<8*sizeof(idxtype)-2)
20 
21 /*************************************************************************
22 * The following data structure stores local search chain
23 **************************************************************************/
24 struct ChainType {
25  int point;
26  int from;
27  int to;
28  float change;
29 };
30 
31 typedef struct ChainType Chains;
32 
33 
34 /*************************************************************************
35 * The following data structure stores key-value pair
36 **************************************************************************/
37 struct KeyValueType {
40 };
41 
42 typedef struct KeyValueType KeyValueType;
43 
44 
45 /*************************************************************************
46 * The following data structure will hold a node of a doubly-linked list.
47 **************************************************************************/
48 struct ListNodeType {
49  int id; /* The id value of the node */
50  struct ListNodeType *prev, *next; /* It's a doubly-linked list */
51 };
52 
53 typedef struct ListNodeType ListNodeType;
54 
55 
56 
57 /*************************************************************************
58 * The following data structure is used to store the buckets for the
59 * refinment algorithms
60 **************************************************************************/
61 struct PQueueType {
62  int type; /* The type of the representation used */
63  int nnodes;
64  int maxnodes;
65  int mustfree;
66 
67  /* Linear array version of the data structures */
68  int pgainspan, ngainspan; /* plus and negative gain span */
69  int maxgain;
72 
73  /* Heap version of the data structure */
76 };
77 
78 typedef struct PQueueType PQueueType;
79 
80 
81 /*************************************************************************
82 * The following data structure stores an edge
83 **************************************************************************/
84 struct edegreedef {
87 };
88 typedef struct edegreedef EDegreeType;
89 
90 
91 /*************************************************************************
92 * The following data structure stores an edge for vol
93 **************************************************************************/
94 struct vedegreedef {
98 };
99 typedef struct vedegreedef VEDegreeType;
100 
101 
102 /*************************************************************************
103 * This data structure holds various working space data
104 **************************************************************************/
105 struct workspacedef {
106  idxtype *core; /* Where pairs, indices, and degrees are coming from */
108 
111  int cdegree;
112 
113  idxtype *auxcore; /* This points to the memory of the edegrees */
114 
115  idxtype *pmat; /* An array of k^2 used for eliminating domain
116  connectivity in k-way refinement */
117 };
118 
119 typedef struct workspacedef WorkSpaceType;
120 
121 
122 /*************************************************************************
123 * The following data structure holds information on degrees for k-way
124 * partition
125 **************************************************************************/
126 struct rinfodef {
127  int id, ed; /* ID/ED of nodes */
128  int ndegrees; /* The number of different ext-degrees */
129  EDegreeType *edegrees; /* List of edges */
130 };
131 
132 typedef struct rinfodef RInfoType;
133 
134 
135 /*************************************************************************
136 * The following data structure holds information on degrees for k-way
137 * vol-based partition
138 **************************************************************************/
139 struct vrinfodef {
140  int id, ed, nid; /* ID/ED of nodes */
141  int gv; /* IV/EV of nodes */
142  int ndegrees; /* The number of different ext-degrees */
143  VEDegreeType *edegrees; /* List of edges */
144 };
145 
146 typedef struct vrinfodef VRInfoType;
147 
148 
149 /*************************************************************************
150 * The following data structure holds information on degrees for k-way
151 * partition
152 **************************************************************************/
153 struct nrinfodef {
155 };
156 
157 typedef struct nrinfodef NRInfoType;
158 
159 
160 /*************************************************************************
161 * This data structure holds the input graph
162 **************************************************************************/
163 struct graphdef {
164  idxtype *gdata, *rdata; /* Memory pools for graph and refinement data.
165  This is where memory is allocated and used
166  the rest of the fields in this structure */
167 
168  int nvtxs, nedges; /* The # of vertices and edges in the graph */
169  idxtype *xadj; /* Pointers to the locally stored vertices */
170  idxtype *vwgt; /* Vertex weights */
171  idxtype *vsize; /* Vertex sizes for min-volume formulation */
172  idxtype *adjncy; /* Array that stores the adjacency lists of nvtxs */
173  idxtype *adjwgt; /* Array that stores the weights of the adjacency lists */
174 
175  idxtype *adjwgtsum; /* The sum of the adjacency weight of each vertex */
176 
178 
180 
181  /* Partition parameters */
184  int nbnd;
186 
187  /* Bisection refinement parameters */
189 
190  /* K-way refinement parameters */
192 
193  /* K-way volume refinement parameters */
195 
196  /* Node refinement information */
198 
199 
200  /* Additional info needed by the MOC routines */
201  int ncon; /* The # of constrains */
202  float *nvwgt; /* Normalized vertex weights */
203  float *npwgts; /* The normalized partition weights */
204 
205  struct graphdef *coarser, *finer;
206 };
207 
208 typedef struct graphdef GraphType;
209 
210 
211 
212 /*************************************************************************
213 * The following data type implements a timer
214 **************************************************************************/
215 typedef double timer;
216 
217 
218 /*************************************************************************
219 * The following structure stores information used by Metis
220 **************************************************************************/
221 struct controldef {
222  /* int cutType; */ /* cut type */
223  int CoarsenTo; /* The # of vertices in the coarsest graph */
224  int dbglvl; /* Controls the debuging output of the program */
225  int CType; /* The type of coarsening */
226  int IType; /* The type of initial partitioning */
227  int RType; /* The type of refinement */
228  int maxvwgt; /* The maximum allowed weight for a vertex */
229  float nmaxvwgt; /* The maximum allowed weight for a vertex for each constrain */
230  int optype; /* Type of operation */
231  int pfactor; /* .1*prunning factor */
232  int nseps; /* The number of separators to be found during multiple bisections */
233  int oflags;
234 
235  WorkSpaceType wspace; /* Work Space Informations */
236 
237  /* Various Timers */
240 
241 };
242 
243 typedef struct controldef CtrlType;
244 
245 
246 /*************************************************************************
247 * The following data structure stores max-partition weight info for
248 * Vertical MOC k-way refinement
249 **************************************************************************/
250 struct vpwgtdef {
251  float max[2][MAXNCON];
252  int imax[2][MAXNCON];
253 };
254 
255 typedef struct vpwgtdef VPInfoType;
256 
257 
258 
259 
#define MAXNCON
Definition: defs.h:25
int point
Definition: struct.h:25
int from
Definition: struct.h:26
float change
Definition: struct.h:28
int to
Definition: struct.h:27
idxtype key
Definition: struct.h:38
idxtype val
Definition: struct.h:39
int id
Definition: struct.h:49
struct ListNodeType * next
Definition: struct.h:50
struct ListNodeType * prev
Definition: struct.h:50
int mustfree
Definition: struct.h:65
idxtype * locator
Definition: struct.h:75
int type
Definition: struct.h:62
int pgainspan
Definition: struct.h:68
ListNodeType * nodes
Definition: struct.h:70
ListNodeType ** buckets
Definition: struct.h:71
int maxnodes
Definition: struct.h:64
int maxgain
Definition: struct.h:69
KeyValueType * heap
Definition: struct.h:74
int ngainspan
Definition: struct.h:68
int nnodes
Definition: struct.h:63
int idxtype
Definition: struct.h:17
double timer
Definition: struct.h:215
timer AuxTmr3
Definition: struct.h:239
int dbglvl
Definition: struct.h:224
timer ContractTmr
Definition: struct.h:238
WorkSpaceType wspace
Definition: struct.h:235
timer ProjectTmr
Definition: struct.h:239
timer AuxTmr2
Definition: struct.h:239
int pfactor
Definition: struct.h:231
timer RefTmr
Definition: struct.h:239
timer CoarsenTmr
Definition: struct.h:238
timer AuxTmr6
Definition: struct.h:239
int CType
Definition: struct.h:225
timer UncoarsenTmr
Definition: struct.h:238
timer InitPartTmr
Definition: struct.h:238
int optype
Definition: struct.h:230
int IType
Definition: struct.h:226
int nseps
Definition: struct.h:232
int maxvwgt
Definition: struct.h:228
int CoarsenTo
Definition: struct.h:223
int RType
Definition: struct.h:227
timer SepTmr
Definition: struct.h:239
timer MatchTmr
Definition: struct.h:238
timer AuxTmr1
Definition: struct.h:239
float nmaxvwgt
Definition: struct.h:229
int oflags
Definition: struct.h:233
timer AuxTmr4
Definition: struct.h:239
timer AuxTmr5
Definition: struct.h:239
timer TotalTmr
Definition: struct.h:238
timer SplitTmr
Definition: struct.h:239
idxtype pid
Definition: struct.h:85
idxtype ed
Definition: struct.h:86
int nbnd
Definition: struct.h:184
idxtype * adjncy
Definition: struct.h:172
VRInfoType * vrinfo
Definition: struct.h:194
idxtype * bndind
Definition: struct.h:185
idxtype * where
Definition: struct.h:183
idxtype * rdata
Definition: struct.h:164
int nvtxs
Definition: struct.h:168
idxtype * gdata
Definition: struct.h:164
idxtype * ed
Definition: struct.h:188
idxtype * vwgt
Definition: struct.h:170
float * nvwgt
Definition: struct.h:202
int minvol
Definition: struct.h:182
NRInfoType * nrinfo
Definition: struct.h:197
idxtype * adjwgtsum
Definition: struct.h:175
struct graphdef * finer
Definition: struct.h:205
RInfoType * rinfo
Definition: struct.h:191
idxtype * pwgts
Definition: struct.h:183
idxtype * label
Definition: struct.h:177
int ncon
Definition: struct.h:201
idxtype * id
Definition: struct.h:188
float * npwgts
Definition: struct.h:203
int nedges
Definition: struct.h:168
int mincut
Definition: struct.h:182
idxtype * adjwgt
Definition: struct.h:173
idxtype * bndptr
Definition: struct.h:185
idxtype * vsize
Definition: struct.h:171
struct graphdef * coarser
Definition: struct.h:205
idxtype * xadj
Definition: struct.h:169
idxtype * cmap
Definition: struct.h:179
idxtype edegrees[2]
Definition: struct.h:154
int id
Definition: struct.h:127
int ndegrees
Definition: struct.h:128
EDegreeType * edegrees
Definition: struct.h:129
int ed
Definition: struct.h:127
idxtype ed
Definition: struct.h:96
idxtype ned
Definition: struct.h:96
idxtype pid
Definition: struct.h:95
idxtype gv
Definition: struct.h:97
int imax[2][MAXNCON]
Definition: struct.h:252
float max[2][MAXNCON]
Definition: struct.h:251
int gv
Definition: struct.h:141
int id
Definition: struct.h:140
int ndegrees
Definition: struct.h:142
VEDegreeType * edegrees
Definition: struct.h:143
int nid
Definition: struct.h:140
int ed
Definition: struct.h:140
idxtype * core
Definition: struct.h:106
int ccore
Definition: struct.h:107
EDegreeType * edegrees
Definition: struct.h:109
int maxcore
Definition: struct.h:107
idxtype * auxcore
Definition: struct.h:113
int cdegree
Definition: struct.h:111
VEDegreeType * vedegrees
Definition: struct.h:110
idxtype * pmat
Definition: struct.h:115