diff --git a/RandBLAS/sparse_data/conversions.hh b/RandBLAS/sparse_data/conversions.hh index cb4958b..3830ea1 100644 --- a/RandBLAS/sparse_data/conversions.hh +++ b/RandBLAS/sparse_data/conversions.hh @@ -72,7 +72,7 @@ void csc_to_coo(CSCMatrix &csc, COOMatrix &coo) { for (int64_t j = 0; j < csc.n_cols; ++j) { for (int64_t i = csc.colptr[j]; i < csc.colptr[j+1]; ++i) { coo.vals[ell] = csc.vals[ell]; - coo.rows[ell] = (sint_t2) i; + coo.rows[ell] = (sint_t2) csc.rowidxs[i]; coo.cols[ell] = (sint_t2) j; ++ell; } @@ -114,7 +114,7 @@ void csr_to_coo(CSRMatrix &csr, COOMatrix &coo) { for (int64_t j = csr.rowptr[i]; j < csr.rowptr[i+1]; ++j) { coo.vals[ell] = csr.vals[ell]; coo.rows[ell] = (sint_t2) i; - coo.cols[ell] = (sint_t2) j; + coo.cols[ell] = (sint_t2) csr.colidxs[j]; ++ell; } }