cs_gaxpy.c
Go to the documentation of this file.
1 #include "cs.h"
2 /* y = A*x+y */
3 int cs_gaxpy (const cs *A, const double *x, double *y)
4 {
5  int p, j, n, *Ap, *Ai ;
6  double *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 }
int n
Definition: cs.h:20
#define CS_CSC(A)
Definition: cs.h:140
int * p
Definition: cs.h:21
int cs_gaxpy(const cs *A, const double *x, double *y)
Definition: cs_gaxpy.c:3
Definition: cs.h:16
int * i
Definition: cs.h:22
double * x
Definition: cs.h:23


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