@@ -14,11 +14,11 @@ using LinearAlgebra: diag, I
1414 @test L isa Matrix{T} && size (L) == (m, minmn)
1515 @test Q isa Matrix{T} && size (Q) == (minmn, n)
1616 @test L * Q ≈ A
17- @test Q * Q ' ≈ I
17+ @test isisometry (Q; side = :right )
1818 Nᴴ = @constinferred lq_null (A)
1919 @test Nᴴ isa Matrix{T} && size (Nᴴ) == (n - minmn, n)
2020 @test maximum (abs, A * Nᴴ' ) < eps (real (T))^ (2 / 3 )
21- @test Nᴴ * Nᴴ ' ≈ I
21+ @test isisometry (Nᴴ; side = :right )
2222
2323 Ac = similar (A)
2424 L2, Q2 = @constinferred lq_compact! (copy! (Ac, A), (L, Q))
@@ -35,12 +35,12 @@ using LinearAlgebra: diag, I
3535 # unblocked algorithm
3636 lq_compact! (copy! (Ac, A), (L, Q); blocksize= 1 )
3737 @test L * Q ≈ A
38- @test Q * Q ' ≈ I
38+ @test isisometry (Q; side = :right )
3939 lq_compact! (copy! (Ac, A), (noL, Q2); blocksize= 1 )
4040 @test Q == Q2
4141 lq_null! (copy! (Ac, A), Nᴴ; blocksize= 1 )
4242 @test maximum (abs, A * Nᴴ' ) < eps (real (T))^ (2 / 3 )
43- @test Nᴴ * Nᴴ ' ≈ I
43+ @test isisometry (Nᴴ; side = :right )
4444 if m <= n
4545 lq_compact! (copy! (Q2, A), (noL, Q2); blocksize= 1 ) # in-place Q
4646 @test Q ≈ Q2
@@ -50,25 +50,25 @@ using LinearAlgebra: diag, I
5050 end
5151 lq_compact! (copy! (Ac, A), (L, Q); blocksize= 8 )
5252 @test L * Q ≈ A
53- @test Q * Q ' ≈ I
53+ @test isisometry (Q; side = :right )
5454 lq_compact! (copy! (Ac, A), (noL, Q2); blocksize= 8 )
5555 @test Q == Q2
5656 lq_null! (copy! (Ac, A), Nᴴ; blocksize= 8 )
5757 @test maximum (abs, A * Nᴴ' ) < eps (real (T))^ (2 / 3 )
58- @test Nᴴ * Nᴴ ' ≈ I
58+ @test isisometry (Nᴴ; side = :right )
5959 # pivoted
6060 @test_throws ArgumentError lq_compact! (copy! (Ac, A), (L, Q); pivoted= true )
6161 # positive
6262 lq_compact! (copy! (Ac, A), (L, Q); positive= true )
6363 @test L * Q ≈ A
64- @test Q * Q ' ≈ I
64+ @test isisometry (Q; side = :right )
6565 @test all (>= (zero (real (T))), real (diag (L)))
6666 lq_compact! (copy! (Ac, A), (noL, Q2); positive= true )
6767 @test Q == Q2
6868 # positive and blocksize 1
6969 lq_compact! (copy! (Ac, A), (L, Q); positive= true , blocksize= 1 )
7070 @test L * Q ≈ A
71- @test Q * Q ' ≈ I
71+ @test isisometry (Q; side = :right )
7272 @test all (>= (zero (real (T))), real (diag (L)))
7373 lq_compact! (copy! (Ac, A), (noL, Q2); positive= true , blocksize= 1 )
7474 @test Q == Q2
8585 @test L isa Matrix{T} && size (L) == (m, n)
8686 @test Q isa Matrix{T} && size (Q) == (n, n)
8787 @test L * Q ≈ A
88- @test Q * Q ' ≈ I
88+ @test isunitary (Q)
8989
9090 Ac = similar (A)
9191 L2, Q2 = @constinferred lq_full! (copy! (Ac, A), (L, Q))
9292 @test L2 === L
9393 @test Q2 === Q
9494 @test L * Q ≈ A
95- @test Q * Q ' ≈ I
95+ @test isunitary (Q)
9696
9797 noL = similar (A, 0 , n)
9898 Q2 = similar (Q)
102102 # unblocked algorithm
103103 lq_full! (copy! (Ac, A), (L, Q); blocksize= 1 )
104104 @test L * Q ≈ A
105- @test Q * Q ' ≈ I
105+ @test isunitary (Q)
106106 lq_full! (copy! (Ac, A), (noL, Q2); blocksize= 1 )
107107 @test Q == Q2
108108 if n == m
@@ -112,22 +112,22 @@ end
112112 # # other blocking
113113 lq_full! (copy! (Ac, A), (L, Q); blocksize= 18 )
114114 @test L * Q ≈ A
115- @test Q * Q ' ≈ I
115+ @test isunitary (Q)
116116 lq_full! (copy! (Ac, A), (noL, Q2); blocksize= 18 )
117117 @test Q == Q2
118118 # pivoted
119119 @test_throws ArgumentError lq_full! (copy! (Ac, A), (L, Q); pivoted= true )
120120 # positive
121121 lq_full! (copy! (Ac, A), (L, Q); positive= true )
122122 @test L * Q ≈ A
123- @test Q * Q ' ≈ I
123+ @test isunitary (Q)
124124 @test all (>= (zero (real (T))), real (diag (L)))
125125 lq_full! (copy! (Ac, A), (noL, Q2); positive= true )
126126 @test Q == Q2
127127 # positive and blocksize 1
128128 lq_full! (copy! (Ac, A), (L, Q); positive= true , blocksize= 1 )
129129 @test L * Q ≈ A
130- @test Q * Q ' ≈ I
130+ @test isunitary (Q)
131131 @test all (>= (zero (real (T))), real (diag (L)))
132132 lq_full! (copy! (Ac, A), (noL, Q2); positive= true , blocksize= 1 )
133133 @test Q == Q2
0 commit comments