include/metis.h
Go to the documentation of this file.
1 
10 #ifndef _METIS_H_
11 #define _METIS_H_
12 
13 /****************************************************************************
14 * A set of defines that can be modified by the user
15 *****************************************************************************/
16 
17 /*--------------------------------------------------------------------------
18  Specifies the width of the elementary data type that will hold information
19  about vertices and their adjacency lists.
20 
21  Possible values:
22  32 : Use 32 bit signed integers
23  64 : Use 64 bit signed integers
24 
25  A width of 64 should be specified if the number of vertices or the total
26  number of edges in the graph exceed the limits of a 32 bit signed integer
27  i.e., 2^31-1.
28  Proper use of 64 bit integers requires that the c99 standard datatypes
29  int32_t and int64_t are supported by the compiler.
30  GCC does provides these definitions in stdint.h, but it may require some
31  modifications on other architectures.
32 --------------------------------------------------------------------------*/
33 #define IDXTYPEWIDTH 32
34 
35 
36 /*--------------------------------------------------------------------------
37  Specifies the data type that will hold floating-point style information.
38 
39  Possible values:
40  32 : single precission floating point (float)
41  64 : double precission floating point (double)
42 --------------------------------------------------------------------------*/
43 #define REALTYPEWIDTH 32
44 
45 
46 
47 /****************************************************************************
48 * In principle, nothing needs to be changed beyond this point, unless the
49 * int32_t and int64_t cannot be found in the normal places.
50 *****************************************************************************/
51 
52 /* Uniform definitions for various compilers */
53 #if defined(_MSC_VER)
54  #define COMPILER_MSC
55 #endif
56 #if defined(__ICC)
57  #define COMPILER_ICC
58 #endif
59 #if defined(__GNUC__)
60  #define COMPILER_GCC
61 #endif
62 
63 /* Include c99 int definitions and need constants. When building the library,
64  * these are already defined by GKlib; hence the test for _GKLIB_H_ */
65 #ifndef _GKLIB_H_
66 #ifdef COMPILER_MSC
67 #include <limits.h>
68 typedef __int32 int32_t;
69 typedef __int64 int64_t;
70 #define PRId32 "I32d"
71 #define PRId64 "I64d"
72 #define SCNd32 "ld"
73 #define SCNd64 "I64d"
74 
75 #ifndef INT32_MIN
76 #define INT32_MIN ((int32_t)_I32_MIN)
77 #endif
78 
79 #ifndef INT32_MAX
80 #define INT32_MAX _I32_MAX
81 #endif
82 
83 #ifndef INT64_MIN
84 #define INT64_MIN ((int64_t)_I64_MIN)
85 #endif
86 
87 #ifndef INT64_MAX
88 #define INT64_MAX _I64_MAX
89 #endif
90 
91 #else
92 #include <inttypes.h>
93 #endif
94 #endif
95 
96 
97 /*------------------------------------------------------------------------
98 * Setup the basic datatypes
99 *-------------------------------------------------------------------------*/
100 #if IDXTYPEWIDTH == 32
101  typedef int32_t idx_t;
102 
103  #define IDX_MAX INT32_MAX
104  #define IDX_MIN INT32_MIN
105 
106  #define SCIDX SCNd32
107  #define PRIDX PRId32
108 
109  #define strtoidx strtol
110  #define iabs abs
111 #elif IDXTYPEWIDTH == 64
112  typedef int64_t idx_t;
113 
114  #define IDX_MAX INT64_MAX
115  #define IDX_MIN INT64_MIN
116 
117  #define SCIDX SCNd64
118  #define PRIDX PRId64
119 
120 #ifdef COMPILER_MSC
121  #define strtoidx _strtoi64
122 #else
123  #define strtoidx strtoll
124 #endif
125  #define iabs labs
126 #else
127  #error "Incorrect user-supplied value fo IDXTYPEWIDTH"
128 #endif
129 
130 
131 #if REALTYPEWIDTH == 32
132  typedef float real_t;
133 
134  #define SCREAL "f"
135  #define PRREAL "f"
136  #define REAL_MAX FLT_MAX
137  #define REAL_MIN FLT_MIN
138  #define REAL_EPSILON FLT_EPSILON
139 
140  #define rabs fabsf
141  #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON))
142 
143 #ifdef COMPILER_MSC
144  #define strtoreal (float)strtod
145 #else
146  #define strtoreal strtof
147 #endif
148 #elif REALTYPEWIDTH == 64
149  typedef double real_t;
150 
151  #define SCREAL "lf"
152  #define PRREAL "lf"
153  #define REAL_MAX DBL_MAX
154  #define REAL_MIN DBL_MIN
155  #define REAL_EPSILON DBL_EPSILON
156 
157  #define rabs fabs
158  #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON))
159 
160  #define strtoreal strtod
161 #else
162  #error "Incorrect user-supplied value for REALTYPEWIDTH"
163 #endif
164 
165 
166 /*------------------------------------------------------------------------
167 * Constant definitions
168 *-------------------------------------------------------------------------*/
169 /* Metis's version number */
170 #define METIS_VER_MAJOR 5
171 #define METIS_VER_MINOR 1
172 #define METIS_VER_SUBMINOR 0
173 
174 /* The maximum length of the options[] array */
175 #define METIS_NOPTIONS 40
176 
177 
178 
179 /*------------------------------------------------------------------------
180 * Function prototypes
181 *-------------------------------------------------------------------------*/
182 
183 #ifdef _WINDLL
184 #define METIS_API(type) __declspec(dllexport) type __cdecl
185 #elif defined(__cdecl)
186 #define METIS_API(type) type __cdecl
187 #else
188 #define METIS_API(type) type
189 #endif
190 
191 
192 
193 #ifdef __cplusplus
194 extern "C" {
195 #endif
196 
201 
205  idx_t *edgecut, idx_t *part);
206 
209 
212 
216 
220  idx_t *npart);
221 
224 
225 METIS_API(int) METIS_Free(void *ptr);
226 
228 
229 
230 /* These functions are used by ParMETIS */
231 
235 
238 
241 
242 
243 #ifdef __cplusplus
244 }
245 #endif
246 
247 
248 
249 /*------------------------------------------------------------------------
250 * Enum type definitions
251 *-------------------------------------------------------------------------*/
253 typedef enum {
254  METIS_OK = 1,
258 } rstatus_et;
259 
260 
262 typedef enum {
266 } moptype_et;
267 
268 
270 typedef enum {
289 
290  /* Used for command-line parameter purposes */
298 } moptions_et;
299 
300 
302 typedef enum {
305 } mptype_et;
306 
308 typedef enum {
311 } mgtype_et;
312 
314 typedef enum {
317 } mctype_et;
318 
320 typedef enum {
326 } miptype_et;
327 
328 
330 typedef enum {
335 } mrtype_et;
336 
337 
339 typedef enum {
350 } mdbglvl_et;
351 
352 
353 /* Types of objectives */
354 typedef enum {
358 } mobjtype_et;
359 
360 
361 
362 #endif /* _METIS_H_ */
objval
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t * objval
Definition: include/metis.h:215
perm
idx_t idx_t idx_t idx_t idx_t * perm
Definition: include/metis.h:223
METIS_OPTION_UFACTOR
@ METIS_OPTION_UFACTOR
Definition: include/metis.h:287
moptype_et
moptype_et
Definition: include/metis.h:262
METIS_OPTION_NOOUTPUT
@ METIS_OPTION_NOOUTPUT
Definition: include/metis.h:294
npes
idx_t idx_t idx_t idx_t npes
Definition: include/metis.h:233
ubvec
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t * ubvec
Definition: include/metis.h:199
METIS_OPTION_SEED
@ METIS_OPTION_SEED
Definition: include/metis.h:279
numflag
idx_t idx_t idx_t idx_t idx_t * numflag
Definition: include/metis.h:208
METIS_RTYPE_GREEDY
@ METIS_RTYPE_GREEDY
Definition: include/metis.h:332
METIS_OPTION_OBJTYPE
@ METIS_OPTION_OBJTYPE
Definition: include/metis.h:272
adjwgt
idx_t idx_t idx_t idx_t idx_t idx_t * adjwgt
Definition: include/metis.h:198
METIS_OPTION_COMPRESS
@ METIS_OPTION_COMPRESS
Definition: include/metis.h:283
METIS_IPTYPE_EDGE
@ METIS_IPTYPE_EDGE
Definition: include/metis.h:323
METIS_NodeNDP
int METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, idx_t *sizes)
Definition: parmetis.c:28
mrtype_et
mrtype_et
Definition: include/metis.h:330
vsize
idx_t idx_t idx_t idx_t idx_t * vsize
Definition: include/metis.h:198
METIS_PartGraphRecursive
int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part)
Recursive partitioning routine.
Definition: pmetis.c:91
METIS_OPTION_PTYPE
@ METIS_OPTION_PTYPE
Definition: include/metis.h:271
mobjtype_et
mobjtype_et
Definition: include/metis.h:354
tpwgts
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t * tpwgts
Definition: include/metis.h:199
adjncy
idx_t idx_t idx_t * adjncy
Definition: include/metis.h:198
METIS_OPTION_GTYPE
@ METIS_OPTION_GTYPE
Definition: include/metis.h:296
METIS_PartMeshNodal
int METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart)
Definition: meshpart.c:22
ncommon
idx_t idx_t idx_t idx_t * ncommon
Definition: include/metis.h:208
METIS_OPTION_NCOMMON
@ METIS_OPTION_NCOMMON
Definition: include/metis.h:293
METIS_DBG_REFINE
@ METIS_DBG_REFINE
Definition: include/metis.h:343
METIS_CTYPE_SHEM
@ METIS_CTYPE_SHEM
Definition: include/metis.h:316
METIS_PTYPE_RB
@ METIS_PTYPE_RB
Definition: include/metis.h:303
METIS_OPTION_NITER
@ METIS_OPTION_NITER
Definition: include/metis.h:277
METIS_IPTYPE_METISRB
@ METIS_IPTYPE_METISRB
Definition: include/metis.h:325
npart
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t idx_t idx_t * npart
Definition: include/metis.h:215
METIS_PartGraphKway
int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part)
Definition: kmetis.c:18
METIS_OP_KMETIS
@ METIS_OP_KMETIS
Definition: include/metis.h:264
moptions_et
moptions_et
Definition: include/metis.h:270
METIS_ComputeVertexSeparator
int METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *options, idx_t *r_sepsize, idx_t *part)
Definition: parmetis.c:161
rstatus_et
rstatus_et
Definition: include/metis.h:253
METIS_OPTION_IPTYPE
@ METIS_OPTION_IPTYPE
Definition: include/metis.h:274
METIS_GTYPE_DUAL
@ METIS_GTYPE_DUAL
Definition: include/metis.h:309
ncon
idx_t * ncon
Definition: include/metis.h:197
nparts
idx_t idx_t idx_t idx_t idx_t idx_t idx_t * nparts
Definition: include/metis.h:199
METIS_OPTION_CTYPE
@ METIS_OPTION_CTYPE
Definition: include/metis.h:273
METIS_DBG_IPART
@ METIS_DBG_IPART
Definition: include/metis.h:344
METIS_DBG_CONTIGINFO
@ METIS_DBG_CONTIGINFO
Definition: include/metis.h:348
METIS_ERROR
@ METIS_ERROR
Definition: include/metis.h:257
iperm
idx_t idx_t idx_t idx_t idx_t idx_t * iperm
Definition: include/metis.h:223
METIS_OPTION_UBVEC
@ METIS_OPTION_UBVEC
Definition: include/metis.h:297
int64_t
signed __int64 int64_t
Definition: ms_stdint.h:94
METIS_IPTYPE_GROW
@ METIS_IPTYPE_GROW
Definition: include/metis.h:321
METIS_GTYPE_NODAL
@ METIS_GTYPE_NODAL
Definition: include/metis.h:310
METIS_OPTION_BALANCE
@ METIS_OPTION_BALANCE
Definition: include/metis.h:295
METIS_DBG_INFO
@ METIS_DBG_INFO
Definition: include/metis.h:340
METIS_OK
@ METIS_OK
Definition: include/metis.h:254
r_adjncy
idx_t idx_t idx_t idx_t idx_t idx_t idx_t ** r_adjncy
Definition: include/metis.h:208
METIS_Free
int METIS_Free(void *ptr)
Definition: auxapi.c:23
METIS_RTYPE_SEP1SIDED
@ METIS_RTYPE_SEP1SIDED
Definition: include/metis.h:334
METIS_DBG_COARSEN
@ METIS_DBG_COARSEN
Definition: include/metis.h:342
eind
idx_t idx_t idx_t * eind
Definition: include/metis.h:207
METIS_RTYPE_FM
@ METIS_RTYPE_FM
Definition: include/metis.h:331
METIS_NodeND
int METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *options, idx_t *perm, idx_t *iperm)
Definition: ometis.c:43
METIS_OPTION_CONTIG
@ METIS_OPTION_CONTIG
Definition: include/metis.h:282
METIS_PTYPE_KWAY
@ METIS_PTYPE_KWAY
Definition: include/metis.h:304
METIS_OP_OMETIS
@ METIS_OP_OMETIS
Definition: include/metis.h:265
METIS_OP_PMETIS
@ METIS_OP_PMETIS
Definition: include/metis.h:263
METIS_MeshToDual
int METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
Definition: mesh.c:44
METIS_OPTION_DBGLVL
@ METIS_OPTION_DBGLVL
Definition: include/metis.h:276
METIS_CTYPE_RM
@ METIS_CTYPE_RM
Definition: include/metis.h:315
METIS_DBG_SEPINFO
@ METIS_DBG_SEPINFO
Definition: include/metis.h:346
vwgt
idx_t idx_t idx_t idx_t * vwgt
Definition: include/metis.h:198
ubfactor
idx_t idx_t idx_t idx_t idx_t real_t ubfactor
Definition: include/metis.h:240
part
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t idx_t idx_t idx_t * part
Definition: include/metis.h:200
edgecut
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t idx_t idx_t * edgecut
Definition: include/metis.h:200
METIS_OPTION_RTYPE
@ METIS_OPTION_RTYPE
Definition: include/metis.h:275
sizes
idx_t idx_t idx_t idx_t idx_t idx_t idx_t idx_t * sizes
Definition: include/metis.h:234
METIS_API
#define METIS_API(type)
Definition: include/metis.h:188
mptype_et
mptype_et
Definition: include/metis.h:302
eptr
idx_t idx_t * eptr
Definition: include/metis.h:207
METIS_SetDefaultOptions
int METIS_SetDefaultOptions(idx_t *options)
Definition: auxapi.c:36
xadj
idx_t idx_t * xadj
Definition: include/metis.h:197
mdbglvl_et
mdbglvl_et
Definition: include/metis.h:339
epart
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t idx_t * epart
Definition: include/metis.h:215
METIS_OPTION_MINCONN
@ METIS_OPTION_MINCONN
Definition: include/metis.h:281
hmarker
idx_t idx_t idx_t idx_t idx_t * hmarker
Definition: include/metis.h:240
METIS_NodeRefine
int METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, idx_t *where, idx_t *hmarker, real_t ubfactor)
Definition: parmetis.c:199
METIS_DBG_MEMORY
@ METIS_DBG_MEMORY
Definition: include/metis.h:349
METIS_IPTYPE_RANDOM
@ METIS_IPTYPE_RANDOM
Definition: include/metis.h:322
METIS_OPTION_NUMBERING
@ METIS_OPTION_NUMBERING
Definition: include/metis.h:288
METIS_RTYPE_SEP2SIDED
@ METIS_RTYPE_SEP2SIDED
Definition: include/metis.h:333
METIS_OBJTYPE_VOL
@ METIS_OBJTYPE_VOL
Definition: include/metis.h:356
METIS_DBG_CONNINFO
@ METIS_DBG_CONNINFO
Definition: include/metis.h:347
real_t
float real_t
Definition: include/metis.h:132
int32_t
signed int int32_t
Definition: ms_stdint.h:82
METIS_OPTION_NO2HOP
@ METIS_OPTION_NO2HOP
Definition: include/metis.h:280
METIS_OPTION_TPWGTS
@ METIS_OPTION_TPWGTS
Definition: include/metis.h:292
METIS_OBJTYPE_CUT
@ METIS_OBJTYPE_CUT
Definition: include/metis.h:355
mgtype_et
mgtype_et
Definition: include/metis.h:308
mctype_et
mctype_et
Definition: include/metis.h:314
METIS_IPTYPE_NODE
@ METIS_IPTYPE_NODE
Definition: include/metis.h:324
METIS_ERROR_INPUT
@ METIS_ERROR_INPUT
Definition: include/metis.h:255
where
idx_t idx_t idx_t idx_t * where
Definition: include/metis.h:240
sepsize
idx_t idx_t idx_t idx_t idx_t * sepsize
Definition: include/metis.h:237
miptype_et
miptype_et
Definition: include/metis.h:320
METIS_OBJTYPE_NODE
@ METIS_OBJTYPE_NODE
Definition: include/metis.h:357
nn
idx_t * nn
Definition: include/metis.h:207
METIS_ERROR_MEMORY
@ METIS_ERROR_MEMORY
Definition: include/metis.h:256
METIS_MeshToNodal
int METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
Definition: mesh.c:114
METIS_OPTION_HELP
@ METIS_OPTION_HELP
Definition: include/metis.h:291
options
Definition: options.h:16
METIS_OPTION_PFACTOR
@ METIS_OPTION_PFACTOR
Definition: include/metis.h:285
METIS_OPTION_NCUTS
@ METIS_OPTION_NCUTS
Definition: include/metis.h:278
METIS_PartMeshDual
int METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart)
Definition: meshpart.c:90
idx_t
int32_t idx_t
Definition: include/metis.h:101
METIS_DBG_TIME
@ METIS_DBG_TIME
Definition: include/metis.h:341
METIS_OPTION_CCORDER
@ METIS_OPTION_CCORDER
Definition: include/metis.h:284
r_xadj
idx_t idx_t idx_t idx_t idx_t idx_t ** r_xadj
Definition: include/metis.h:208
METIS_OPTION_NSEPS
@ METIS_OPTION_NSEPS
Definition: include/metis.h:286
METIS_DBG_MOVEINFO
@ METIS_DBG_MOVEINFO
Definition: include/metis.h:345


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:48