Closed
Description
Note that this requires starting julia with --check-bounds=true
since iterate
on Eye
uses @inbounds
.
julia> for v in Eye(6,5)
println(v)
end
1.0
0.0
0.0
0.0
0.0
ERROR: BoundsError: attempt to access 6×5 FillArrays.RectDiagonal{Float64,Ones{Float64,1,Tuple{Base.OneTo{Int64}}},Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}} at index [1, 6]
Stacktrace:
[1] throw_boundserror(::FillArrays.RectDiagonal{Float64,Ones{Float64,1,Tuple{Base.OneTo{Int64}}},Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}}, ::Tuple{Int64,Int64}) at ./abstractarray.jl:538
[2] checkbounds at ./abstractarray.jl:503 [inlined]
[3] getindex at /Users/kristoffer/FillArrays.jl/src/FillArrays.jl:228 [inlined]
[4] iterate(::FillArrays.RectDiagonal{Float64,Ones{Float64,1,Tuple{Base.OneTo{Int64}}},Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}}, ::Tuple{Int64,Int64}) at /Users/kristoffer/FillArrays.jl/src/FillArrays.jl:264
[5] top-level scope at ./REPL[17]:2
This causes the following to fail:
julia> SparseMatrixCSC{Float64,Int}(Eye(6,5))
ERROR: BoundsError: attempt to access 6×5 FillArrays.RectDiagonal{Float64,Ones{Float64,1,Tupl
e{Base.OneTo{Int64}}},Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}} at index [1, 6]
which makes the tests fail on 1.2 after JuliaLang/julia#30617.
Metadata
Metadata
Assignees
Labels
No labels