Skip to content

Commit

Permalink
Merge pull request #356 from SciML/ap/qr_pivoted
Browse files Browse the repository at this point in the history
Fix ambiguity in Pivoted QR
  • Loading branch information
ChrisRackauckas authored Feb 21, 2024
2 parents 87337d8 + 86bb4cd commit 7983b2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RecursiveArrayTools"
uuid = "731186ca-8d62-57ce-b412-fbd966d074cd"
authors = ["Chris Rackauckas <[email protected]>"]
version = "3.8.1"
version = "3.8.2"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
7 changes: 7 additions & 0 deletions src/array_partition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ for factorization in vcat(__get_subtypes_in_module(LinearAlgebra, Factorization;
end
end

function LinearAlgebra.ldiv!(
A::LinearAlgebra.QRPivoted{T, <: StridedMatrix{T}, <: AbstractVector{T}},
b::ArrayPartition{T}) where {T <: Union{Float32, Float64, ComplexF64, ComplexF32}}
x = ldiv!(A, Array(b))
copyto!(b, x)
end

function LinearAlgebra.ldiv!(A::LinearAlgebra.QRCompactWY{T, M, C},
b::ArrayPartition) where {
T <: Union{Float32, Float64, ComplexF64, ComplexF32},
Expand Down
2 changes: 1 addition & 1 deletion test/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for T in (UpperTriangular, UnitUpperTriangular, LowerTriangular, UnitLowerTriang
@test B * Array(bbb) b
end

for ff in (lu, svd, qr)
for ff in (lu, svd, qr, Base.Fix2(qr, ColumnNorm()))
FF = ff(A)
@test A * (FF \ b) b
bbb = copy(b)
Expand Down

0 comments on commit 7983b2b

Please sign in to comment.