cs_happly.c
Go to the documentation of this file.
1 #include "cs.h"
2 /* apply the ith Householder vector to x */
3 int cs_happly (const cs *V, int i, double beta, double *x)
4 {
5  int p, *Vp, *Vi ;
6  double *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 += 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_CSC(A)
Definition: cs.h:140
int * p
Definition: cs.h:21
Definition: cs.h:16
int * i
Definition: cs.h:22
double * x
Definition: cs.h:23
int cs_happly(const cs *V, int i, double beta, double *x)
Definition: cs_happly.c:3


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:31