Go to the documentation of this file.00001 #include "cs.h"
00002
00003 int cs_scatter (const cs *A, int j, double beta, int *w, double *x, int mark,
00004 cs *C, int nz)
00005 {
00006 int i, p, *Ap, *Ai, *Ci ;
00007 double *Ax ;
00008 if (!CS_CSC (A) || !w || !CS_CSC (C)) return (-1) ;
00009 Ap = A->p ; Ai = A->i ; Ax = A->x ; Ci = C->i ;
00010 for (p = Ap [j] ; p < Ap [j+1] ; p++)
00011 {
00012 i = Ai [p] ;
00013 if (w [i] < mark)
00014 {
00015 w [i] = mark ;
00016 Ci [nz++] = i ;
00017 if (x) x [i] = beta * Ax [p] ;
00018 }
00019 else if (x) x [i] += beta * Ax [p] ;
00020 }
00021 return (nz) ;
00022 }