Add a UpperHessenberg row in LinearAlgebra.factorize?

There is a specialized, fast ldiv!(::UpperHessenberg, _) method, but the dispatch isn’t set up such that you hit a fast path for \(::UpperHessenberg, _). The latter falls back to the generic \, which sends you through an LU factorization.

julia> @which UpperHessenberg([1.0 2.0; 3.0 4.0]) \ [5.0; 6.0]
\(A::AbstractMatrix, B::AbstractVecOrMat)
     @ LinearAlgebra ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/generic.jl:1118

=> LinearAlgebra.jl/src/generic.jl at release-1.11 · JuliaLang/LinearAlgebra.jl · GitHub

Seems like the implementation is focused on making Hessenberg factorization objects performant, rather than raw UpperHessenberg instances.

1 Like