@@ -2,28 +2,28 @@ using TestExtras
22using GenericLinearAlgebra
33using LinearAlgebra: opnorm
44
5- function test_svd (T:: Type , sz; kwargs... )
5+ function test_svd (T:: Type , sz; test_compact :: Bool = true , test_full :: Bool = true , test_trunc :: Bool = true , kwargs... )
66 summary_str = testargs_summary (T, sz)
77 return @testset " svd $summary_str " begin
8- test_svd_compact (T, sz; kwargs... )
9- test_svd_full (T, sz; kwargs... )
10- test_svd_trunc (T, sz; kwargs... )
8+ test_compact && test_svd_compact (T, sz; kwargs... )
9+ test_full && test_svd_full (T, sz; kwargs... )
10+ test_trunc && test_svd_trunc (T, sz; kwargs... )
1111 end
1212end
1313
14- function test_svd_algs (T:: Type , sz, algs; kwargs... )
14+ function test_svd_algs (T:: Type , sz, algs; test_compact :: Bool = true , test_full :: Bool = true , test_trunc :: Bool = true , kwargs... )
1515 summary_str = testargs_summary (T, sz)
1616 return @testset " svd algorithms $summary_str " begin
17- test_svd_compact_algs (T, sz, algs; kwargs... )
18- test_svd_full_algs (T, sz, algs; kwargs... )
19- test_svd_trunc_algs (T, sz, algs; kwargs... )
17+ test_compact && test_svd_compact_algs (T, sz, algs; kwargs... )
18+ test_full && test_svd_full_algs (T, sz, algs; kwargs... )
19+ test_trunc && test_svd_trunc_algs (T, sz, algs; kwargs... )
2020 end
2121end
2222
2323function test_svd_compact (
2424 T:: Type , sz;
2525 atol:: Real = 0 , rtol:: Real = precision (eltype (T)),
26- kwargs...
26+ test_vals :: Bool = true , kwargs...
2727 )
2828 summary_str = testargs_summary (T, sz)
2929 return @testset " svd_compact! $summary_str " begin
@@ -47,15 +47,17 @@ function test_svd_compact(
4747 @test isisometric (V2ᴴ; side = :right )
4848 @test isposdef (S2)
4949
50- Sd = @testinferred svd_vals (A)
51- @test S ≈ Diagonal (Sd)
50+ if test_vals
51+ Sd = @testinferred svd_vals (A)
52+ @test S ≈ Diagonal (Sd)
53+ end
5254 end
5355end
5456
5557function test_svd_compact_algs (
5658 T:: Type , sz, algs;
5759 atol:: Real = 0 , rtol:: Real = precision (eltype (T)),
58- kwargs...
60+ test_vals :: Bool = true , kwargs...
5961 )
6062 summary_str = testargs_summary (T, sz)
6163 return @testset " svd_compact! algorithm $alg $summary_str " for alg in algs
@@ -78,8 +80,10 @@ function test_svd_compact_algs(
7880 @test isisometric (V2ᴴ; side = :right )
7981 @test isposdef (S2)
8082
81- Sd = @testinferred svd_vals (A; alg)
82- @test S ≈ Diagonal (Sd)
83+ if test_vals
84+ Sd = @testinferred svd_vals (A; alg)
85+ @test S ≈ Diagonal (Sd)
86+ end
8387 end
8488end
8589
@@ -123,7 +127,6 @@ function test_svd_full_algs(
123127 )
124128 summary_str = testargs_summary (T, sz)
125129 return @testset " svd_full! algorithm $alg $summary_str " for alg in algs
126- isa (alg, LAPACK_Jacobi) && continue
127130 A = instantiate_matrix (T, sz)
128131 Ac = deepcopy (A)
129132 m, n = size (A)
0 commit comments