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

Resolve stack-overflow in Diagonal*Bidiagonal and (Sym)Tridiagonal

Open jishnub opened this issue 7 months ago • 1 comments

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.

jishnub avatar Jul 06 '24 06:07 jishnub