comparison test/testLazyTensors.jl @ 435:1db5ec38955e feature/lazy_identity

Merge in default
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 19 Oct 2020 20:43:59 +0200
parents 648a36ebac99 6737e769a1ca
children 00c317c9ccfb 912ae510dec9
comparison
equal deleted inserted replaced
434:648a36ebac99 435:1db5ec38955e
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 rtol=1e-16 231 @test Ã∘B̃*v ≈ A*B*v rtol=1e-14
232 232
233 v = rand(2) 233 v = rand(2)
234 @test (Ã∘B̃)'*v ≈ B'*A'*v rtol=1e-16 234 @test (Ã∘B̃)'*v ≈ B'*A'*v rtol=1e-14
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.