5 double d, lki, *Lx, *x, *Cx ;
6 int top, i, p, k, n, *Li, *Lp, *cp, *pinv, *s, *c, *parent, *
Cp, *Ci ;
12 c = (
int*)
cs_malloc (2*n,
sizeof (
int)) ;
13 x = (
double*)
cs_malloc (n,
sizeof (
double)) ;
17 if (!N || !c || !x || !C)
return (
cs_ndone (N, E, c, x, 0)) ;
19 Cp = C->
p ; Ci = C->
i ; Cx = C->
x ;
21 if (!L)
return (
cs_ndone (N, E, c, x, 0)) ;
22 Lp = L->
p ; Li = L->
i ; Lx = L->
x ;
23 for (k = 0 ; k < n ; k++) Lp [k] = c [k] = cp [k] ;
24 for (k = 0 ; k < n ; k++)
29 for (p = Cp [k] ; p < Cp [k+1] ; p++)
31 if (Ci [p] <= k) x [Ci [p]] = Cx [p] ;
36 for ( ; top < n ; top++)
39 lki = x [i] / Lx [Lp [i]] ;
41 for (p = Lp [i] + 1 ; p < c [i] ; p++)
43 x [Li [p]] -= Lx [p] * lki ;
51 if (d <= 0)
return (
cs_ndone (N, E, c, x, 0)) ;
IntermediateState sqrt(const Expression &arg)
cs * cs_spalloc(int m, int n, int nzmax, int values, int triplet)
cs * cs_symperm(const cs *A, const int *pinv, int values)
csn * cs_chol(const cs *A, const css *S)
int cs_ereach(const cs *A, int k, const int *parent, int *s, int *w)
void * cs_calloc(int n, size_t size)
void * cs_malloc(int n, size_t size)
csn * cs_ndone(csn *N, cs *C, void *w, void *x, int ok)