36 for (i=0; i<nbnd; i++) {
38 if (xadj[j+1]-xadj[j] > 0)
71 idx_t i, ii,
j, jj, k,
l, nvtxs, nbnd, bnvtxs[3], bnedges[2], csize;
73 idx_t *
where, *bndind, *bndptr, *vmap, *ivmap, *cover;
92 bnvtxs[0] = bnvtxs[1] = bnedges[0] = bnedges[1] = 0;
93 for (i=0; i<nbnd; i++) {
96 if (xadj[j+1]-xadj[j] > 0) {
98 bnedges[k] += xadj[j+1]-xadj[
j];
102 bnvtxs[2] = bnvtxs[0]+bnvtxs[1];
103 bnvtxs[1] = bnvtxs[0];
111 for (i=0; i<nbnd; i++) {
114 if (xadj[j+1]-xadj[j] > 0) {
116 ivmap[bnvtxs[k]++] =
j;
121 bnvtxs[1] = bnvtxs[0];
124 for (k=0; k<2; k++) {
125 for (ii=0; ii<nbnd; ii++) {
127 if (where[i] == k && xadj[i] < xadj[i+1]) {
128 for (j=xadj[i]; j<xadj[i+1]; j++) {
130 if (where[jj] != k) {
133 badjncy[l++] = vmap[jj];
136 bxadj[++bnvtxs[k]] =
l;
141 ASSERT(l <= bnedges[0]+bnedges[1]);
143 MinCover(bxadj, badjncy, bnvtxs[0], bnvtxs[1], cover, &csize);
146 printf(
"Nvtxs: %6"PRIDX", [%5"PRIDX" %5"PRIDX"], Cut: %6"PRIDX", SS: [%6"PRIDX" %6"PRIDX"], Cover: %6"PRIDX"\n", nvtxs, graph->
pwgts[0], graph->
pwgts[1], graph->
mincut, bnvtxs[0], bnvtxs[1]-bnvtxs[0], csize));
148 for (i=0; i<csize; i++) {
155 printf(
"Nvtxs: %6"PRIDX", [%5"PRIDX" %5"PRIDX"], Cut: %6"PRIDX", SS: [%6"PRIDX" %6"PRIDX"], Cover: %6"PRIDX"\n", nvtxs, graph->
pwgts[0], graph->
pwgts[1], graph->
mincut, (
idx_t)0, (
idx_t)0, (
idx_t)0));
#define FM_2WayNodeRefine2Sided
void ConstructSeparator(ctrl_t *ctrl, graph_t *graph)
#define Compute2WayNodePartitionParams
#define ASSERTP(expr, msg)
void ConstructMinCoverSeparator(ctrl_t *ctrl, graph_t *graph)
#define CheckNodePartitionParams
NonlinearFactorGraph graph
#define FM_2WayNodeRefine1Sided
#define Allocate2WayNodePartitionMemory
#define ASSERT(expression)
static const Line3 l(Rot3(), 1, 1)
idx_t idx_t idx_t idx_t * where
idx_t idx_t idx_t * adjncy
#define IFSET(a, flag, cmd)