|
85 | 85 | approx = mul!(copy(y), adjH, x, α, β; threads = true, global_index = true) |
86 | 86 | @test exact ≈ approx |
87 | 87 | end |
88 | | - |
| 88 | + |
89 | 89 | @testset "exact vs inexact HMatrix-vector products" begin |
| 90 | + #tests with and tiwhout global indexes |
| 91 | + |
| 92 | + exact = mul!(copy(y), H, x, α, β; threads = false, global_index = false) |
| 93 | + approx= mul!(copy(y), H, x, α, β,1.0e-5; threads = false, global_index = false) |
| 94 | + @test isapprox(exact,approx;rtol=1.0e-5) |
90 | 95 | exact = mul!(copy(y), H, x, α, β;threads=false) |
91 | 96 | approx = mul!(copy(y), H, x, α, β,1e-5;threads=false) |
92 | 97 | @test isapprox(exact,approx;rtol=1.0e-5) |
93 | 98 |
|
94 | 99 | #no mentinon to threads, so it's on by default |
| 100 | + exact = mul!(copy(y), H, x, α, β; global_index = false) |
| 101 | + approx= mul!(copy(y), H, x, α, β,1.0e-5; global_index = false) |
| 102 | + @test isapprox(exact,approx;rtol=1.0e-5) |
| 103 | + |
95 | 104 | exact = mul!(copy(y), H, x, α, β) |
96 | 105 | approx = mul!(copy(y), H, x, α, β,1e-5) |
97 | 106 | @test isapprox(exact,approx;rtol=1.0e-5) |
| 107 | + |
| 108 | + #last test checks that if the desired tolerance is to small, we'll use the full low rank matrix instead |
| 109 | + exact = mul!(copy(y), H, x, α, β) |
| 110 | + approx = mul!(copy(y), H, x, α, β,0.0) |
| 111 | + @test isapprox(exact,approx;rtol=1.0e-5) |
98 | 112 | end |
99 | 113 |
|
100 | 114 | @testset "hermitian" begin |
|
0 commit comments