SCM

SCM Repository

[matrix] Diff of /pkg/src/Metis_utils.c
ViewVC logotype

Diff of /pkg/src/Metis_utils.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 70, Mon Apr 12 12:10:01 2004 UTC revision 148, Mon May 3 12:49:17 2004 UTC
# Line 1  Line 1 
1  #include "Metis_utils.h"  #include "Metis_utils.h"
2    
3  void ssc_metis_order(int n, const int Tp [], const int Ti [],  void ssc_metis_order(int n, const int Tp [], const int Ti [],
4                       idxtype* perm, idxtype* iperm)                       int Perm[], int iPerm[])
5  {  {
6      int  j, num_flag = 0, options_flag = 0;      int  j, num_flag = 0, options_flag = 0;
7      idxtype *xadj, *adj;      idxtype
8            *xadj = Calloc(n+1, idxtype),
9            *adj = Calloc(2 * (Tp[n] - n), idxtype),
10            *perm = Calloc(n, idxtype), /* in case idxtype != int */
11            *iperm = Calloc(n, idxtype);
12    
     xadj = (idxtype *) R_alloc(n + 1, sizeof(idxtype));  
     adj = (idxtype *) R_alloc(2 * (Tp[n] - n), sizeof(idxtype));  
13                                  /* temporarily use perm to store lengths */                                  /* temporarily use perm to store lengths */
14      memset(perm, 0, sizeof(idxtype) * n);      memset(perm, 0, sizeof(idxtype) * n);
15      for (j = 0; j < n; j++) {      for (j = 0; j < n; j++) {
# Line 37  Line 39 
39          }          }
40      }      }
41      METIS_NodeND(&n, xadj, adj, &num_flag, &options_flag, perm, iperm);      METIS_NodeND(&n, xadj, adj, &num_flag, &options_flag, perm, iperm);
42        for (j = 0; j < n; j++) {
43            Perm[i] = (int) perm[i];
44            iPerm[i] = (int) iperm[i];
45        }
46        Free(iperm); Free(perm); Free(xadj); Free(adj);
47  }  }

Legend:
Removed from v.70  
changed lines
  Added in v.148

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge