Skip to content

Commit

Permalink
Fix bugs in undocumented sparse matrix conversion functions
Browse files Browse the repository at this point in the history
I'll add tests before merging this PR. But I want to note these necessary changes now as I'm discovering them.
  • Loading branch information
rileyjmurray authored Oct 24, 2024
1 parent dea0ae0 commit 1bf3d6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RandBLAS/sparse_data/conversions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void csc_to_coo(CSCMatrix<T, sint_t1> &csc, COOMatrix<T, sint_t2> &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;
}
Expand Down Expand Up @@ -114,7 +114,7 @@ void csr_to_coo(CSRMatrix<T, sint_t1> &csr, COOMatrix<T, sint_t2> &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;
}
}
Expand Down

0 comments on commit 1bf3d6e

Please sign in to comment.