42 if (graph == orggraph)
69 int nvtxs, ncon, pad64;
82 graph->
npwgts =
fmalloc(ncon*nparts,
"MocAllocateKWayPartitionMemory: npwgts");
91 int i, j, k, l, nvtxs, ncon, nbnd, mincut, me, other;
92 idxtype *xadj, *adjncy, *adjwgt, *where, *bndind, *bndptr;
95 float *nvwgt, *npwgts;
100 nvwgt = graph->
nvwgt;
104 where = graph->
where;
105 npwgts =
sset(ncon*nparts, 0.0, graph->
npwgts);
108 rinfo = graph->
rinfo;
116 for (i=0; i<nvtxs; i++) {
118 saxpy(ncon, 1.0, nvwgt+i*ncon, 1, npwgts+me*ncon, 1);
124 for (j=xadj[i]; j<xadj[i+1]; j++) {
125 if (me != where[adjncy[j]])
126 myrinfo->
ed += adjwgt[j];
131 mincut += myrinfo->
ed;
133 if (myrinfo->
ed-myrinfo->
id >= 0)
137 if (myrinfo->
ed > 0) {
141 for (j=xadj[i]; j<xadj[i+1]; j++) {
142 other = where[adjncy[j]];
144 for (k=0; k<myrinfo->
ndegrees; k++) {
145 if (myedegrees[k].pid == other) {
146 myedegrees[k].
ed += adjwgt[j];
152 myedegrees[myrinfo->
ndegrees++].
ed = adjwgt[j];
174 int i, j, k, nvtxs, nbnd, me, other, istart, iend, ndegrees;
175 idxtype *xadj, *adjncy, *adjwgt, *adjwgtsum;
176 idxtype *cmap, *where, *bndptr, *bndind;
184 cwhere = cgraph->
where;
185 crinfo = cgraph->
rinfo;
187 nvtxs = graph->
nvtxs;
195 where = graph->
where;
196 rinfo = graph->
rinfo;
201 for (i=0; i<nvtxs; i++) {
203 where[i] = cwhere[k];
204 cmap[i] = crinfo[k].
ed;
210 for (nbnd=0, i=0; i<nvtxs; i++) {
217 myrinfo->
id = adjwgtsum[i];
227 for (j=istart; j<iend; j++) {
228 other = where[adjncy[j]];
230 myrinfo->
ed += adjwgt[j];
231 if ((k = htable[other]) == -1) {
232 htable[other] = ndegrees;
233 myedegrees[ndegrees].
pid = other;
234 myedegrees[ndegrees++].
ed = adjwgt[j];
237 myedegrees[k].
ed += adjwgt[j];
241 myrinfo->
id -= myrinfo->
ed;
244 if (myrinfo->
ed == 0) {
249 if (myrinfo->
ed-myrinfo->
id >= 0)
254 for (j=0; j<ndegrees; j++)
255 htable[myedegrees[j].pid] = -1;
283 nvtxs = graph->
nvtxs;
290 for (i=0; i<nvtxs; i++) {
#define MCGreedy_KWayEdgeBalanceHorizontal
#define MocRefineKWayHorizontal
#define MocAllocateKWayPartitionMemory
#define BNDInsert(nbnd, bndind, bndptr, vtx)
struct graphdef * coarser
#define MocComputeKWayPartitionParams
#define IFSET(a, flag, cmd)
#define MCRandom_KWayEdgeRefineHorizontal
#define MocComputeKWayBalanceBoundary
#define MocProjectKWayPartition
#define ComputeKWayBoundary