Skip to content

Commit 47c7506

Browse files
Add dispatch routines for ldiv! with transposed LU
1 parent 945517b commit 47c7506

File tree

1 file changed

+8
-0
lines changed
  • stdlib/LinearAlgebra/src

1 file changed

+8
-0
lines changed

stdlib/LinearAlgebra/src/lu.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,14 @@ function ldiv!(adjA::AdjointFactorization{<:Any,<:LU}, B::AbstractVecOrMat)
521521
_apply_inverse_ipiv_rows!(A, B)
522522
end
523523

524+
# To enable rdiv! via ldiv!
525+
ldiv!(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Transpose{T,<:StridedVecOrMat{T}}) where {T<:Union{BlasFloat,BlasComplex}} =
526+
LAPACK.getrs!('T', A.parent.factors, A.parent.ipiv, copy(B))
527+
ldiv!(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Transpose{T,<:Hermitian{T,<:StridedMatrix}}) where {T<:BlasComplex} =
528+
LAPACK.getrs!('T', A.parent.factors, A.parent.ipiv, Matrix(B))
529+
ldiv!(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Symmetric{T,<:StridedMatrix}) where {T<:BlasFloat} =
530+
LAPACK.getrs!('T', A.parent.factors, A.parent.ipiv, Matrix(B))
531+
524532
(\)(A::AdjointFactorization{T,<:LU{T,<:StridedMatrix}}, B::Adjoint{T,<:StridedVecOrMat{T}}) where {T<:BlasComplex} =
525533
LAPACK.getrs!('C', A.parent.factors, A.parent.ipiv, copy(B))
526534
(\)(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Transpose{T,<:StridedVecOrMat{T}}) where {T<:BlasFloat} =

0 commit comments

Comments
 (0)