ArrayLayouts.jl
ArrayLayouts.jl copied to clipboard
Resolve stack-overflow in Diagonal*Bidiagonal and (Sym)Tridiagonal
Currently, there are method ambiguities on v1.10, because of which these paths were not being tested. These ambiguities are resolved on the currently nightly, which reveals a stack-overflow in these methods. This arises because an operation like
(D::Diagonal{<:Any, <:LayoutVector}) * (B::Bidiagonal{<:Any, <:LayoutVector})
internally calls
copy(M::Lmul{<:DiagonalLayout,<:BidiagonalLayout})
but this method was calling D * B
again, leading to a cycle. To avoid this, we now broadcast D.diag
over the other matrix. The added tests all work on nightly where there are no method ambiguities anymore, and the Bidiagonal
ones work on current versions as well.