comparison test/testLazyTensors.jl @ 424:98ba9b7effd3 feature/tensor_composition

Be more explicit about allowed error in isapprox, and set it way lower.
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 19 Oct 2020 08:58:26 +0200
parents 4c6604b7d990
children 6737e769a1ca 7327a3e41df0
comparison
equal deleted inserted replaced
419:2958b4ebd565 424:98ba9b7effd3
226 @test_throws DimensionMismatch B̃∘Ã 226 @test_throws DimensionMismatch B̃∘Ã
227 227
228 # @test @inbounds B̃∘Ã # Should not error even though dimensions don't match. (Since ]test runs with forced boundschecking this is currently not testable 2020-10-16) 228 # @test @inbounds B̃∘Ã # Should not error even though dimensions don't match. (Since ]test runs with forced boundschecking this is currently not testable 2020-10-16)
229 229
230 v = rand(4) 230 v = rand(4)
231 @test Ã∘B̃*v ≈ A*B*v 231 @test Ã∘B̃*v ≈ A*B*v rtol=1e-16
232 232
233 v = rand(2) 233 v = rand(2)
234 @test (Ã∘B̃)'*v ≈ B'*A'*v 234 @test (Ã∘B̃)'*v ≈ B'*A'*v rtol=1e-16
235 end 235 end
236 236
237 @testset "LazyLinearMap" begin 237 @testset "LazyLinearMap" begin
238 # Test a standard matrix-vector product 238 # Test a standard matrix-vector product
239 # mapping vectors of size 4 to vectors of size 3. 239 # mapping vectors of size 4 to vectors of size 3.