| 1 |
/* |
| 2 |
* Copyright 1997, Regents of the University of Minnesota |
| 3 |
* |
| 4 |
* proto.h |
| 5 |
* |
| 6 |
* This file contains header files |
| 7 |
* |
| 8 |
* Started 10/19/95 |
| 9 |
* George |
| 10 |
* |
| 11 |
* $Id: proto.h 20398 2016-11-22 17:17:12Z karypis $ |
| 12 |
* |
| 13 |
*/ |
| 14 |
|
| 15 |
#ifndef _LIBMETIS_PROTO_H_ |
| 16 |
#define _LIBMETIS_PROTO_H_ |
| 17 |
|
| 18 |
#include "ipm/hipo/auxiliary/OrderingPrint.h" |
| 19 |
|
| 20 |
/* auxapi.c */ |
| 21 |
|
| 22 |
/* balance.c */ |
| 23 |
void Balance2Way(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts); |
| 24 |
void Bnd2WayBalance(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts); |
| 25 |
void General2WayBalance(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts); |
| 26 |
void McGeneral2WayBalance(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts); |
| 27 |
|
| 28 |
|
| 29 |
/* bucketsort.c */ |
| 30 |
void BucketSortKeysInc(ctrl_t *ctrl, idx_t n, idx_t max, idx_t *keys, |
| 31 |
idx_t *tperm, idx_t *perm); |
| 32 |
|
| 33 |
/* coarsen.c */ |
| 34 |
graph_t *CoarsenGraph(ctrl_t *ctrl, graph_t *graph); |
| 35 |
graph_t *CoarsenGraphNlevels(ctrl_t *ctrl, graph_t *graph, idx_t nlevels); |
| 36 |
idx_t Match_RM(ctrl_t *ctrl, graph_t *graph); |
| 37 |
idx_t Match_SHEM(ctrl_t *ctrl, graph_t *graph); |
| 38 |
idx_t Match_2Hop(ctrl_t *ctrl, graph_t *graph, idx_t *perm, idx_t *match, |
| 39 |
idx_t cnvtxs, size_t nunmatched); |
| 40 |
idx_t Match_2HopAny(ctrl_t *ctrl, graph_t *graph, idx_t *perm, idx_t *match, |
| 41 |
idx_t cnvtxs, size_t *r_nunmatched, size_t maxdegree); |
| 42 |
idx_t Match_2HopAll(ctrl_t *ctrl, graph_t *graph, idx_t *perm, idx_t *match, |
| 43 |
idx_t cnvtxs, size_t *r_nunmatched, size_t maxdegree); |
| 44 |
void PrintCGraphStats(ctrl_t *ctrl, graph_t *graph); |
| 45 |
void CreateCoarseGraph(ctrl_t *ctrl, graph_t *graph, idx_t cnvtxs, |
| 46 |
idx_t *match); |
| 47 |
graph_t *SetupCoarseGraph(graph_t *graph, idx_t cnvtxs, int dovsize); |
| 48 |
void ReAdjustMemory(ctrl_t *ctrl, graph_t *graph, graph_t *cgraph); |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
/* compress.c */ |
| 53 |
graph_t *CompressGraph(ctrl_t *ctrl, idx_t nvtxs, const idx_t *xadj, const idx_t *adjncy, |
| 54 |
idx_t *vwgt, idx_t *cptr, idx_t *cind); |
| 55 |
graph_t *PruneGraph(ctrl_t *ctrl, idx_t nvtxs, const idx_t *xadj, const idx_t *adjncy, |
| 56 |
idx_t *vwgt, idx_t *iperm, real_t factor); |
| 57 |
|
| 58 |
|
| 59 |
/* contig.c */ |
| 60 |
idx_t FindSepInducedComponents(ctrl_t *, graph_t *, idx_t *, idx_t *); |
| 61 |
|
| 62 |
|
| 63 |
/* fm.c */ |
| 64 |
void FM_2WayRefine(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t niter); |
| 65 |
void FM_2WayCutRefine(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t niter); |
| 66 |
void FM_Mc2WayCutRefine(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t niter); |
| 67 |
void SelectQueue(graph_t *graph, real_t *pijbm, real_t *ubfactors, rpq_t **queues, |
| 68 |
idx_t *from, idx_t *cnum); |
| 69 |
void Print2WayRefineStats(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, |
| 70 |
real_t deltabal, idx_t mincutorder); |
| 71 |
|
| 72 |
|
| 73 |
/* graph.c */ |
| 74 |
graph_t *SetupGraph(ctrl_t *ctrl, idx_t nvtxs, idx_t ncon, const idx_t *xadj, |
| 75 |
const idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt); |
| 76 |
void SetupGraph_tvwgt(graph_t *graph); |
| 77 |
void SetupGraph_label(graph_t *graph); |
| 78 |
graph_t *SetupSplitGraph(graph_t *graph, idx_t snvtxs, idx_t snedges); |
| 79 |
graph_t *CreateGraph(void); |
| 80 |
void InitGraph(graph_t *graph); |
| 81 |
void FreeSData(graph_t *graph); |
| 82 |
void FreeRData(graph_t *graph); |
| 83 |
void FreeGraph(graph_t **graph); |
| 84 |
|
| 85 |
|
| 86 |
/* initpart.c */ |
| 87 |
void InitSeparator(ctrl_t *ctrl, graph_t *graph, idx_t niparts); |
| 88 |
void RandomBisection(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t niparts); |
| 89 |
void GrowBisection(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t niparts); |
| 90 |
void GrowBisectionNode(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t niparts); |
| 91 |
|
| 92 |
/* mcutil.c */ |
| 93 |
int ivecle(idx_t n, idx_t *x, idx_t *z); |
| 94 |
int ivecaxpylez(idx_t n, idx_t a, idx_t *x, idx_t *y, idx_t *z); |
| 95 |
int BetterVBalance(idx_t ncon, real_t *itvwgt, idx_t *v_vwgt, idx_t *u1_vwgt, |
| 96 |
idx_t *u2_vwgt); |
| 97 |
int BetterBalance2Way(idx_t n, real_t *x, real_t *y); |
| 98 |
real_t ComputeLoadImbalance(graph_t *graph, idx_t nparts, real_t *pijbm); |
| 99 |
real_t ComputeLoadImbalanceDiff(graph_t *graph, idx_t nparts, real_t *pijbm, |
| 100 |
real_t *ubvec); |
| 101 |
real_t ComputeLoadImbalanceDiffVec(graph_t *graph, idx_t nparts, real_t *pijbm, |
| 102 |
real_t *ubfactors, real_t *diffvec); |
| 103 |
|
| 104 |
/* mmd.c */ |
| 105 |
void genmmd(idx_t, idx_t *, idx_t *, idx_t *, idx_t *, idx_t , idx_t *, idx_t *, idx_t *, idx_t *, idx_t, idx_t *); |
| 106 |
void mmdelm(idx_t, idx_t *xadj, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t, idx_t); |
| 107 |
idx_t mmdint(idx_t, idx_t *xadj, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *); |
| 108 |
void mmdnum(idx_t, idx_t *, idx_t *, idx_t *); |
| 109 |
void mmdupd(idx_t, idx_t, idx_t *, idx_t *, idx_t, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t *, idx_t, idx_t *tag); |
| 110 |
|
| 111 |
|
| 112 |
/* ometis.c */ |
| 113 |
void MlevelNestedDissection(ctrl_t *ctrl, graph_t *graph, idx_t *order, |
| 114 |
idx_t lastvtx); |
| 115 |
void MlevelNestedDissectionCC(ctrl_t *ctrl, graph_t *graph, idx_t *order, |
| 116 |
idx_t lastvtx); |
| 117 |
void MlevelNodeBisectionMultiple(ctrl_t *ctrl, graph_t *graph); |
| 118 |
void MlevelNodeBisectionL2(ctrl_t *ctrl, graph_t *graph, idx_t niparts); |
| 119 |
void MlevelNodeBisectionL1(ctrl_t *ctrl, graph_t *graph, idx_t niparts); |
| 120 |
void SplitGraphOrder(ctrl_t *ctrl, graph_t *graph, graph_t **r_lgraph, |
| 121 |
graph_t **r_rgraph); |
| 122 |
graph_t **SplitGraphOrderCC(ctrl_t *ctrl, graph_t *graph, idx_t ncmps, |
| 123 |
idx_t *cptr, idx_t *cind); |
| 124 |
void MMDOrder(ctrl_t *ctrl, graph_t *graph, idx_t *order, idx_t lastvtx); |
| 125 |
|
| 126 |
|
| 127 |
/* options.c */ |
| 128 |
ctrl_t *SetupCtrl(moptype_et optype, idx_t *options, idx_t ncon, idx_t nparts, |
| 129 |
real_t *tpwgts, real_t *ubvec); |
| 130 |
void Setup2WayBalMultipliers(ctrl_t *ctrl, graph_t *graph, real_t *tpwgts); |
| 131 |
void PrintCtrl(ctrl_t *ctrl); |
| 132 |
int CheckParams(ctrl_t *ctrl); |
| 133 |
void FreeCtrl(ctrl_t **r_ctrl); |
| 134 |
|
| 135 |
/* refine.c */ |
| 136 |
void Allocate2WayPartitionMemory(ctrl_t *ctrl, graph_t *graph); |
| 137 |
void Compute2WayPartitionParams(ctrl_t *ctrl, graph_t *graph); |
| 138 |
|
| 139 |
|
| 140 |
/* separator.c */ |
| 141 |
void ConstructSeparator(ctrl_t *ctrl, graph_t *graph); |
| 142 |
|
| 143 |
|
| 144 |
/* sfm.c */ |
| 145 |
void FM_2WayNodeRefine2Sided(ctrl_t *ctrl, graph_t *graph, idx_t niter); |
| 146 |
void FM_2WayNodeRefine1Sided(ctrl_t *ctrl, graph_t *graph, idx_t niter); |
| 147 |
void FM_2WayNodeBalance(ctrl_t *ctrl, graph_t *graph); |
| 148 |
|
| 149 |
|
| 150 |
/* srefine.c */ |
| 151 |
void Refine2WayNode(ctrl_t *ctrl, graph_t *orggraph, graph_t *graph); |
| 152 |
void Allocate2WayNodePartitionMemory(ctrl_t *ctrl, graph_t *graph); |
| 153 |
void Compute2WayNodePartitionParams(ctrl_t *ctrl, graph_t *graph); |
| 154 |
void Project2WayNodePartition(ctrl_t *ctrl, graph_t *graph); |
| 155 |
|
| 156 |
/* util.c */ |
| 157 |
idx_t iargmax_nrm(size_t n, idx_t *x, real_t *y); |
| 158 |
idx_t iargmax2_nrm(size_t n, idx_t *x, real_t *y); |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
/* wspace.c */ |
| 163 |
void AllocateWorkSpace(ctrl_t *ctrl, graph_t *graph); |
| 164 |
void FreeWorkSpace(ctrl_t *ctrl); |
| 165 |
void *wspacemalloc(ctrl_t *ctrl, size_t nbytes); |
| 166 |
void wspacepush(ctrl_t *ctrl); |
| 167 |
void wspacepop(ctrl_t *ctrl); |
| 168 |
idx_t *iwspacemalloc(ctrl_t *, idx_t); |
| 169 |
real_t *rwspacemalloc(ctrl_t *, idx_t); |
| 170 |
ikv_t *ikvwspacemalloc(ctrl_t *, idx_t); |
| 171 |
|
| 172 |
#endif |