Skip to content

Commit 0fa85f1

Browse files
committed
some renaming to avoid polluting the module namespace
1 parent 65e8a35 commit 0fa85f1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

stdlib/SparseArrays/src/sparsematrix.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,8 +3509,8 @@ end
35093509

35103510
## circular shift
35113511

3512-
#swaps blocks start:split and split+1:fin in col
3513-
function swap!(col::AbstractVector, start::Integer, fin::Integer, split::Integer)
3512+
# thius helper in-place swaps blocks start:split and split+1:fin in col
3513+
function _swap!(col::AbstractVector, start::Integer, fin::Integer, split::Integer)
35143514
split == fin && return
35153515
reverse!(col, start, split)
35163516
reverse!(col, split + 1, fin)
@@ -3519,8 +3519,8 @@ function swap!(col::AbstractVector, start::Integer, fin::Integer, split::Integer
35193519
end
35203520

35213521

3522-
#this helper shifts a column by r
3523-
function shifter!(R::AbstractVector, V::AbstractVector, start::Integer, fin::Integer, m::Integer, r::Integer)
3522+
# this helper shifts a column by r. Used also by sparsevector.jl
3523+
function subvector_shifter!(R::AbstractVector, V::AbstractVector, start::Integer, fin::Integer, m::Integer, r::Integer)
35243524
split = fin
35253525
@inbounds for j = start:fin
35263526
# shift in the vertical direction...
@@ -3532,8 +3532,8 @@ function shifter!(R::AbstractVector, V::AbstractVector, start::Integer, fin::Int
35323532
end
35333533
end
35343534
# ...but rowval should be sorted within columns
3535-
swap!(R, start, fin, split)
3536-
swap!(V, start, fin, split)
3535+
_swap!(R, start, fin, split)
3536+
_swap!(V, start, fin, split)
35373537
end
35383538

35393539

@@ -3567,7 +3567,7 @@ function circshift!(O::SparseMatrixCSC, X::SparseMatrixCSC, (r,c)::Base.DimsInte
35673567
##### vertical shift
35683568
r = mod(r, X.m)
35693569
@inbounds for i=1:O.n
3570-
shifter!(O.rowval, O.nzval, O.colptr[i], O.colptr[i+1]-1, O.m, r)
3570+
subvector_shifter!(O.rowval, O.nzval, O.colptr[i], O.colptr[i+1]-1, O.m, r)
35713571
end
35723572
return O
35733573
end

stdlib/SparseArrays/src/sparsevector.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,7 @@ end
19801980

19811981
function circshift!(O::SparseVector, X::SparseVector, (r,)::Base.DimsInteger{1})
19821982
O .= X
1983-
shifter!(O.nzind, O.nzval, 1, length(O.nzind), O.n, mod(r, X.n))
1983+
subvector_shifter!(O.nzind, O.nzval, 1, length(O.nzind), O.n, mod(r, X.n))
19841984
return O
19851985
end
19861986

0 commit comments

Comments
 (0)