Skip to content

Commit

Permalink
Add dispatch routines for ldiv! with transposed LU
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindh-krishnamoorthy committed Sep 12, 2024
1 parent 945517b commit dc5188a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stdlib/LinearAlgebra/src/lu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,14 @@ function ldiv!(adjA::AdjointFactorization{<:Any,<:LU}, B::AbstractVecOrMat)
_apply_inverse_ipiv_rows!(A, B)
end

# To enable rdiv! via ldiv!
ldiv!(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Transpose{T,<:StridedVecOrMat{T}}) where {T<:Union{BlasFloat,BlasComplex}} =
LAPACK.getrs!('T', A.parent.factors, A.parent.ipiv, copy(B))
ldiv!(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Transpose{T,Hermitian{T,<:StridedMatrix}}) where {T<:BlasComplex} =
LAPACK.getrs!('T', A.parent.factors, A.parent.ipiv, Matrix(B))
ldiv!(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Symmetric{T,<:StridedMatrix}) where {T<:BlasFloat} =
LAPACK.getrs!('T', A.parent.factors, A.parent.ipiv, Matrix(B))

(\)(A::AdjointFactorization{T,<:LU{T,<:StridedMatrix}}, B::Adjoint{T,<:StridedVecOrMat{T}}) where {T<:BlasComplex} =
LAPACK.getrs!('C', A.parent.factors, A.parent.ipiv, copy(B))
(\)(A::TransposeFactorization{T,<:LU{T,<:StridedMatrix}}, B::Transpose{T,<:StridedVecOrMat{T}}) where {T<:BlasFloat} =
Expand Down

0 comments on commit dc5188a

Please sign in to comment.