ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
mrefine2.c
Go to the documentation of this file.
1 /*
2  * Copyright 1997, Regents of the University of Minnesota
3  *
4  * mrefine2.c
5  *
6  * This file contains the driving routines for multilevel refinement
7  *
8  * Started 7/24/97
9  * George
10  *
11  * $Id: mrefine2.c,v 1.1 1998/11/27 17:59:26 karypis Exp $
12  */
13 
14 #include "metis.h"
15 
16 
17 /*************************************************************************
18 * This function is the entry point of refinement
19 **************************************************************************/
20 void MocRefine2Way2(CtrlType *ctrl, GraphType *orggraph, GraphType *graph, float *tpwgts,
21  float *ubvec)
22 {
23 
25 
26  /* Compute the parameters of the coarsest graph */
27  MocCompute2WayPartitionParams(ctrl, graph);
28 
29  for (;;) {
30  ASSERT(CheckBnd(graph));
31 
32  IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->RefTmr));
33  switch (ctrl->RType) {
34  case RTYPE_FM:
35  MocBalance2Way2(ctrl, graph, tpwgts, ubvec);
36  MocFM_2WayEdgeRefine2(ctrl, graph, tpwgts, ubvec, 8);
37  break;
38  default:
39  graclus_errexit("Unknown refinement type: %d\n", ctrl->RType);
40  }
41  IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->RefTmr));
42 
43  if (graph == orggraph)
44  break;
45 
46  graph = graph->finer;
47  IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->ProjectTmr));
48  MocProject2WayPartition(ctrl, graph);
49  IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->ProjectTmr));
50  }
51 
52  IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->UncoarsenTmr));
53 }
54 
55 
#define DBG_TIME
Definition: defs.h:174
#define RTYPE_FM
Definition: defs.h:133
#define ASSERT(expr)
Definition: macros.h:125
#define stoptimer(tmr)
Definition: macros.h:49
#define IFSET(a, flag, cmd)
Definition: macros.h:56
#define starttimer(tmr)
Definition: macros.h:48
void MocRefine2Way2(CtrlType *ctrl, GraphType *orggraph, GraphType *graph, float *tpwgts, float *ubvec)
Definition: mrefine2.c:20
void graclus_errexit(char *,...)
Definition: util.c:98
#define CheckBnd
Definition: rename.h:44
#define MocFM_2WayEdgeRefine2
Definition: rename.h:190
#define MocBalance2Way2
Definition: rename.h:151
#define MocProject2WayPartition
Definition: rename.h:271
#define MocCompute2WayPartitionParams
Definition: rename.h:270
int dbglvl
Definition: struct.h:224
timer ProjectTmr
Definition: struct.h:239
timer RefTmr
Definition: struct.h:239
timer UncoarsenTmr
Definition: struct.h:238
int RType
Definition: struct.h:227
struct graphdef * finer
Definition: struct.h:205