@@ -17,34 +17,30 @@ function test_left_polar(
1717 )
1818 summary_str = testargs_summary (T, sz)
1919 return @testset " left_polar! algorithm $alg $summary_str " for alg in algs
20- @testset " algorithm $alg " for alg in algs
21- A = instantiate_matrix (T, sz)
22- Ac = deepcopy (A)
23- W, P = left_polar (A; alg)
24- @test eltype (W) == eltype (A) && size (W) == (size (A, 1 ), size (A, 2 ))
25- @test eltype (P) == eltype (A) && size (P) == (size (A, 2 ), size (A, 2 ))
26- @test W * P ≈ A
27- @test isisometric (W)
28- @test ishermitian (P; rtol = MatrixAlgebraKit. defaulttol (P))
29- @test isposdef (project_hermitian! (P))
20+ A = instantiate_matrix (T, sz)
21+ Ac = deepcopy (A)
22+ W, P = left_polar (A; alg)
23+ @test eltype (W) == eltype (A) && size (W) == (size (A, 1 ), size (A, 2 ))
24+ @test eltype (P) == eltype (A) && size (P) == (size (A, 2 ), size (A, 2 ))
25+ @test W * P ≈ A
26+ @test isisometric (W)
27+ @test isposdef (P)
3028
31- W2, P2 = @testinferred left_polar! (Ac, (W, P), alg)
32- @test W2 === W
33- @test P2 === P
34- @test W * P ≈ A
35- @test isisometric (W)
36- @test ishermitian (P; rtol = MatrixAlgebraKit. defaulttol (P))
37- @test isposdef (project_hermitian! (P))
29+ W2, P2 = @testinferred left_polar! (Ac, (W, P), alg)
30+ @test W2 === W
31+ @test P2 === P
32+ @test W * P ≈ A
33+ @test isisometric (W)
34+ @test isposdef (P)
3835
39- noP = similar (P, (0 , 0 ))
40- W2, P2 = @testinferred left_polar! (copy! (Ac, A), (W, noP), alg)
41- @test P2 === noP
42- @test W2 === W
43- @test isisometric (W)
44- P = W' * A # compute P explicitly to verify W correctness
45- @test ishermitian (P; rtol = MatrixAlgebraKit. defaulttol (P))
46- @test isposdef (project_hermitian! (P))
47- end
36+ noP = similar (P, (0 , 0 ))
37+ W2, P2 = @testinferred left_polar! (copy! (Ac, A), (W, noP), alg)
38+ @test P2 === noP
39+ @test W2 === W
40+ @test isisometric (W)
41+ P = W' * A # compute P explicitly to verify W correctness
42+ @test ishermitian (P; rtol = MatrixAlgebraKit. defaulttol (P))
43+ @test isposdef (project_hermitian! (P))
4844 end
4945end
5046
@@ -62,16 +58,14 @@ function test_right_polar(
6258 @test eltype (P) == eltype (A) && size (P) == (size (A, 1 ), size (A, 1 ))
6359 @test P * Wᴴ ≈ A
6460 @test isisometric (Wᴴ; side = :right )
65- @test ishermitian (P; rtol = MatrixAlgebraKit. defaulttol (P))
66- @test isposdef (project_hermitian! (P))
61+ @test isposdef (P)
6762
6863 P2, Wᴴ2 = @testinferred right_polar! (Ac, (P, Wᴴ), alg)
6964 @test P2 === P
7065 @test Wᴴ2 === Wᴴ
7166 @test P * Wᴴ ≈ A
7267 @test isisometric (Wᴴ; side = :right )
73- @test ishermitian (P; rtol = MatrixAlgebraKit. defaulttol (P))
74- @test isposdef (project_hermitian! (P))
68+ @test isposdef (P)
7569
7670 noP = similar (P, (0 , 0 ))
7771 P2, Wᴴ2 = @testinferred right_polar! (copy! (Ac, A), (noP, Wᴴ), alg)
0 commit comments