Added a method to get the non-zero entries of a row to SparseMatrix