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
/* automatically generated by rust-bindgen 0.66.1 */

pub const METIS_VER_MAJOR: u32 = 5;
pub const METIS_VER_MINOR: u32 = 2;
pub const METIS_VER_SUBMINOR: u32 = 1;
pub const METIS_NOPTIONS: u32 = 40;
pub type idx_t = i32;
pub type real_t = f32;
extern "C" {
    pub fn METIS_PartGraphRecursive(
        nvtxs: *mut idx_t,
        ncon: *mut idx_t,
        xadj: *mut idx_t,
        adjncy: *mut idx_t,
        vwgt: *mut idx_t,
        vsize: *mut idx_t,
        adjwgt: *mut idx_t,
        nparts: *mut idx_t,
        tpwgts: *mut real_t,
        ubvec: *mut real_t,
        options: *mut idx_t,
        edgecut: *mut idx_t,
        part: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_PartGraphKway(
        nvtxs: *mut idx_t,
        ncon: *mut idx_t,
        xadj: *mut idx_t,
        adjncy: *mut idx_t,
        vwgt: *mut idx_t,
        vsize: *mut idx_t,
        adjwgt: *mut idx_t,
        nparts: *mut idx_t,
        tpwgts: *mut real_t,
        ubvec: *mut real_t,
        options: *mut idx_t,
        edgecut: *mut idx_t,
        part: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_MeshToDual(
        ne: *mut idx_t,
        nn: *mut idx_t,
        eptr: *mut idx_t,
        eind: *mut idx_t,
        ncommon: *mut idx_t,
        numflag: *mut idx_t,
        r_xadj: *mut *mut idx_t,
        r_adjncy: *mut *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_MeshToNodal(
        ne: *mut idx_t,
        nn: *mut idx_t,
        eptr: *mut idx_t,
        eind: *mut idx_t,
        numflag: *mut idx_t,
        r_xadj: *mut *mut idx_t,
        r_adjncy: *mut *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_PartMeshNodal(
        ne: *mut idx_t,
        nn: *mut idx_t,
        eptr: *mut idx_t,
        eind: *mut idx_t,
        vwgt: *mut idx_t,
        vsize: *mut idx_t,
        nparts: *mut idx_t,
        tpwgts: *mut real_t,
        options: *mut idx_t,
        objval: *mut idx_t,
        epart: *mut idx_t,
        npart: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_PartMeshDual(
        ne: *mut idx_t,
        nn: *mut idx_t,
        eptr: *mut idx_t,
        eind: *mut idx_t,
        vwgt: *mut idx_t,
        vsize: *mut idx_t,
        ncommon: *mut idx_t,
        nparts: *mut idx_t,
        tpwgts: *mut real_t,
        options: *mut idx_t,
        objval: *mut idx_t,
        epart: *mut idx_t,
        npart: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_NodeND(
        nvtxs: *mut idx_t,
        xadj: *mut idx_t,
        adjncy: *mut idx_t,
        vwgt: *mut idx_t,
        options: *mut idx_t,
        perm: *mut idx_t,
        iperm: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_Free(ptr: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_SetDefaultOptions(options: *mut idx_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_NodeNDP(
        nvtxs: idx_t,
        xadj: *mut idx_t,
        adjncy: *mut idx_t,
        vwgt: *mut idx_t,
        npes: idx_t,
        options: *mut idx_t,
        perm: *mut idx_t,
        iperm: *mut idx_t,
        sizes: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_ComputeVertexSeparator(
        nvtxs: *mut idx_t,
        xadj: *mut idx_t,
        adjncy: *mut idx_t,
        vwgt: *mut idx_t,
        options: *mut idx_t,
        sepsize: *mut idx_t,
        part: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_NodeRefine(
        nvtxs: idx_t,
        xadj: *mut idx_t,
        vwgt: *mut idx_t,
        adjncy: *mut idx_t,
        where_: *mut idx_t,
        hmarker: *mut idx_t,
        ubfactor: real_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn METIS_CacheFriendlyReordering(
        nvtxs: idx_t,
        xadj: *mut idx_t,
        adjncy: *mut idx_t,
        part: *mut idx_t,
        old2new: *mut idx_t,
    ) -> ::std::os::raw::c_int;
}
#[doc = "< Returned normally"]
pub const rstatus_et_METIS_OK: rstatus_et = 1;
#[doc = "< Returned due to erroneous inputs and/or options"]
pub const rstatus_et_METIS_ERROR_INPUT: rstatus_et = -2;
#[doc = "< Returned due to insufficient memory"]
pub const rstatus_et_METIS_ERROR_MEMORY: rstatus_et = -3;
#[doc = "< Some other errors"]
pub const rstatus_et_METIS_ERROR: rstatus_et = -4;
#[doc = " Return codes"]
pub type rstatus_et = ::std::os::raw::c_int;
pub const moptype_et_METIS_OP_PMETIS: moptype_et = 0;
pub const moptype_et_METIS_OP_KMETIS: moptype_et = 1;
pub const moptype_et_METIS_OP_OMETIS: moptype_et = 2;
#[doc = " Operation type codes"]
pub type moptype_et = ::std::os::raw::c_int;
pub const moptions_et_METIS_OPTION_PTYPE: moptions_et = 0;
pub const moptions_et_METIS_OPTION_OBJTYPE: moptions_et = 1;
pub const moptions_et_METIS_OPTION_CTYPE: moptions_et = 2;
pub const moptions_et_METIS_OPTION_IPTYPE: moptions_et = 3;
pub const moptions_et_METIS_OPTION_RTYPE: moptions_et = 4;
pub const moptions_et_METIS_OPTION_DBGLVL: moptions_et = 5;
pub const moptions_et_METIS_OPTION_NIPARTS: moptions_et = 6;
pub const moptions_et_METIS_OPTION_NITER: moptions_et = 7;
pub const moptions_et_METIS_OPTION_NCUTS: moptions_et = 8;
pub const moptions_et_METIS_OPTION_SEED: moptions_et = 9;
pub const moptions_et_METIS_OPTION_ONDISK: moptions_et = 10;
pub const moptions_et_METIS_OPTION_MINCONN: moptions_et = 11;
pub const moptions_et_METIS_OPTION_CONTIG: moptions_et = 12;
pub const moptions_et_METIS_OPTION_COMPRESS: moptions_et = 13;
pub const moptions_et_METIS_OPTION_CCORDER: moptions_et = 14;
pub const moptions_et_METIS_OPTION_PFACTOR: moptions_et = 15;
pub const moptions_et_METIS_OPTION_NSEPS: moptions_et = 16;
pub const moptions_et_METIS_OPTION_UFACTOR: moptions_et = 17;
pub const moptions_et_METIS_OPTION_NUMBERING: moptions_et = 18;
pub const moptions_et_METIS_OPTION_DROPEDGES: moptions_et = 19;
pub const moptions_et_METIS_OPTION_NO2HOP: moptions_et = 20;
pub const moptions_et_METIS_OPTION_TWOHOP: moptions_et = 21;
pub const moptions_et_METIS_OPTION_FAST: moptions_et = 22;
pub const moptions_et_METIS_OPTION_HELP: moptions_et = 23;
pub const moptions_et_METIS_OPTION_TPWGTS: moptions_et = 24;
pub const moptions_et_METIS_OPTION_NCOMMON: moptions_et = 25;
pub const moptions_et_METIS_OPTION_NOOUTPUT: moptions_et = 26;
pub const moptions_et_METIS_OPTION_BALANCE: moptions_et = 27;
pub const moptions_et_METIS_OPTION_GTYPE: moptions_et = 28;
pub const moptions_et_METIS_OPTION_UBVEC: moptions_et = 29;
#[doc = " Options codes (i.e., options[])"]
pub type moptions_et = ::std::os::raw::c_int;
pub const mptype_et_METIS_PTYPE_RB: mptype_et = 0;
pub const mptype_et_METIS_PTYPE_KWAY: mptype_et = 1;
#[doc = " Partitioning Schemes"]
pub type mptype_et = ::std::os::raw::c_int;
pub const mgtype_et_METIS_GTYPE_DUAL: mgtype_et = 0;
pub const mgtype_et_METIS_GTYPE_NODAL: mgtype_et = 1;
#[doc = " Graph types for meshes"]
pub type mgtype_et = ::std::os::raw::c_int;
pub const mctype_et_METIS_CTYPE_RM: mctype_et = 0;
pub const mctype_et_METIS_CTYPE_SHEM: mctype_et = 1;
#[doc = " Coarsening Schemes"]
pub type mctype_et = ::std::os::raw::c_int;
pub const miptype_et_METIS_IPTYPE_GROW: miptype_et = 0;
pub const miptype_et_METIS_IPTYPE_RANDOM: miptype_et = 1;
pub const miptype_et_METIS_IPTYPE_EDGE: miptype_et = 2;
pub const miptype_et_METIS_IPTYPE_NODE: miptype_et = 3;
pub const miptype_et_METIS_IPTYPE_METISRB: miptype_et = 4;
#[doc = " Initial partitioning schemes"]
pub type miptype_et = ::std::os::raw::c_int;
pub const mrtype_et_METIS_RTYPE_FM: mrtype_et = 0;
pub const mrtype_et_METIS_RTYPE_GREEDY: mrtype_et = 1;
pub const mrtype_et_METIS_RTYPE_SEP2SIDED: mrtype_et = 2;
pub const mrtype_et_METIS_RTYPE_SEP1SIDED: mrtype_et = 3;
#[doc = " Refinement schemes"]
pub type mrtype_et = ::std::os::raw::c_int;
#[doc = "< Shows various diagnostic messages"]
pub const mdbglvl_et_METIS_DBG_INFO: mdbglvl_et = 1;
#[doc = "< Perform timing analysis"]
pub const mdbglvl_et_METIS_DBG_TIME: mdbglvl_et = 2;
#[doc = "< Show the coarsening progress"]
pub const mdbglvl_et_METIS_DBG_COARSEN: mdbglvl_et = 4;
#[doc = "< Show the refinement progress"]
pub const mdbglvl_et_METIS_DBG_REFINE: mdbglvl_et = 8;
#[doc = "< Show info on initial partitioning"]
pub const mdbglvl_et_METIS_DBG_IPART: mdbglvl_et = 16;
#[doc = "< Show info on vertex moves during refinement"]
pub const mdbglvl_et_METIS_DBG_MOVEINFO: mdbglvl_et = 32;
#[doc = "< Show info on vertex moves during sep refinement"]
pub const mdbglvl_et_METIS_DBG_SEPINFO: mdbglvl_et = 64;
#[doc = "< Show info on minimization of subdomain connectivity"]
pub const mdbglvl_et_METIS_DBG_CONNINFO: mdbglvl_et = 128;
#[doc = "< Show info on elimination of connected components"]
pub const mdbglvl_et_METIS_DBG_CONTIGINFO: mdbglvl_et = 256;
#[doc = "< Show info related to wspace allocation"]
pub const mdbglvl_et_METIS_DBG_MEMORY: mdbglvl_et = 2048;
#[doc = " Debug Levels"]
pub type mdbglvl_et = ::std::os::raw::c_int;
pub const mobjtype_et_METIS_OBJTYPE_CUT: mobjtype_et = 0;
pub const mobjtype_et_METIS_OBJTYPE_VOL: mobjtype_et = 1;
pub const mobjtype_et_METIS_OBJTYPE_NODE: mobjtype_et = 2;
pub type mobjtype_et = ::std::os::raw::c_int;