Skip to content

Commit 3ab784c

Browse files
authored
fix error message in sparse_check (#681)
There was a typo in `sparse_check`, that didn't affect the checking but led to a nonsensical error message: ```julia julia> sparse_check(2, [2,1,2], [1], [2]) ERROR: ArgumentError: 1 == colptr[1] != 1 ``` With the PR we get: ```julia julia> sparse_check(2, [2,1,2], [1], [2]) ERROR: ArgumentError: 2 == colptr[1] != 1 ```
1 parent 5e306ed commit 3ab784c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/sparsematrix.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ function sparse_check(n::Integer, colptr::Vector{Ti}, rowval, nzval) where Ti
143143
throwmonotonic(ckp, ck, k) = throw(ArgumentError("$ckp == colptr[$(k-1)] > colptr[$k] == $ck"))
144144

145145
sparse_check_length("colptr", colptr, n+1, String) # don't check upper bound
146-
ckp = Ti(1)
147-
ckp == colptr[1] || throwstart(ckp)
146+
ckp = colptr[1]
147+
ckp == Ti(1) || throwstart(ckp)
148148
@inbounds for k = 2:n+1
149149
ck = colptr[k]
150150
ckp <= ck || throwmonotonic(ckp, ck, k)

0 commit comments

Comments
 (0)