~ubuntu-branches/ubuntu/oneiric/suitesparse/oneiric

« back to all changes in this revision

Viewing changes to CSparse/Source/cs_schol.c

  • Committer: Bazaar Package Importer
  • Author(s): Nick Ellery
  • Date: 2009-06-14 19:15:52 UTC
  • mfrom: (7.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090614191552-2hliya5q8n1quseu
Tags: 1:3.4.0-1ubuntu1
* Merge from debian unstable, remaining changes (LP: #387137):
  - debian/control:
    - demote libatlas-doc from recommends to suggests as it is not in main
    - drop recommends on doc-central as it is not in main

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
    int n, *c, *post, *P ;
6
6
    cs *C ;
7
7
    css *S ;
8
 
    if (!CS_CSC (A)) return (NULL) ;        /* check inputs */
 
8
    if (!CS_CSC (A)) return (NULL) ;        /* check inputs */
9
9
    n = A->n ;
10
 
    S = cs_calloc (1, sizeof (css)) ;       /* allocate result S */
11
 
    if (!S) return (NULL) ;                 /* out of memory */
12
 
    P = cs_amd (order, A) ;                 /* P = amd(A+A'), or natural */
13
 
    S->pinv = cs_pinv (P, n) ;              /* find inverse permutation */
 
10
    S = cs_calloc (1, sizeof (css)) ;       /* allocate result S */
 
11
    if (!S) return (NULL) ;                 /* out of memory */
 
12
    P = cs_amd (order, A) ;                 /* P = amd(A+A'), or natural */
 
13
    S->pinv = cs_pinv (P, n) ;              /* find inverse permutation */
14
14
    cs_free (P) ;
15
15
    if (order && !S->pinv) return (cs_sfree (S)) ;
16
 
    C = cs_symperm (A, S->pinv, 0) ;        /* C = spones(triu(A(P,P))) */
17
 
    S->parent = cs_etree (C, 0) ;           /* find etree of C */
18
 
    post = cs_post (S->parent, n) ;         /* postorder the etree */
 
16
    C = cs_symperm (A, S->pinv, 0) ;        /* C = spones(triu(A(P,P))) */
 
17
    S->parent = cs_etree (C, 0) ;           /* find etree of C */
 
18
    post = cs_post (S->parent, n) ;         /* postorder the etree */
19
19
    c = cs_counts (C, S->parent, post, 0) ; /* find column counts of chol(C) */
20
20
    cs_free (post) ;
21
21
    cs_spfree (C) ;