6 CS_INT j, J, p, q, px, top, n, *Gp, *Gi, *Bp, *Bi ;
8 if (!
CS_CSC (G) || !
CS_CSC (B) || !xi || !x)
return (-1) ;
9 Gp = G->p ; Gi = G->i ; Gx = G->x ; n = G->n ;
10 Bp = B->p ; Bi = B->i ; Bx = B->x ;
12 for (p = top ; p < n ; p++) x [xi [p]] = 0 ;
13 for (p = Bp [k] ; p < Bp [k+1] ; p++) x [Bi [p]] = Bx [p] ;
14 for (px = top ; px < n ; px++)
17 J = pinv ? (pinv [j]) : j ;
19 x [j] /= Gx [lo ? (Gp [J]) : (Gp [J+1]-1)] ;
20 p = lo ? (Gp [J]+1) : (Gp [J]) ;
21 q = lo ? (Gp [J+1]) : (Gp [J+1]-1) ;
24 x [Gi [p]] -= Gx [p] * x [j] ;
CS_INT cs_reach(cs *G, const cs *B, CS_INT k, CS_INT *xi, const CS_INT *pinv)
CS_INT cs_spsolve(cs *G, const cs *B, CS_INT k, CS_INT *xi, CS_ENTRY *x, const CS_INT *pinv, CS_INT lo)