We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug found by @smataigne:
julia> dot([1], SymTridiagonal([1],Int[]), [1]) ERROR: BoundsError: attempt to access 1-element Vector{Int64} at index [2] Stacktrace: [1] getindex @ ./array.jl:924 [inlined] [2] dot(x::Vector{Int64}, S::SymTridiagonal{Int64, Vector{Int64}}, y::Vector{Int64}) @ LinearAlgebra /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/LinearAlgebra/src/tridiag.jl:265
This line assumes the matrix is at least 2x2: https://github.com/JuliaLang/julia/blob/18fa3835a78bdbe5982daf32b8aa84ab7fd2362e/stdlib/LinearAlgebra/src/tridiag.jl#L266-L267
Recommendation: change this check to:
if nx ≤ 1 nx == 0 && return dot(zero(eltype(x)), zero(eltype(S)), zero(eltype(y))) return dot(x[1], S.dv[1], y[1]) end
(Rationale: the common case is nx > 1, so better to have a single check nx ≤ 1 in that circumstance than separate nx == 0 and nx == 1 checks.)
nx > 1
nx ≤ 1
nx == 0
nx == 1
Just needs someone to create a PR with this text and add a patch.
cc @dkarrasch who added this code in JuliaLang/julia#32739.
The text was updated successfully, but these errors were encountered:
dot
Successfully merging a pull request may close this issue.
Bug found by @smataigne:
This line assumes the matrix is at least 2x2: https://github.com/JuliaLang/julia/blob/18fa3835a78bdbe5982daf32b8aa84ab7fd2362e/stdlib/LinearAlgebra/src/tridiag.jl#L266-L267
Recommendation: change this check to:
(Rationale: the common case is
nx > 1
, so better to have a single checknx ≤ 1
in that circumstance than separatenx == 0
andnx == 1
checks.)Just needs someone to create a PR with this text and add a patch.
cc @dkarrasch who added this code in JuliaLang/julia#32739.
The text was updated successfully, but these errors were encountered: