PHP sparse matrix implementation using CSR format