Skip to content

Commit b4a3d2d

Browse files
committed
Define factorize(Adjoint) to make e.g. inv(Adjoint) work (in most cases)
1 parent be4e39f commit b4a3d2d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

stdlib/LinearAlgebra/src/dense.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,7 @@ function factorize(A::StridedMatrix{T}) where T
12221222
end
12231223
qrfact(A, Val(true))
12241224
end
1225+
factorize(A::Adjoint) = adjoint(factorize(parent(A)))
12251226

12261227
## Moore-Penrose pseudoinverse
12271228

stdlib/LinearAlgebra/test/dense.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,4 +847,13 @@ end
847847
end
848848
end
849849

850+
@testset "inverse of Adjoint" begin
851+
n = 5
852+
A = randn(n, n)
853+
@test inv(A')*A' I
854+
B = complex.(A, randn(n, n))
855+
B = B + transpose(B)
856+
@test_broken inv(B')*B' I
857+
end
858+
850859
end # module TestDense

0 commit comments

Comments
 (0)