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

« back to all changes in this revision

Viewing changes to CSparse/Source/cs_pinv.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:
3
3
int *cs_pinv (int const *p, int n)
4
4
{
5
5
    int k, *pinv ;
6
 
    if (!p) return (NULL) ;                     /* p = NULL denotes identity */
7
 
    pinv = cs_malloc (n, sizeof (int)) ;        /* allocate result */
8
 
    if (!pinv) return (NULL) ;                  /* out of memory */
 
6
    if (!p) return (NULL) ;                     /* p = NULL denotes identity */
 
7
    pinv = cs_malloc (n, sizeof (int)) ;        /* allocate result */
 
8
    if (!pinv) return (NULL) ;                  /* out of memory */
9
9
    for (k = 0 ; k < n ; k++) pinv [p [k]] = k ;/* invert the permutation */
10
 
    return (pinv) ;                             /* return result */
 
10
    return (pinv) ;                             /* return result */
11
11
}