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

Slightly confusing error message when trying to set values out-off-bands #226

Open
jagot opened this issue Feb 23, 2021 · 1 comment
Open

Comments

@jagot
Copy link
Contributor

jagot commented Feb 23, 2021

julia> using BandedMatrices, FillArrays

julia> A = BandedMatrix(Zeros(243,241), (4,4));

julia> A[168,163] = 1
ERROR: attempt to access Matrix{Float64} with bandwidths (8, 240) at band -5
Stacktrace:
 [1] banded_setindex!
   @ ~/.julia/packages/BandedMatrices/ky92P/src/banded/BandedMatrix.jl:428 [inlined]
 [2] setindex!(A::BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}, v::Int64, k::Int64, j::Int64)
   @ BandedMatrices ~/.julia/packages/BandedMatrices/ky92P/src/banded/BandedMatrix.jl:437
 [3] top-level scope
   @ REPL[9]:1

Band -5 is correct, but I found it confusing that the underlying storage matrix is referenced in the error message, with bandwidths that don't match those of A.

@dlfivefifty
Copy link
Member

Agreed, this was a poor design made ages ago that I never got around to fixing

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

2 participants