The R Project SVN R-packages

Rev

Rev 155 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 155 Rev 1128
Line 19... Line 19...
19
* This function sets up the graph from the user input
19
* This function sets up the graph from the user input
20
**************************************************************************/
20
**************************************************************************/
21
void SetUpGraph(GraphType *graph, int OpType, int nvtxs, int ncon,
21
void SetUpGraph(GraphType *graph, int OpType, int nvtxs, int ncon,
22
       idxtype *xadj, idxtype *adjncy, idxtype *vwgt, idxtype *adjwgt, int wgtflag)
22
       idxtype *xadj, idxtype *adjncy, idxtype *vwgt, idxtype *adjwgt, int wgtflag)
23
{
23
{
24
  int i, j, k, sum, gsize;
24
  int i, j/* , k */, sum, gsize;
25
  float *nvwgt;
25
  float *nvwgt;
26
  idxtype tvwgt[MAXNCON];
26
  idxtype tvwgt[MAXNCON];
27
 
27
 
28
  if (OpType == OP_KMETIS && ncon == 1 && (wgtflag&2) == 0 && (wgtflag&1) == 0) {
28
  if (OpType == OP_KMETIS && ncon == 1 && (wgtflag&2) == 0 && (wgtflag&1) == 0) {
29
    SetUpGraphKway(graph, nvtxs, xadj, adjncy);
29
    SetUpGraphKway(graph, nvtxs, xadj, adjncy);
Line 209... Line 209...
209
* This function sets up the graph from the user input
209
* This function sets up the graph from the user input
210
**************************************************************************/
210
**************************************************************************/
211
void VolSetUpGraph(GraphType *graph, int OpType, int nvtxs, int ncon, idxtype *xadj, 
211
void VolSetUpGraph(GraphType *graph, int OpType, int nvtxs, int ncon, idxtype *xadj, 
212
                   idxtype *adjncy, idxtype *vwgt, idxtype *vsize, int wgtflag)
212
                   idxtype *adjncy, idxtype *vwgt, idxtype *vsize, int wgtflag)
213
{
213
{
214
  int i, j, k, sum, gsize;
214
  int i, j/* , k */, sum, gsize;
215
  idxtype *adjwgt;
215
  idxtype *adjwgt;
216
  float *nvwgt;
216
  float *nvwgt;
217
  idxtype tvwgt[MAXNCON];
217
  idxtype tvwgt[MAXNCON];
218
 
218
 
219
  InitGraph(graph);
219
  InitGraph(graph);
Line 488... Line 488...
488
/*************************************************************************
488
/*************************************************************************
489
* This function checks whether or not partition pid is contigous
489
* This function checks whether or not partition pid is contigous
490
**************************************************************************/
490
**************************************************************************/
491
int IsConnected2(GraphType *graph, int report)
491
int IsConnected2(GraphType *graph, int report)
492
{
492
{
493
  int i, j, k, nvtxs, first, last, nleft, ncmps, wgt;
493
  int i, j, k, nvtxs, first, last, nleft, ncmps/* , wgt */;
494
  idxtype *xadj, *adjncy, *where, *touched, *queue;
494
  idxtype *xadj, *adjncy, *where, *touched, *queue;
495
  idxtype *cptr;
495
  idxtype *cptr;
496
 
496
 
497
  nvtxs = graph->nvtxs;
497
  nvtxs = graph->nvtxs;
498
  xadj = graph->xadj;
498
  xadj = graph->xadj;
Line 551... Line 551...
551
* This function returns the number of connected components in cptr,cind
551
* This function returns the number of connected components in cptr,cind
552
* The separator of the graph is used to split it and then find its components.
552
* The separator of the graph is used to split it and then find its components.
553
**************************************************************************/
553
**************************************************************************/
554
int FindComponents(CtrlType *ctrl, GraphType *graph, idxtype *cptr, idxtype *cind)
554
int FindComponents(CtrlType *ctrl, GraphType *graph, idxtype *cptr, idxtype *cind)
555
{
555
{
556
  int i, j, k, nvtxs, first, last, nleft, ncmps, wgt;
556
  int i, j, k, nvtxs, first, last, nleft, ncmps/* , wgt */;
557
  idxtype *xadj, *adjncy, *where, *touched, *queue;
557
  idxtype *xadj, *adjncy, *where, *touched, *queue;
558
 
558
 
559
  nvtxs = graph->nvtxs;
559
  nvtxs = graph->nvtxs;
560
  xadj = graph->xadj;
560
  xadj = graph->xadj;
561
  adjncy = graph->adjncy;
561
  adjncy = graph->adjncy;