Blame view

fvn_sparse/AMD/Demo/amd_simple.c 811 Bytes
422234dc3   daniau   git-svn-id: https...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  /* ------------------------------------------------------------------------- */
  /* AMD Copyright (c) by Timothy A. Davis,				     */
  /* Patrick R. Amestoy, and Iain S. Duff.  See ../README.txt for License.     */
  /* email: davis at cise.ufl.edu    CISE Department, Univ. of Florida.        */
  /* web: http://www.cise.ufl.edu/research/sparse/amd                          */
  /* ------------------------------------------------------------------------- */
  
  #include <stdio.h>
  #include "amd.h"
  
  int n = 5 ;
  int Ap [ ] = { 0,   2,       6,       10,  12, 14} ;
  int Ai [ ] = { 0,1, 0,1,2,4, 1,2,3,4, 2,3, 1,4   } ;
  int P [5] ;
  
  int main (void)
  {
      int k ;
      (void) amd_order (n, Ap, Ai, P, (double *) NULL, (double *) NULL) ;
      for (k = 0 ; k < n ; k++) printf ("P [%d] = %d
  ", k, P [k]) ;
      return (0) ;
  }