Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1-based indexing issue in csr2sparse function #2

Open
JsuKya opened this issue Oct 12, 2021 · 0 comments
Open

1-based indexing issue in csr2sparse function #2

JsuKya opened this issue Oct 12, 2021 · 0 comments

Comments

@JsuKya
Copy link

JsuKya commented Oct 12, 2021

Hi foges,

Thanks a lot for sharing your code. I tried to convert my CSR matrices into sparse matrix in matlab, and got the error "Vector lengths must agree". I guess the following sentence should change from

if length(val) ~= length(col_ind) || length(col_ind) ~= row_ptr(end)

to

if length(val) ~= length(col_ind) || length(col_ind) ~= row_ptr(end)-row_ptr(1)
@JsuKya JsuKya changed the title 1-based indexing in csr2sparse function 1-based indexing issue in csr2sparse function Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant