Correct me if I'm wrong, but the only reason the matrix being sparse is mentioned is because the author stuck a bunch of 0s in the matrices... this solution should work regardless of the sparsity.
It would be wasteful to use this approach for non-sparse matrices, but it would still "work".