Skip to content

Commit b7e9493

Browse files
magertonViralBShah
authored andcommitted
Update col index to j in sparse docs (#32787)
* fix fortran ccall example (#32784) * same update as PR #32769
1 parent 4671ddc commit b7e9493

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

stdlib/SparseArrays/docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ row indices. The internal representation of `SparseMatrixCSC` is as follows:
2020
struct SparseMatrixCSC{Tv,Ti<:Integer} <: AbstractSparseMatrix{Tv,Ti}
2121
m::Int # Number of rows
2222
n::Int # Number of columns
23-
colptr::Vector{Ti} # Column i is in colptr[i]:(colptr[i+1]-1)
23+
colptr::Vector{Ti} # Column j is in colptr[j]:(colptr[j+1]-1)
2424
rowval::Vector{Ti} # Row indices of stored values
2525
nzval::Vector{Tv} # Stored values, typically nonzeros
2626
end

stdlib/SparseArrays/src/sparsematrix.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ column. In conjunction with [`nonzeros`](@ref) and
176176
rows = rowvals(A)
177177
vals = nonzeros(A)
178178
m, n = size(A)
179-
for i = 1:n
180-
for j in nzrange(A, i)
181-
row = rows[j]
182-
val = vals[j]
179+
for j = 1:n
180+
for i in nzrange(A, j)
181+
row = rows[i]
182+
val = vals[i]
183183
# perform sparse wizardry...
184184
end
185185
end

0 commit comments

Comments
 (0)