C++ sparse matrix implementation using CSR format