EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
cs_happly.c
Go to the documentation of this file.
1 #include "cs.h"
2 /* apply the ith Householder vector to x */
3 CS_INT cs_happly (const cs *V, CS_INT i, double beta, CS_ENTRY *x)
4 {
5  CS_INT p, *Vp, *Vi ;
6  CS_ENTRY *Vx, tau = 0 ;
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 */
10  {
11  tau += CS_CONJ (Vx [p]) * x [Vi [p]] ;
12  }
13  tau *= beta ; /* tau = beta*(v'*x) */
14  for (p = Vp [i] ; p < Vp [i+1] ; p++) /* x = x - v*tau */
15  {
16  x [Vi [p]] -= Vx [p] * tau ;
17  }
18  return (1) ;
19 }
#define cs
Definition: cs.h:637
#define CS_CONJ(x)
Definition: cs.h:649
CS_INT cs_happly(const cs *V, CS_INT i, double beta, CS_ENTRY *x)
Definition: cs_happly.c:3
#define CS_ENTRY
Definition: cs.h:635
#define CS_CSC(A)
Definition: cs.h:659
#define CS_INT
Definition: cs.h:627