public static void sprsax(int []  sa, int []  ija, int [] x, double [] b) throws NRException
{
    int i,k;

    int n = x.length;
    if (ija[0] != n+1)
        throw new NRException("sprsax: mismatched vector and matrix");
    for (i=0; i<n; i++) {
    b[i] = sa[i]*x[i];
    for (k=ija[i];k<ija[i+1];k++) {
        b[i] += sa[k]*x[ija[k]];
    	}
    }
}