EVSL
1.1.0
EigenValues Slicing Library
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
EXTERNAL
CXSparse
Source
cs_pinv.c
Go to the documentation of this file.
1
#include "
cs.h
"
2
/* pinv = p', or p = pinv' */
3
CS_INT
*
cs_pinv
(
CS_INT
const
*p,
CS_INT
n)
4
{
5
CS_INT
k, *pinv ;
6
if
(!p)
return
(NULL) ;
/* p = NULL denotes identity */
7
pinv =
cs_malloc
(n,
sizeof
(
CS_INT
)) ;
/* allocate result */
8
if
(!pinv)
return
(NULL) ;
/* out of memory */
9
for
(k = 0 ; k < n ; k++) pinv [p [k]] = k ;
/* invert the permutation */
10
return
(pinv) ;
/* return result */
11
}
cs_pinv
CS_INT * cs_pinv(CS_INT const *p, CS_INT n)
Definition:
cs_pinv.c:3
cs.h
CS_INT
#define CS_INT
Definition:
cs.h:627
cs_malloc
void * cs_malloc(CS_INT n, size_t size)
Definition:
cs_malloc.c:10
Generated by
1.8.6