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 
200  idx_t *edgecut, idx_t *part);
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 
234  idx_t *sizes);
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_ */
mgtype_et
idx_t idx_t idx_t idx_t * vwgt
idx_t idx_t idx_t idx_t * ncommon
idx_t idx_t idx_t idx_t idx_t * sepsize
mptype_et
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
mdbglvl_et
idx_t idx_t idx_t idx_t idx_t idx_t idx_t idx_t * sizes
idx_t idx_t idx_t idx_t idx_t * hmarker
int METIS_Free(void *ptr)
Definition: auxapi.c:23
#define METIS_API(type)
moptions_et
idx_t idx_t idx_t idx_t idx_t real_t ubfactor
idx_t idx_t * xadj
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t idx_t * epart
idx_t idx_t * eptr
idx_t idx_t idx_t idx_t idx_t idx_t idx_t * nparts
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
idx_t idx_t idx_t idx_t idx_t idx_t * iperm
int METIS_SetDefaultOptions(idx_t *options)
Definition: auxapi.c:36
mrtype_et
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
idx_t idx_t idx_t idx_t idx_t * vsize
idx_t idx_t idx_t * eind
mctype_et
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 idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t idx_t idx_t * edgecut
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
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t * objval
miptype_et
idx_t idx_t idx_t idx_t idx_t idx_t ** r_xadj
int32_t idx_t
signed __int64 int64_t
Definition: ms_stdint.h:94
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t idx_t idx_t * npart
signed int int32_t
Definition: ms_stdint.h:82
idx_t idx_t idx_t idx_t idx_t * perm
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t * ubvec
idx_t idx_t idx_t idx_t idx_t * numflag
float real_t
idx_t * ncon
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
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t * tpwgts
idx_t idx_t idx_t idx_t idx_t idx_t idx_t ** r_adjncy
idx_t idx_t idx_t idx_t idx_t idx_t * adjwgt
idx_t * nn
mobjtype_et
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
idx_t idx_t idx_t idx_t * where
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
idx_t idx_t idx_t * adjncy
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
rstatus_et
idx_t idx_t idx_t idx_t npes
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
moptype_et
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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:55