36 if (graph == orggraph)
59 graph->
pwgts =
imalloc(2*ncon,
"Allocate2WayPartitionMemory: pwgts");
60 graph->
where =
imalloc(nvtxs,
"Allocate2WayPartitionMemory: where");
61 graph->
bndptr =
imalloc(nvtxs,
"Allocate2WayPartitionMemory: bndptr");
62 graph->
bndind =
imalloc(nvtxs,
"Allocate2WayPartitionMemory: bndind");
63 graph->
id =
imalloc(nvtxs,
"Allocate2WayPartitionMemory: id");
64 graph->
ed =
imalloc(nvtxs,
"Allocate2WayPartitionMemory: ed");
73 idx_t i,
j, nvtxs,
ncon, nbnd, mincut, istart, iend, tid, ted, me;
94 for (i=0; i<nvtxs; i++) {
95 ASSERT(where[i] >= 0 && where[i] <= 1);
96 pwgts[where[
i]] += vwgt[
i];
101 for (i=0; i<nvtxs; i++) {
103 for (j=0; j<
ncon; j++)
104 pwgts[me*ncon+j] += vwgt[i*ncon+j];
110 for (nbnd=0, mincut=0, i=0; i<nvtxs; i++) {
117 for (j=istart; j<iend; j++) {
118 if (me == where[adjncy[j]])
126 if (ted > 0 || istart == iend) {
143 idx_t i,
j, istart, iend, nvtxs, nbnd, me, tid, ted;
146 idx_t *cwhere, *cbndptr;
153 cwhere = cgraph->
where;
156 nvtxs = graph->
nvtxs;
162 where = graph->
where;
171 for (i=0; i<nvtxs; i++) {
173 where[
i] = cwhere[
j];
174 cmap[
i] = cbndptr[
j];
178 for (nbnd=0, i=0; i<nvtxs; i++) {
184 for (j=istart; j<iend; j++)
189 for (j=istart; j<iend; j++) {
190 if (me == where[adjncy[j]])
199 if (ted > 0 || istart == iend)
idx_t idx_t idx_t idx_t * vwgt
#define gk_startcputimer(tmr)
#define gk_stopcputimer(tmr)
NonlinearFactorGraph graph
static const Similarity3 id
#define ASSERT(expression)
#define BNDInsert(nbnd, bndind, bndptr, vtx)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t * tpwgts
idx_t idx_t idx_t idx_t idx_t idx_t * adjwgt
idx_t idx_t idx_t idx_t * where
idx_t idx_t idx_t * adjncy
void Project2WayPartition(ctrl_t *ctrl, graph_t *graph)
#define IFSET(a, flag, cmd)
void Allocate2WayPartitionMemory(ctrl_t *ctrl, graph_t *graph)
void Refine2Way(ctrl_t *ctrl, graph_t *orggraph, graph_t *graph, real_t *tpwgts)
void Compute2WayPartitionParams(ctrl_t *ctrl, graph_t *graph)