Debugging sparse matrix