/usr/include/metis.h is in libmetis-dev 5.1.0.dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | /*!
\file metis.h
\brief This file contains function prototypes and constant definitions for METIS
*
\author George
\date Started 8/9/02
\version\verbatim $Id$\endverbatim
*/
#ifndef _METIS_H_
#define _METIS_H_
/****************************************************************************
* A set of defines that can be modified by the user
*****************************************************************************/
/*--------------------------------------------------------------------------
Specifies the width of the elementary data type that will hold information
about vertices and their adjacency lists.
Possible values:
32 : Use 32 bit signed integers
64 : Use 64 bit signed integers
A width of 64 should be specified if the number of vertices or the total
number of edges in the graph exceed the limits of a 32 bit signed integer
i.e., 2^31-1.
Proper use of 64 bit integers requires that the c99 standard datatypes
int32_t and int64_t are supported by the compiler.
GCC does provides these definitions in stdint.h, but it may require some
modifications on other architectures.
--------------------------------------------------------------------------*/
#define IDXTYPEWIDTH 32
/*--------------------------------------------------------------------------
Specifies the data type that will hold floating-point style information.
Possible values:
32 : single precission floating point (float)
64 : double precission floating point (double)
--------------------------------------------------------------------------*/
#define REALTYPEWIDTH 32
/****************************************************************************
* In principle, nothing needs to be changed beyond this point, unless the
* int32_t and int64_t cannot be found in the normal places.
*****************************************************************************/
/* Uniform definitions for various compilers */
#if defined(_MSC_VER)
#define COMPILER_MSC
#endif
#if defined(__ICC)
#define COMPILER_ICC
#endif
#if defined(__GNUC__)
#define COMPILER_GCC
#endif
/* Include c99 int definitions and need constants. When building the library,
* these are already defined by GKlib; hence the test for _GKLIB_H_ */
#ifndef _GKLIB_H_
#ifdef COMPILER_MSC
#include <limits.h>
typedef __int32 int32_t;
typedef __int64 int64_t;
#define PRId32 "I32d"
#define PRId64 "I64d"
#define SCNd32 "ld"
#define SCNd64 "I64d"
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#else
#include <inttypes.h>
#endif
#endif
/*------------------------------------------------------------------------
* Setup the basic datatypes
*-------------------------------------------------------------------------*/
#if IDXTYPEWIDTH == 32
typedef int32_t idx_t;
#define IDX_MAX INT32_MAX
#define IDX_MIN INT32_MIN
#define SCIDX SCNd32
#define PRIDX PRId32
#define strtoidx strtol
#define iabs abs
#elif IDXTYPEWIDTH == 64
typedef int64_t idx_t;
#define IDX_MAX INT64_MAX
#define IDX_MIN INT64_MIN
#define SCIDX SCNd64
#define PRIDX PRId64
#ifdef COMPILER_MSC
#define strtoidx _strtoi64
#else
#define strtoidx strtoll
#endif
#define iabs labs
#else
#error "Incorrect user-supplied value fo IDXTYPEWIDTH"
#endif
#if REALTYPEWIDTH == 32
typedef float real_t;
#define SCREAL "f"
#define PRREAL "f"
#define REAL_MAX FLT_MAX
#define REAL_MIN FLT_MIN
#define REAL_EPSILON FLT_EPSILON
#define rabs fabsf
#define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON))
#ifdef COMPILER_MSC
#define strtoreal (float)strtod
#else
#define strtoreal strtof
#endif
#elif REALTYPEWIDTH == 64
typedef double real_t;
#define SCREAL "lf"
#define PRREAL "lf"
#define REAL_MAX DBL_MAX
#define REAL_MIN DBL_MIN
#define REAL_EPSILON DBL_EPSILON
#define rabs fabs
#define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON))
#define strtoreal strtod
#else
#error "Incorrect user-supplied value for REALTYPEWIDTH"
#endif
/*------------------------------------------------------------------------
* Constant definitions
*-------------------------------------------------------------------------*/
/* Metis's version number */
#define METIS_VER_MAJOR 5
#define METIS_VER_MINOR 1
#define METIS_VER_SUBMINOR 0
/* The maximum length of the options[] array */
#define METIS_NOPTIONS 40
/*------------------------------------------------------------------------
* Function prototypes
*-------------------------------------------------------------------------*/
#ifdef _WINDLL
#define METIS_API(type) __declspec(dllexport) type __cdecl
#elif defined(__cdecl)
#define METIS_API(type) type __cdecl
#else
#define METIS_API(type) type
#endif
#ifdef __cplusplus
extern "C" {
#endif
METIS_API(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 *edgecut, idx_t *part);
METIS_API(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 *edgecut, idx_t *part);
METIS_API(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);
METIS_API(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);
METIS_API(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);
METIS_API(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);
METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
idx_t *options, idx_t *perm, idx_t *iperm);
METIS_API(int) METIS_Free(void *ptr);
METIS_API(int) METIS_SetDefaultOptions(idx_t *options);
/* These functions are used by ParMETIS */
METIS_API(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);
METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy,
idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part);
METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy,
idx_t *where, idx_t *hmarker, real_t ubfactor);
#ifdef __cplusplus
}
#endif
/*------------------------------------------------------------------------
* Enum type definitions
*-------------------------------------------------------------------------*/
/*! Return codes */
typedef enum {
METIS_OK = 1, /*!< Returned normally */
METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */
METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */
METIS_ERROR = -4 /*!< Some other errors */
} rstatus_et;
/*! Operation type codes */
typedef enum {
METIS_OP_PMETIS,
METIS_OP_KMETIS,
METIS_OP_OMETIS
} moptype_et;
/*! Options codes (i.e., options[]) */
typedef enum {
METIS_OPTION_PTYPE,
METIS_OPTION_OBJTYPE,
METIS_OPTION_CTYPE,
METIS_OPTION_IPTYPE,
METIS_OPTION_RTYPE,
METIS_OPTION_DBGLVL,
METIS_OPTION_NITER,
METIS_OPTION_NCUTS,
METIS_OPTION_SEED,
METIS_OPTION_NO2HOP,
METIS_OPTION_MINCONN,
METIS_OPTION_CONTIG,
METIS_OPTION_COMPRESS,
METIS_OPTION_CCORDER,
METIS_OPTION_PFACTOR,
METIS_OPTION_NSEPS,
METIS_OPTION_UFACTOR,
METIS_OPTION_NUMBERING,
/* Used for command-line parameter purposes */
METIS_OPTION_HELP,
METIS_OPTION_TPWGTS,
METIS_OPTION_NCOMMON,
METIS_OPTION_NOOUTPUT,
METIS_OPTION_BALANCE,
METIS_OPTION_GTYPE,
METIS_OPTION_UBVEC
} moptions_et;
/*! Partitioning Schemes */
typedef enum {
METIS_PTYPE_RB,
METIS_PTYPE_KWAY
} mptype_et;
/*! Graph types for meshes */
typedef enum {
METIS_GTYPE_DUAL,
METIS_GTYPE_NODAL
} mgtype_et;
/*! Coarsening Schemes */
typedef enum {
METIS_CTYPE_RM,
METIS_CTYPE_SHEM
} mctype_et;
/*! Initial partitioning schemes */
typedef enum {
METIS_IPTYPE_GROW,
METIS_IPTYPE_RANDOM,
METIS_IPTYPE_EDGE,
METIS_IPTYPE_NODE,
METIS_IPTYPE_METISRB
} miptype_et;
/*! Refinement schemes */
typedef enum {
METIS_RTYPE_FM,
METIS_RTYPE_GREEDY,
METIS_RTYPE_SEP2SIDED,
METIS_RTYPE_SEP1SIDED
} mrtype_et;
/*! Debug Levels */
typedef enum {
METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */
METIS_DBG_TIME = 2, /*!< Perform timing analysis */
METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */
METIS_DBG_REFINE = 8, /*!< Show the refinement progress */
METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */
METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */
METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */
METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */
METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */
METIS_DBG_MEMORY = 2048, /*!< Show info related to wspace allocation */
} mdbglvl_et;
/* Types of objectives */
typedef enum {
METIS_OBJTYPE_CUT,
METIS_OBJTYPE_VOL,
METIS_OBJTYPE_NODE
} mobjtype_et;
#endif /* _METIS_H_ */
|