Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix errant lmul! for tridiagonal and triangular (JuliaLang#55546)
This method is incorrect. Firstly, the current implementation doesn't act in-place. Secondly, the result can't be stored in-place into a triangular matrix in general. This PR changes the implementation to convert the tridiagonal matrix to a `Diagonal` or a `Bidiagonal` one before attempting the `lmul!`. Currently, ```julia julia> T = Tridiagonal([1,2], [1,2,3], [1,2]); U = UpperTriangular(fill(2, 3, 3)); julia> lmul!(T, U) 3×3 Matrix{Int64}: 2 4 4 2 6 10 0 4 10 julia> U # not updated 3×3 UpperTriangular{Int64, Matrix{Int64}}: 2 2 2 ⋅ 2 2 ⋅ ⋅ 2 julia> parent(U) # except for the underlying storage 3×3 Matrix{Int64}: 2 2 2 0 2 2 0 0 2 ``` After this, ```julia julia> lmul!(T, U) ERROR: ArgumentError: matrix cannot be represented as Bidiagonal ``` I'm unsure if we want this method at all, since there isn't a corresponding `rmul!`, but I've left it there to avoid breakages, if any.
- Loading branch information