LinearAlgebra.jl icon indicating copy to clipboard operation
LinearAlgebra.jl copied to clipboard

in 1.10+, matrix decomposition components aren't always AbstractMatrix and don't behave like them

Open aplavin opened this issue 1 year ago • 15 comments

Tried upgrading Julia version from 1.9 in one of my envs, and noticed this:

julia> using LinearAlgebra

julia> f(a::AbstractMatrix) = sum(a)  # MWE

julia> f(qr(rand(5,5)).Q)
# 1.9:
-1.4572588703587335
# 1.10+:
ERROR: MethodError: no method matching f(::LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}})

qr(A).Q not being an AbstractMatrix is very surprising even in isolation, but especially so given the previous behavior in Julia. How come it's allowed in Julia 1.x? Seems like the clear and unambiguous definition of breaking change... From Julia docs:

However, upgrading to the next Stable release will always be possible as each release of Julia v1.x will continue to run code written for earlier versions.

Introduced in https://github.com/JuliaLang/julia/pull/46196 – deliberately, it wasn't just an oversight.

aplavin avatar Oct 11 '24 11:10 aplavin