25 idxtype *vwgt,
idxtype *adjwgt,
int *wgtflag,
int *numflag,
int *nparts,
26 int *options,
int *edgecut,
idxtype *part)
37 if (options[0] == 0) {
79 idxtype *vwgt,
idxtype *adjwgt,
int *wgtflag,
int *numflag,
int *nparts,
80 float *ubvec,
int *options,
int *edgecut,
idxtype *part)
92 if (options[0] == 0) {
109 myubvec =
fmalloc(*ncon,
"PWMETIS: mytpwgts");
110 scopy(*ncon, ubvec, myubvec);
138 float *nvwgt,
idxtype *adjwgt,
int *nparts,
int *options,
int *edgecut,
idxtype *part)
144 SetUpGraph2(&graph, *nvtxs, *ncon, xadj, adjncy, nvwgt, adjwgt);
146 if (options[0] == 0) {
185 float *nvwgt,
idxtype *adjwgt,
int *nparts,
float *ubvec,
int *options,
int *edgecut,
193 SetUpGraph2(&graph, *nvtxs, *ncon, xadj, adjncy, nvwgt, adjwgt);
195 if (options[0] == 0) {
212 myubvec =
fmalloc(*ncon,
"PWMETIS: mytpwgts");
213 scopy(*ncon, ubvec, myubvec);
239 float ubfactor,
int fpart)
241 int i, j, nvtxs, ncon, cut;
246 nvtxs = graph->
nvtxs;
248 printf(
"\t***Cannot bisect a graph with 0 vertices!\n\t***You are trying to partition a graph into too many parts!\n");
253 tpwgts[0] = 1.0*(nparts>>1)/(1.0*nparts);
254 tpwgts[1] = 1.0 - tpwgts[0];
259 label = graph->
label;
260 where = graph->
where;
261 for (i=0; i<nvtxs; i++)
262 part[label[i]] = where[i] + fpart;
276 else if (nparts == 3) {
291 float *ubvec,
int fpart)
293 int i, j, nvtxs, ncon, cut;
296 float tpwgts[2], *npwgts, *lubvec, *rubvec;
298 lubvec = rubvec = NULL;
300 nvtxs = graph->
nvtxs;
303 printf(
"\t***Cannot bisect a graph with 0 vertices!\n\t***You are trying to partition a graph into too many parts!\n");
308 tpwgts[0] = 1.0*(nparts>>1)/(1.0*nparts);
309 tpwgts[1] = 1.0 - tpwgts[0];
318 label = graph->
label;
319 where = graph->
where;
320 for (i=0; i<nvtxs; i++)
321 part[label[i]] = where[i] + fpart;
326 lubvec =
fmalloc(ncon,
"MCHMlevelRecursiveBisection");
327 rubvec =
fmalloc(ncon,
"MCHMlevelRecursiveBisection");
329 for (i=0; i<ncon; i++) {
330 lubvec[i] = ubvec[i]*tpwgts[0]/npwgts[i];
331 lubvec[i] =
amax(lubvec[i], 1.01);
333 rubvec[i] = ubvec[i]*tpwgts[1]/npwgts[ncon+i];
334 rubvec[i] =
amax(rubvec[i], 1.01);
349 else if (nparts == 3) {
#define MCHMlevelEdgeBisection
void METIS_mCPartGraphRecursive(int *nvtxs, int *ncon, idxtype *xadj, idxtype *adjncy, idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts, int *options, int *edgecut, idxtype *part)
#define MocInit2WayPartition2
#define MCMlevelRecursiveBisection
#define AllocateWorkSpace
#define IFSET(a, flag, cmd)
#define Change2CNumbering
void METIS_mCPartGraphRecursiveInternal(int *nvtxs, int *ncon, idxtype *xadj, idxtype *adjncy, float *nvwgt, idxtype *adjwgt, int *nparts, int *options, int *edgecut, idxtype *part)
void GKfree(void **ptr1,...)
#define MocInit2WayPartition
void METIS_mCHPartGraphRecursiveInternal(int *nvtxs, int *ncon, idxtype *xadj, idxtype *adjncy, float *nvwgt, idxtype *adjwgt, int *nparts, float *ubvec, int *options, int *edgecut, idxtype *part)
#define MCHMlevelRecursiveBisection
void METIS_mCHPartGraphRecursive(int *nvtxs, int *ncon, idxtype *xadj, idxtype *adjncy, idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts, float *ubvec, int *options, int *edgecut, idxtype *part)
#define MCMlevelEdgeBisection
#define Change2FNumbering