cs_gaxpy.c
Go to the documentation of this file.
00001 #include "cs.h"
00002 /* y = A*x+y */
00003 int cs_gaxpy (const cs *A, const double *x, double *y)
00004 {
00005     int p, j, n, *Ap, *Ai ;
00006     double *Ax ;
00007     if (!CS_CSC (A) || !x || !y) return (0) ;       /* check inputs */
00008     n = A->n ; Ap = A->p ; Ai = A->i ; Ax = A->x ;
00009     for (j = 0 ; j < n ; j++)
00010     {
00011         for (p = Ap [j] ; p < Ap [j+1] ; p++)
00012         {
00013             y [Ai [p]] += Ax [p] * x [j] ;
00014         }
00015     }
00016     return (1) ;
00017 }


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:36:56