Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iteration of Eye seems wrong #65

Closed
KristofferC opened this issue May 16, 2019 · 3 comments
Closed

Iteration of Eye seems wrong #65

KristofferC opened this issue May 16, 2019 · 3 comments

Comments

@KristofferC
Copy link

KristofferC commented May 16, 2019

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.

@dlfivefifty
Copy link
Member

@jlapeyre It looks like this was your code in

d87736e

Are you able to fix it?

@dlfivefifty
Copy link
Member

I've commented that implementation of iterate out that fixes the issue.

@jlapeyre
Copy link
Contributor

Thanks. Sorry for the delay. I just moved and started a new job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants