Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions stdlib/LinearAlgebra/src/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,8 @@ function factorize(A::StridedMatrix{T}) where T
end
qrfact(A, Val(true))
end
factorize(A::Adjoint) = adjoint(factorize(parent(A)))
factorize(A::Transpose) = transpose(factorize(parent(A)))

## Moore-Penrose pseudoinverse

Expand Down
15 changes: 15 additions & 0 deletions stdlib/LinearAlgebra/test/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -847,4 +847,19 @@ end
end
end

@testset "inverse of Adjoint" begin
A = randn(n, n)

@test inv(A')*A' ≈ I
@test inv(transpose(A))*transpose(A) ≈ I

B = complex.(A, randn(n, n))
B = B + transpose(B)

# The following two cases fail because ldiv!(F::Adjoint/Transpose{BunchKaufman},b)
# isn't implemented yet
@test_broken inv(B')*B' ≈ I
@test_broken inv(transpose(B))*transpose(B) ≈ I
end

end # module TestDense