Skip to content

Commit 02eac88

Browse files
committed
Use isisometric
1 parent fab2af3 commit 02eac88

6 files changed

Lines changed: 85 additions & 85 deletions

File tree

test/amd/orthnull.jl

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ end
6363
@test C isa ROCMatrix{T} && size(C) == (minmn, n)
6464
@test N isa ROCMatrix{T} && size(N) == (m, m - minmn)
6565
@test V * C A
66-
@test isisometry(V)
66+
@test isisometric(V)
6767
@test LinearAlgebra.norm(A' * N) 0 atol = MatrixAlgebraKit.defaulttol(T)
68-
@test isisometry(N)
68+
@test isisometric(N)
6969
hV = collect(V)
7070
hN = collect(N)
7171
@test hV * hV' + hN * hN' I
@@ -83,9 +83,9 @@ end
8383
@test C isa ROCMatrix{T} && size(C) == (minmn, n)
8484
#@test N isa ROCMatrix{T} && size(N) == (m, nullity)
8585
@test V * C A
86-
@test isisometry(V)
86+
@test isisometric(V)
8787
#@test LinearAlgebra.norm(A' * N) ≈ 0 atol = MatrixAlgebraKit.defaulttol(T)
88-
#@test isisometry(N)
88+
#@test isisometric(N)
8989
end
9090

9191
for alg_qr in ((; positive=true), (; positive=false), ROCSOLVER_HouseholderQR())
@@ -95,9 +95,9 @@ end
9595
@test C isa ROCMatrix{T} && size(C) == (minmn, n)
9696
@test N isa ROCMatrix{T} && size(N) == (m, m - minmn)
9797
@test V * C A
98-
@test isisometry(V)
98+
@test isisometric(V)
9999
@test LinearAlgebra.norm(A' * N) 0 atol = MatrixAlgebraKit.defaulttol(T)
100-
@test isisometry(N)
100+
@test isisometric(N)
101101
hV = collect(V)
102102
hN = collect(N)
103103
@test hV * hV' + hN * hN' I
@@ -110,9 +110,9 @@ end
110110
@test C2 === C
111111
@test N2 === N
112112
@test V2 * C2 A
113-
@test isisometry(V2)
113+
@test isisometric(V2)
114114
@test LinearAlgebra.norm(A' * N2) 0 atol = MatrixAlgebraKit.defaulttol(T)
115-
@test isisometry(N2)
115+
@test isisometric(N2)
116116
hV2 = collect(V2)
117117
hN2 = collect(N2)
118118
@test hV2 * hV2' + hN2 * hN2' I
@@ -124,9 +124,9 @@ end
124124
#@test C2 !== C
125125
@test N2 !== C
126126
#@test V2 * C2 ≈ A
127-
#@test isisometry(V2)
127+
#@test isisometric(V2)
128128
@test LinearAlgebra.norm(A' * N2) 0 atol = MatrixAlgebraKit.defaulttol(T)
129-
@test isisometry(N2)
129+
@test isisometric(N2)
130130
#@test V2 * V2' + N2 * N2' ≈ I
131131

132132
rtol = eps(real(T))
@@ -138,9 +138,9 @@ end
138138
#@test C2 !== C
139139
@test N2 !== C
140140
#@test V2 * C2 ≈ A
141-
#@test isisometry(V2)
141+
#@test isisometric(V2)
142142
@test LinearAlgebra.norm(A' * N2) 0 atol = MatrixAlgebraKit.defaulttol(T)
143-
@test isisometry(N2)
143+
@test isisometric(N2)
144144
#@test V2 * V2' + N2 * N2' ≈ I
145145
end
146146

@@ -150,12 +150,12 @@ end
150150
@test V2 === V
151151
@test C2 === C
152152
@test V2 * C2 A
153-
@test isisometry(V2)
153+
@test isisometric(V2)
154154
if kind != :polar
155155
N2 = @constinferred left_null!(copy!(Ac, A), N; kind=kind)
156156
@test N2 === N
157157
@test LinearAlgebra.norm(A' * N2) 0 atol = MatrixAlgebraKit.defaulttol(T)
158-
@test isisometry(N2)
158+
@test isisometric(N2)
159159
hV2 = collect(V2)
160160
hN2 = collect(N2)
161161
@test hV2 * hV2' + hN2 * hN2' I
@@ -173,7 +173,7 @@ end
173173
#@test V2 * C2 ≈ A
174174
#@test V2' * V2 ≈ I
175175
@test LinearAlgebra.norm(A' * N2) 0 atol = MatrixAlgebraKit.defaulttol(T)
176-
@test isisometry(N2)
176+
@test isisometric(N2)
177177
#@test V2 * V2' + N2 * N2' ≈ I
178178

179179
#V2, C2 = @constinferred left_orth!(copy!(Ac, A), (V, C); kind=kind,
@@ -184,9 +184,9 @@ end
184184
#@test C2 !== C
185185
@test N2 !== C
186186
#@test V2 * C2 ≈ A
187-
#@test isisometry(V2)
187+
#@test isisometric(V2)
188188
@test LinearAlgebra.norm(A' * N2) 0 atol = MatrixAlgebraKit.defaulttol(T)
189-
@test isisometry(N2)
189+
@test isisometric(N2)
190190
#@test V2 * V2' + N2 * N2' ≈ I
191191
else
192192
@test_throws ArgumentError left_orth!(copy!(Ac, A), (V, C); kind=kind,
@@ -215,9 +215,9 @@ end
215215
@test Vᴴ isa ROCMatrix{T} && size(Vᴴ) == (minmn, n)
216216
@test Nᴴ isa ROCMatrix{T} && size(Nᴴ) == (n - minmn, n)
217217
@test C * Vᴴ A
218-
@test isisometry(Vᴴ; side=:right)
218+
@test isisometric(Vᴴ; side=:right)
219219
@test LinearAlgebra.norm(A * adjoint(Nᴴ)) 0 atol = MatrixAlgebraKit.defaulttol(T)
220-
@test isisometry(Nᴴ; side=:right)
220+
@test isisometric(Nᴴ; side=:right)
221221
hVᴴ = collect(Vᴴ)
222222
hNᴴ = collect(Nᴴ)
223223
@test hVᴴ' * hVᴴ + hNᴴ' * hNᴴ I
@@ -233,9 +233,9 @@ end
233233
@test Vᴴ2 === Vᴴ
234234
@test Nᴴ2 === Nᴴ
235235
@test C2 * Vᴴ2 A
236-
@test isisometry(Vᴴ2; side=:right)
236+
@test isisometric(Vᴴ2; side=:right)
237237
@test LinearAlgebra.norm(A * adjoint(Nᴴ2)) 0 atol = MatrixAlgebraKit.defaulttol(T)
238-
@test isisometry(Nᴴ; side=:right)
238+
@test isisometric(Nᴴ; side=:right)
239239
hVᴴ2 = collect(Vᴴ2)
240240
hNᴴ2 = collect(Nᴴ2)
241241
@test hVᴴ2' * hVᴴ2 + hNᴴ2' * hNᴴ2 I
@@ -249,9 +249,9 @@ end
249249
@test Vᴴ2 !== Vᴴ
250250
@test Nᴴ2 !== Nᴴ
251251
@test C2 * Vᴴ2 ≈ A
252-
@test isisometry(Vᴴ2; side=:right)
252+
@test isisometric(Vᴴ2; side=:right)
253253
@test LinearAlgebra.norm(A * adjoint(Nᴴ2)) ≈ 0 atol = MatrixAlgebraKit.defaulttol(T)
254-
@test isisometry(Nᴴ; side=:right)
254+
@test isisometric(Nᴴ; side=:right)
255255
@test Vᴴ2' * Vᴴ2 + Nᴴ2' * Nᴴ2 ≈ I
256256
257257
C2, Vᴴ2 = @constinferred right_orth!(copy!(Ac, A), (C, Vᴴ); trunc=(; rtol=rtol))
@@ -260,9 +260,9 @@ end
260260
@test Vᴴ2 !== Vᴴ
261261
@test Nᴴ2 !== Nᴴ
262262
@test C2 * Vᴴ2 ≈ A
263-
@test isisometry(Vᴴ2; side=:right)
263+
@test isisometric(Vᴴ2; side=:right)
264264
@test LinearAlgebra.norm(A * adjoint(Nᴴ2)) ≈ 0 atol = MatrixAlgebraKit.defaulttol(T)
265-
@test isisometry(Nᴴ2; side=:right)
265+
@test isisometric(Nᴴ2; side=:right)
266266
@test Vᴴ2' * Vᴴ2 + Nᴴ2' * Nᴴ2 ≈ I
267267
=#
268268

@@ -273,12 +273,12 @@ end
273273
@test Vᴴ2 === Vᴴ
274274
A2 = C2 * Vᴴ2
275275
@test A2 A
276-
@test isisometry(Vᴴ2; side=:right)
276+
@test isisometric(Vᴴ2; side=:right)
277277
if kind != :polar
278278
Nᴴ2 = @constinferred right_null!(copy!(Ac, A), Nᴴ; kind=kind)
279279
@test Nᴴ2 === Nᴴ
280280
@test LinearAlgebra.norm(A * adjoint(Nᴴ2)) 0 atol = MatrixAlgebraKit.defaulttol(T)
281-
@test isisometry(Nᴴ2; side=:right)
281+
@test isisometric(Nᴴ2; side=:right)
282282
hVᴴ2 = collect(Vᴴ2)
283283
hNᴴ2 = collect(Nᴴ2)
284284
@test hVᴴ2' * hVᴴ2 + hNᴴ2' * hNᴴ2 I
@@ -294,9 +294,9 @@ end
294294
@test Vᴴ2 !== Vᴴ
295295
@test Nᴴ2 !== Nᴴ
296296
@test C2 * Vᴴ2 ≈ A
297-
@test isisometry(Vᴴ2; side=:right)
297+
@test isisometric(Vᴴ2; side=:right)
298298
@test LinearAlgebra.norm(A * adjoint(Nᴴ2)) ≈ 0 atol = MatrixAlgebraKit.defaulttol(T)
299-
@test isisometry(Nᴴ2; side=:right)
299+
@test isisometric(Nᴴ2; side=:right)
300300
@test Vᴴ2' * Vᴴ2 + Nᴴ2' * Nᴴ2 ≈ I
301301
302302
C2, Vᴴ2 = @constinferred right_orth!(copy!(Ac, A), (C, Vᴴ); kind=kind,
@@ -307,9 +307,9 @@ end
307307
@test Vᴴ2 !== Vᴴ
308308
@test Nᴴ2 !== Nᴴ
309309
@test C2 * Vᴴ2 ≈ A
310-
@test isisometry(Vᴴ2; side=:right)
310+
@test isisometric(Vᴴ2; side=:right)
311311
@test LinearAlgebra.norm(A * adjoint(Nᴴ2)) ≈ 0 atol = MatrixAlgebraKit.defaulttol(T)
312-
@test isisometry(Nᴴ2; side=:right)
312+
@test isisometric(Nᴴ2; side=:right)
313313
@test Vᴴ2' * Vᴴ2 + Nᴴ2' * Nᴴ2 ≈ I
314314
=#
315315
else

test/amd/polar.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ using AMDGPU
2020
@test W isa ROCMatrix{T} && size(W) == (m, n)
2121
@test P isa ROCMatrix{T} && size(P) == (n, n)
2222
@test W * P A
23-
@test isisometry(W)
24-
#@test isposdef(P)
23+
@test isisometric(W)
24+
@test isposdef(P)
2525

2626
Ac = similar(A)
2727
W2, P2 = @constinferred left_polar!(copy!(Ac, A), (W, P), alg)
2828
@test W2 === W
2929
@test P2 === P
3030
@test W * P A
31-
@test isisometry(W)
32-
#@test isposdef(P)
31+
@test isisometric(W)
32+
@test isposdef(P)
3333
end
3434
end
3535
end
@@ -48,16 +48,16 @@ end
4848
@test Wᴴ isa ROCMatrix{T} && size(Wᴴ) == (m, n)
4949
@test P isa ROCMatrix{T} && size(P) == (m, m)
5050
@test P * Wᴴ A
51-
@test isisometry(Wᴴ; side=:right)
52-
#@test isposdef(P)
51+
@test isisometric(Wᴴ; side=:right)
52+
@test isposdef(P)
5353

5454
Ac = similar(A)
5555
P2, Wᴴ2 = @constinferred right_polar!(copy!(Ac, A), (P, Wᴴ), alg)
5656
@test P2 === P
5757
@test Wᴴ2 === Wᴴ
5858
@test P * Wᴴ A
59-
@test isisometry(Wᴴ; side=:right)
60-
#@test isposdef(P)
59+
@test isisometric(Wᴴ; side=:right)
60+
@test isposdef(P)
6161
end
6262
end
6363
end

test/amd/projections.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const BLASFloats = (Float32, Float64, ComplexF32, ComplexF64)
1111
m = 54
1212
noisefactor = eps(real(T))^(3 / 4)
1313
for alg in (NativeBlocked(blocksize = 16), NativeBlocked(blocksize = 32), NativeBlocked(blocksize = 64))
14-
A = randn(rng, T, m, m)
14+
A = ROCArray(randn(rng, T, m, m))
1515
Ah = (A + A') / 2
1616
Aa = (A - A') / 2
1717
Ac = copy(A)
@@ -57,21 +57,21 @@ end
5757
end
5858
algs = (PolarViaSVD.(svdalgs)..., PolarNewton())
5959
@testset "algorithm $alg" for alg in algs
60-
A = randn(rng, T, m, n)
60+
A = ROCArray(randn(rng, T, m, n))
6161
W = project_isometric(A, alg)
62-
@test isisometry(W)
62+
@test isisometric(W)
6363
W2 = project_isometric(W, alg)
6464
@test W2 W # stability of the projection
6565
@test W * (W' * A) A
6666

6767
Ac = similar(A)
6868
W2 = @constinferred project_isometric!(copy!(Ac, A), W, alg)
6969
@test W2 === W
70-
@test isisometry(W)
70+
@test isisometric(W)
7171

7272
# test that W is closer to A then any other isometry
7373
for k in 1:10
74-
δA = randn(rng, T, m, n)
74+
δA = ROCArray(randn(rng, T, m, n))
7575
W = project_isometric(A, alg)
7676
W2 = project_isometric(A + δA / 100, alg)
7777
@test norm(A - W2) > norm(A - W)

0 commit comments

Comments
 (0)