24 if (graph->
adjwgt == NULL) {
25 for (cut=0, i=0; i<graph->
nvtxs; i++) {
26 for (j=graph->
xadj[i]; j<graph->xadj[i+1]; j++)
27 if (where[i] != where[graph->
adjncy[j]])
32 for (cut=0, i=0; i<graph->
nvtxs; i++) {
33 for (j=graph->
xadj[i]; j<graph->xadj[i+1]; j++)
34 if (where[i] != where[graph->
adjncy[j]])
48 int i, j, nvtxs, nbnd;
49 idxtype *xadj, *adjncy, *where, *bndptr, *bndind;
58 for (nbnd=0, i=0; i<nvtxs; i++) {
59 if (xadj[i+1]-xadj[i] == 0)
62 for (j=xadj[i]; j<xadj[i+1]; j++) {
63 if (where[i] != where[adjncy[j]]) {
66 ASSERT(bndind[bndptr[i]] == i);
84 int i, j, nvtxs, nbnd, id, ed;
85 idxtype *xadj, *adjncy, *where, *bndptr, *bndind;
94 for (nbnd=0, i=0; i<nvtxs; i++) {
96 for (j=xadj[i]; j<xadj[i+1]; j++) {
97 if (where[i] != where[adjncy[j]])
102 if (ed -
id >= 0 && xadj[i] < xadj[i+1]) {
104 ASSERTP(bndptr[i] != -1, (
"%d %d %d\n", i,
id, ed));
105 ASSERT(bndind[bndptr[i]] == i);
119 int i, j, nvtxs, nbnd;
120 idxtype *xadj, *adjncy, *where, *bndptr, *bndind;
122 nvtxs = graph->
nvtxs;
125 where = graph->
where;
129 for (nbnd=0, i=0; i<nvtxs; i++) {
134 ASSERTP(nbnd == onbnd, (
"%d %d\n", nbnd, onbnd));
136 for (i=0; i<nvtxs; i++) {
138 ASSERTP(bndptr[i] == -1, (
"%d %d\n", i, bndptr[i]));
141 ASSERTP(bndptr[i] != -1, (
"%d %d\n", i, bndptr[i]));
172 int i, j, k, l, nvtxs, me, other;
173 idxtype *xadj, *adjncy, *adjwgt, *vwgt, *where;
176 nvtxs = graph->
nvtxs;
182 where = graph->
where;
187 pwgts[0] = pwgts[1] = pwgts[2] = 0;
188 for (i=0; i<nvtxs; i++) {
190 pwgts[me] += vwgt[i];
193 edegrees[0] = edegrees[1] = 0;
195 for (j=xadj[i]; j<xadj[i+1]; j++) {
196 other = where[adjncy[j]];
198 edegrees[other] += vwgt[adjncy[j]];
201 printf(
"Something wrong with edegrees: %d %d %d %d %d\n", i, edegrees[0], edegrees[1], graph->
nrinfo[i].
edegrees[0], graph->
nrinfo[i].
edegrees[1]);
207 if (pwgts[0] != graph->
pwgts[0] || pwgts[1] != graph->
pwgts[1] || pwgts[2] != graph->
pwgts[2])
208 printf(
"Something wrong with part-weights: %d %d %d %d %d %d\n", pwgts[0], pwgts[1], pwgts[2], graph->
pwgts[0], graph->
pwgts[1], graph->
pwgts[2]);
219 int i, j, nvtxs, other;
220 idxtype *xadj, *adjncy, *where;
222 nvtxs = graph->
nvtxs;
225 where = graph->
where;
227 for (i=0; i<nvtxs; i++) {
230 other = (where[i]+1)%2;
231 for (j=xadj[i]; j<xadj[i+1]; j++) {
232 ASSERTP(where[adjncy[j]] != other, (
"%d %d %d %d %d %d\n", i, where[i], adjncy[j], where[adjncy[j]], xadj[i+1]-xadj[i], xadj[adjncy[j]+1]-xadj[adjncy[j]]));
#define CheckNodePartitionParams
#define ASSERTP(expr, msg)