 function [y] = csr_matvec(A_CSR, x) 
%% matvec in csr format -- 
%% for illustration only 
R = A_CSR.rr; J = A_CSR.jj; IA = A_CSR.ptr;
n = A_CSR.n;
for i = 1:n
    t = 0.0;
    for k = IA(i):IA(i+1)-1
        t = t + R(k)*x(J(k)); 
    end
    y(i) = t;
end
    y = y(:);
