2
/* apply the ith Householder vector to x */
3
int cs_happly (const cs *V, int i, double beta, double *x)
7
if (!CS_CSC (V) || !x) return (0) ; /* check inputs */
8
Vp = V->p ; Vi = V->i ; Vx = V->x ;
9
for (p = Vp [i] ; p < Vp [i+1] ; p++) /* tau = v'*x */
11
tau += Vx [p] * x [Vi [p]] ;
13
tau *= beta ; /* tau = beta*(v'*x) */
14
for (p = Vp [i] ; p < Vp [i+1] ; p++) /* x = x - v*tau */
16
x [Vi [p]] -= Vx [p] * tau ;