5 int p, q, j, *
Cp, *Ci, n, m, *Ap, *Ai, *w ;
8 if (!
CS_CSC (A))
return (NULL) ;
9 m = A->
m ; n = A->
n ; Ap = A->
p ; Ai = A->
i ; Ax = A->
x ;
10 C =
cs_spalloc (n, m, Ap [n], values && Ax, 0) ;
12 if (!C || !w)
return (
cs_done (C, w, NULL, 0)) ;
13 Cp = C->
p ; Ci = C->
i ; Cx = C->
x ;
14 for (p = 0 ; p < Ap [n] ; p++) w [Ai [p]]++ ;
16 for (j = 0 ; j < n ; j++)
18 for (p = Ap [j] ; p < Ap [j+1] ; p++)
20 Ci [q = w [Ai [p]]++] = j ;
21 if (Cx) Cx [q] = Ax [p] ;
24 return (
cs_done (C, w, NULL, 1)) ;
cs * cs_spalloc(int m, int n, int nzmax, int values, int triplet)
cs * cs_done(cs *C, void *w, void *x, int ok)
cs * cs_transpose(const cs *A, int values)
void * cs_calloc(int n, size_t size)
double cs_cumsum(int *p, int *c, int n)