Skip to content

Commit 52d139c

Browse files
tkfViralBShah
authored andcommitted
Refactoring: Use accessor methods when manipulating sparse matrices/vectors (#32953)
* Use accessor methods when touching SparseMatrixCSC
1 parent 95376f7 commit 52d139c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/Statistics/src/Statistics.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Standard library module for basic statistics functionality.
88
module Statistics
99

1010
using LinearAlgebra, SparseArrays
11+
using SparseArrays: getcolptr
1112

1213
using Base: has_offset_axes, require_one_based_indexing
1314

@@ -1003,9 +1004,9 @@ function centralize_sumabs2!(R::AbstractArray{S}, A::SparseMatrixCSC{Tv,Ti}, mea
10031004
isempty(R) || fill!(R, zero(S))
10041005
isempty(A) && return R
10051006

1006-
colptr = A.colptr
1007-
rowval = A.rowval
1008-
nzval = A.nzval
1007+
colptr = getcolptr(A)
1008+
rowval = rowvals(A)
1009+
nzval = nonzeros(A)
10091010
m = size(A, 1)
10101011
n = size(A, 2)
10111012

0 commit comments

Comments
 (0)