Debian Codegraph @

extern/metis/libmetis/struct.h

raw
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 14362 2013-05-21 21:35:23Z karypis $
12 */
13
14 #ifndef _LIBMETIS_STRUCT_H_
15 #define _LIBMETIS_STRUCT_H_
16
17 /*************************************************************************/
18 /*! The following data structure holds information on degrees for k-way
19 partition */
20 /*************************************************************************/
21 typedef struct nrinfo_t {
22 idx_t edegrees[2];
23 } nrinfo_t;
24
25
26 /*************************************************************************/
27 /*! This data structure holds a graph */
28 /*************************************************************************/
29 typedef struct graph_t {
30 idx_t nvtxs, nedges; /* The # of vertices and edges in the graph */
31 idx_t ncon; /* The # of constrains */
32 idx_t *xadj; /* Pointers to the locally stored vertices */
33 idx_t *vwgt; /* Vertex weights */
34 idx_t *vsize; /* Vertex sizes for min-volume formulation */
35 idx_t *adjncy; /* Array that stores the adjacency lists of nvtxs */
36 idx_t *adjwgt; /* Array that stores the weights of the adjacency lists */
37
38 const idx_t *xadj_orig;
39 const idx_t *adjncy_orig;
40
41 idx_t *tvwgt; /* The sum of the vertex weights in the graph */
42 real_t *invtvwgt; /* The inverse of the sum of the vertex weights in the graph */
43
44
45 /* These are to keep track control if the corresponding fields correspond to
46 application or library memory */
47 int free_xadj, free_vwgt, free_vsize, free_adjncy, free_adjwgt;
48
49 idx_t *cmap; /* The contraction/coarsening map */
50
51 idx_t *label; /* The labels of the vertices for recursive bisection (pmetis/ometis) */
52
53 /* Partition parameters */
54 idx_t mincut, minvol;
55 idx_t *where, *pwgts;
56 idx_t nbnd;
57 idx_t *bndptr, *bndind;
58
59 /* Bisection refinement parameters */
60 idx_t *id, *ed;
61
62 /* Node refinement information */
63 nrinfo_t *nrinfo;
64
65 /* keep track of the dropped edgewgt */
66 idx_t droppedewgt;
67
68 /* the linked-list structure of the sequence of graphs */
69 struct graph_t *coarser, *finer;
70
71 } graph_t;
72
73 /*************************************************************************/
74 /*! The following structure stores information used by Metis */
75 /*************************************************************************/
76 typedef struct ctrl_t {
77 moptype_et optype; /* Type of operation */
78 mdbglvl_et dbglvl; /* Controls the debugging output of the program */
79 mctype_et ctype; /* The type of coarsening */
80 miptype_et iptype; /* The type of initial partitioning */
81 mrtype_et rtype; /* The type of refinement */
82
83 idx_t CoarsenTo; /* The # of vertices in the coarsest graph */
84 idx_t no2hop; /* Indicates if 2-hop matching will be used */
85 idx_t nseps; /* The number of separators to be found during multiple bisections */
86 idx_t ufactor; /* The user-supplied load imbalance factor */
87 idx_t compress; /* If the graph will be compressed prior to ordering */
88 idx_t ccorder; /* If connected components will be ordered separately */
89 idx_t seed; /* The seed for the random number generator */
90 idx_t niter; /* The number of iterations during each refinement */
91 idx_t dropedges; /* Indicates if edges will be randomly dropped during coarsening */
92 idx_t *maxvwgt; /* The maximum allowed weight for a vertex */
93
94 idx_t ncon; /*!< The number of balancing constraints */
95 idx_t nparts; /*!< The number of partitions */
96
97 real_t pfactor; /* .1*(user-supplied prunning factor) */
98
99 real_t *ubfactors; /*!< The per-constraint ubfactors */
100
101 real_t *tpwgts; /*!< The target partition weights */
102 real_t *pijbm; /*!< The nparts*ncon multiplies for the ith partition
103 and jth constraint for obtaining the balance */
104
105 real_t cfactor; /*!< The achieved compression factor */
106
107 /* Workspace information */
108 gk_mcore_t *mcore; /*!< The persistent memory core for within function
109 mallocs/frees */
110
111 unsigned rng_state;
112
113 } ctrl_t;
114
115
116
117 #endif