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

Fix sparse matrix row slices #14016

Merged
merged 1 commit into from
Nov 17, 2015
Merged

Fix sparse matrix row slices #14016

merged 1 commit into from
Nov 17, 2015

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Nov 16, 2015

Fix #14013

@@ -392,7 +392,7 @@ function Base.getindex{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, i::Integer, J::Abstract
if rowvalA[ptrA] <= rowI
ptrA = searchsortedfirst(rowvalA, rowI, ptrA, stopA, Base.Order.Forward)
if ptrA <= stopA && rowvalA[ptrA] == rowI
push!(nzinds, ptrI)
push!(nzinds, j)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be col?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it should be j. We want the n-th index to be the result of indexing with to the n-th value in J… that just happens to be the same as col in the case of 1:end.

@ViralBShah ViralBShah added the sparse Sparse arrays label Nov 17, 2015
tkelman added a commit that referenced this pull request Nov 17, 2015
Fix sparse matrix row slices
@tkelman tkelman merged commit dc258ac into master Nov 17, 2015
@tkelman tkelman deleted the mb/14013 branch November 17, 2015 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparse Sparse arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants