# How to do matrix operations with this way of storing sparse matrices

I read the way of storing the five or seven point laplace matrix for some poisson problem but I don't understand how can i multiply, add and subtract this stored sparse matrix by a vector or another matrix?

The way says that we just store the diagonal entries which are the coefficients of the i,j,k unknown in adiag matrix and the coefficients of the i+,j,k neighbours will be stored in another array ax and for the j neighbours as well.

• Where did you read this? – nicoguaro Jul 11 '17 at 1:39
• In Robert bridson's book fluid simulation for computer graphics – Anas Alaa Jul 11 '17 at 10:12

for (i=1...N)