5 CS_INT t, j, k, nz = 0, m, n, *Ap, *Ai, *Cp, *Ci ;
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 (m, n, Ap [n], values && Ax != NULL, 0) ;
11 if (!C)
return (
cs_done (C, NULL, NULL, 0)) ;
12 Cp = C->p ; Ci = C->i ; Cx = C->x ;
13 for (k = 0 ; k < n ; k++)
17 for (t = Ap [j] ; t < Ap [j+1] ; t++)
19 if (Cx) Cx [nz] = Ax [t] ;
20 Ci [nz++] = pinv ? (pinv [Ai [t]]) : Ai [t] ;
24 return (
cs_done (C, NULL, NULL, 1)) ;
cs * cs_spalloc(CS_INT m, CS_INT n, CS_INT nzmax, CS_INT values, CS_INT triplet)
cs * cs_done(cs *C, void *w, void *x, CS_INT ok)
cs * cs_permute(const cs *A, const CS_INT *pinv, const CS_INT *q, CS_INT values)