24 int i, j, k, nedges, nlevels;
25 float vfraction, efraction, vmult, emult;
26 int coresize, gdata, rdata;
31 nedges = xadj[*nvtxs];
42 coresize += 2*(*nvtxs);
46 nlevels = (int)(log(100.0/(*nvtxs))/log(vfraction) + .5);
47 vmult = 0.5 + (1.0 - pow(vfraction, nlevels))/(1.0 - vfraction);
48 emult = 1.0 + (1.0 - pow(efraction, nlevels+1))/(1.0 - efraction);
50 gdata += (int) vmult*4*(*nvtxs) + emult*2*nedges;
51 if ((vmult-1.0)*4*(*nvtxs) + (emult-1.0)*2*nedges < 5*(*nvtxs))
56 *nbytes =
sizeof(
idxtype)*(coresize+gdata+rdata+(*nvtxs));
68 int i, ii, j, cnvtxs, cnedges, maxidx;
77 for (ii=0; ii<nvtxs; ii++) {
84 for (j=xadj[i]; j<xadj[i+1]; j++) {
91 cmap[i] = cmap[maxidx] = cnvtxs++;
99 *vfraction = (1.0*cnvtxs)/(1.0*nvtxs);
100 *efraction = (1.0*cnedges)/(1.0*xadj[nvtxs]);
102 GKfree((
void**) &cmap, (
void**) &match, (
void**) &perm,
LTERM);
113 int i, j, k, istart, iend, nedges, cnedges, v, u;
118 cnvtxs = cnedges = 0;
119 for (i=0; i<nvtxs; i++) {
121 if (cmap[v] != cnvtxs)
124 htable[cnvtxs] = cnvtxs;
130 for (j=istart; j<iend; j++) {
132 if (htable[k] != cnvtxs) {
141 for (j=istart; j<iend; j++) {
143 if (htable[k] != cnvtxs) {
int ComputeCoarseGraphSize(int nvtxs, idxtype *xadj, idxtype *adjncy, int cnvtxs, idxtype *cmap, idxtype *match, idxtype *perm)
void METIS_EstimateMemory(int *nvtxs, idxtype *xadj, idxtype *adjncy, int *numflag, int *optype, int *nbytes)
void EstimateCFraction(int nvtxs, idxtype *xadj, idxtype *adjncy, float *vfraction, float *efraction)
#define Change2CNumbering
#define Change2FNumbering2