EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
cs_gaxpy.c
Go to the documentation of this file.
1 #include "cs.h"
2 /* y = A*x+y */
3 CS_INT cs_gaxpy (const cs *A, const CS_ENTRY *x, CS_ENTRY *y)
4 {
5  CS_INT p, j, n, *Ap, *Ai ;
6  CS_ENTRY *Ax ;
7  if (!CS_CSC (A) || !x || !y) return (0) ; /* check inputs */
8  n = A->n ; Ap = A->p ; Ai = A->i ; Ax = A->x ;
9  for (j = 0 ; j < n ; j++)
10  {
11  for (p = Ap [j] ; p < Ap [j+1] ; p++)
12  {
13  y [Ai [p]] += Ax [p] * x [j] ;
14  }
15  }
16  return (1) ;
17 }
#define cs
Definition: cs.h:637
CS_INT cs_gaxpy(const cs *A, const CS_ENTRY *x, CS_ENTRY *y)
Definition: cs_gaxpy.c:3
#define CS_ENTRY
Definition: cs.h:635
#define CS_CSC(A)
Definition: cs.h:659
#define CS_INT
Definition: cs.h:627