Skip to content

Commit 0d63964

Browse files
committed
test cases fix
1 parent e5b27b1 commit 0d63964

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/multiplication_test.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,30 @@ end
8585
approx = mul!(copy(y), adjH, x, α, β; threads = true, global_index = true)
8686
@test exact approx
8787
end
88-
88+
8989
@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)
9095
exact = mul!(copy(y), H, x, α, β;threads=false)
9196
approx = mul!(copy(y), H, x, α, β,1e-5;threads=false)
9297
@test isapprox(exact,approx;rtol=1.0e-5)
9398

9499
#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+
95104
exact = mul!(copy(y), H, x, α, β)
96105
approx = mul!(copy(y), H, x, α, β,1e-5)
97106
@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)
98112
end
99113

100114
@testset "hermitian" begin

0 commit comments

Comments
 (0)