Go to the documentation of this file.00001 #include "cs.h"
00002
00003 int cs_happly (const cs *V, int i, double beta, double *x)
00004 {
00005 int p, *Vp, *Vi ;
00006 double *Vx, tau = 0 ;
00007 if (!CS_CSC (V) || !x) return (0) ;
00008 Vp = V->p ; Vi = V->i ; Vx = V->x ;
00009 for (p = Vp [i] ; p < Vp [i+1] ; p++)
00010 {
00011 tau += Vx [p] * x [Vi [p]] ;
00012 }
00013 tau *= beta ;
00014 for (p = Vp [i] ; p < Vp [i+1] ; p++)
00015 {
00016 x [Vi [p]] -= Vx [p] * tau ;
00017 }
00018 return (1) ;
00019 }