Skip to content

Commit

Permalink
remove allocations completely, giving a large improvement for small m…
Browse files Browse the repository at this point in the history
…atrices
  • Loading branch information
abraunst committed Dec 11, 2018
1 parent cc8540b commit 15103b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/SparseArrays/src/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3561,8 +3561,8 @@ function circshift!(O::SparseMatrixCSC, X::SparseMatrixCSC, (r,c)::Base.DimsInte
O.colptr[i] = X.colptr[X.n - c + i] - nleft
end
# rotate rowval and nzval by the right number of elements
circshift!(O.rowval, X.rowval, nright)
circshift!(O.nzval, X.nzval, nright)
circshift!(O.rowval, X.rowval, (nright,))
circshift!(O.nzval, X.nzval, (nright,))

##### vertical shift
r = mod(r, X.m)
Expand Down

0 comments on commit 15103b0

Please sign in to comment.