Go to the documentation of this file.
25 for (ptr=
graph, nlevels=0; ptr!=orggraph; ptr=ptr->
finer, nlevels++);
65 if (contig &&
i == nlevels/2) {
81 if (
graph == orggraph)
127 "AllocateKWayPartitionMemory: ckrinfo");
132 "AllocateKWayVolPartitionMemory: vkrinfo");
151 idx_t i,
j, k,
l, nvtxs,
ncon,
nparts, nbnd, mincut, me,
other;
156 nvtxs =
graph->nvtxs;
165 bndind =
graph->bndind;
172 for (
i=0;
i<nvtxs;
i++) {
178 for (
i=0;
i<nvtxs;
i++) {
195 for (
i=0;
i<nvtxs;
i++) {
197 myrinfo =
graph->ckrinfo+
i;
207 if (myrinfo->
ed > 0) {
208 mincut += myrinfo->
ed;
216 for (k=0; k<myrinfo->
nnbrs; k++) {
217 if (mynbrs[k].pid ==
other) {
222 if (k == myrinfo->
nnbrs) {
233 if (myrinfo->
ed-myrinfo->
id >= 0)
241 graph->mincut = mincut/2;
257 for (
i=0;
i<nvtxs;
i++) {
259 myrinfo =
graph->vkrinfo+
i;
269 if (myrinfo->
ned > 0) {
270 mincut += myrinfo->
ned;
278 for (k=0; k<myrinfo->
nnbrs; k++) {
279 if (mynbrs[k].pid ==
other) {
284 if (k == myrinfo->
nnbrs) {
298 graph->mincut = mincut/2;
317 idx_t i,
j, k, nvtxs, nbnd,
nparts, me,
other, istart, iend, tid, ted;
319 idx_t *cmap, *
where, *bndptr, *bndind, *cwhere, *htable;
326 cgraph =
graph->coarser;
327 cwhere = cgraph->
where;
329 nvtxs =
graph->nvtxs;
338 bndind =
graph->bndind;
352 for (
i=0;
i<nvtxs;
i++) {
361 for (nbnd=0,
i=0;
i<nvtxs;
i++) {
365 myrinfo =
graph->ckrinfo+
i;
368 for (tid=0,
j=istart;
j<iend;
j++)
379 for (tid=0, ted=0,
j=istart;
j<iend;
j++) {
386 if ((k = htable[
other]) == -1) {
409 htable[mynbrs[
j].pid] = -1;
428 for (
i=0;
i<nvtxs;
i++) {
437 for (
i=0;
i<nvtxs;
i++) {
440 myrinfo =
graph->vkrinfo+
i;
443 myrinfo->
nid = iend-istart;
451 for (tid=0, ted=0,
j=istart;
j<iend;
j++) {
458 if ((k = htable[
other]) == -1) {
479 htable[mynbrs[
j].pid] = -1;
510 idx_t *bndind, *bndptr;
512 nvtxs =
graph->nvtxs;
513 bndind =
graph->bndind;
522 for (
i=0;
i<nvtxs;
i++) {
528 for (
i=0;
i<nvtxs;
i++) {
529 if (
graph->ckrinfo[
i].ed > 0)
538 for (
i=0;
i<nvtxs;
i++) {
539 if (
graph->vkrinfo[
i].gv >= 0)
544 for (
i=0;
i<nvtxs;
i++) {
545 if (
graph->vkrinfo[
i].ned > 0)
566 *bndind, *bndptr, *ophtable;
574 nvtxs =
graph->nvtxs;
581 bndind =
graph->bndind;
588 for (
i=0;
i<nvtxs;
i++) {
589 myrinfo =
graph->vkrinfo+
i;
592 if (myrinfo->
nnbrs > 0) {
601 orinfo =
graph->vkrinfo+ii;
604 for (k=0; k<orinfo->
nnbrs; k++)
605 ophtable[onbrs[k].pid] = k;
611 for (k=0; k<myrinfo->
nnbrs; k++) {
612 if (ophtable[mynbrs[k].pid] == -1)
617 ASSERT(ophtable[me] != -1);
619 if (onbrs[ophtable[me]].ned == 1) {
622 for (k=0; k<myrinfo->
nnbrs; k++) {
623 if (ophtable[mynbrs[k].pid] != -1)
630 for (k=0; k<myrinfo->
nnbrs; k++) {
631 if (ophtable[mynbrs[k].pid] == -1)
638 for (k=0; k<orinfo->
nnbrs; k++)
639 ophtable[onbrs[k].pid] = -1;
640 ophtable[
other] = -1;
644 for (k=0; k<myrinfo->
nnbrs; k++) {
645 if (mynbrs[k].gv > myrinfo->
gv)
646 myrinfo->
gv = mynbrs[k].
gv;
650 if (myrinfo->
ned > 0 && myrinfo->
nid == 0)
654 if (myrinfo->
gv >= 0)
#define EliminateComponents
#define Greedy_KWayOptimize
idx_t idx_t idx_t idx_t idx_t idx_t * adjwgt
void AllocateKWayPartitionMemory(ctrl_t *ctrl, graph_t *graph)
idx_t idx_t idx_t idx_t idx_t * vsize
idx_t idx_t idx_t * adjncy
void ComputeKWayVolGains(ctrl_t *ctrl, graph_t *graph)
#define IFSET(a, flag, cmd)
int IsBalanced(ctrl_t *ctrl, graph_t *graph, real_t ffactor)
#define BNDInsert(nbnd, bndind, bndptr, vtx)
void ComputeKWayBoundary(ctrl_t *ctrl, graph_t *graph, idx_t bndtype)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t * nparts
#define gk_startcputimer(tmr)
void RefineKWay(ctrl_t *ctrl, graph_t *orggraph, graph_t *graph)
static const Line3 l(Rot3(), 1, 1)
idx_t idx_t idx_t idx_t * vwgt
#define ASSERT(expression)
void ProjectKWayPartition(ctrl_t *ctrl, graph_t *graph)
void ComputeKWayPartitionParams(ctrl_t *ctrl, graph_t *graph)
#define FindPartitionInducedComponents
idx_t idx_t idx_t idx_t * where
#define EliminateSubDomainEdges
NonlinearFactorGraph graph
void * gk_malloc(size_t nbytes, char *msg)
#define gk_stopcputimer(tmr)
void gk_errexit(int signum, char *f_str,...)
#define ComputeLoadImbalanceDiff
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:52