From 2ef056a139d5fdc9d3a9aa9e5051a0127c9bdf7a Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Tue, 5 Dec 2023 16:39:51 +0100 Subject: [PATCH] Simplify triangular multiplication code slightly (#52393) --- stdlib/LinearAlgebra/src/triangular.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/LinearAlgebra/src/triangular.jl b/stdlib/LinearAlgebra/src/triangular.jl index 9252350336b02..6d703b2436b23 100644 --- a/stdlib/LinearAlgebra/src/triangular.jl +++ b/stdlib/LinearAlgebra/src/triangular.jl @@ -703,9 +703,9 @@ mul!(C::AbstractMatrix, A::AbstractTriangular, B::AbstractTriangular) = _trimul! _trimul!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVector) = lmul!(A, copyto!(C, B)) _trimul!(C::AbstractMatrix, A::AbstractTriangular, B::AbstractMatrix) = - lmul!(A, inplace_adj_or_trans(B)(C, _unwrap_at(B))) + lmul!(A, copyto!(C, B)) _trimul!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractTriangular) = - rmul!(inplace_adj_or_trans(A)(C, _unwrap_at(A)), B) + rmul!(copyto!(C, A), B) _trimul!(C::AbstractMatrix, A::AbstractTriangular, B::AbstractTriangular) = lmul!(A, copyto!(C, B)) # redirect for UpperOrLowerTriangular @@ -752,9 +752,9 @@ end ldiv!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVecOrMat) = _ldiv!(C, A, B) # generic fallback for AbstractTriangular, directs to 2-arg [l/r]div! _ldiv!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVecOrMat) = - ldiv!(A, inplace_adj_or_trans(B)(C, _unwrap_at(B))) + ldiv!(A, copyto!(C, B)) _rdiv!(C::AbstractMatrix, A::AbstractMatrix, B::AbstractTriangular) = - rdiv!(inplace_adj_or_trans(A)(C, _unwrap_at(A)), B) + rdiv!(copyto!(C, A), B) # redirect for UpperOrLowerTriangular to generic_*div! _ldiv!(C::AbstractVecOrMat, A::UpperOrLowerTriangular, B::AbstractVecOrMat) = generic_trimatdiv!(C, uplo_char(A), isunit_char(A), wrapperop(parent(A)), _unwrap_at(parent(A)), B)