comparison test/LazyTensors/lazy_tensor_operations_test.jl @ 1299:4c0bc52e170f bugfix/lazytensors

Change to approximate equality in test using floats
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 04 Apr 2023 21:46:06 +0200
parents c94a12327737
children fddd3a906535
comparison
equal deleted inserted replaced
1298:aa8579b7fc15 1299:4c0bc52e170f
186 v = rand(3) 186 v = rand(3)
187 @test a*Ã isa TensorComposition 187 @test a*Ã isa TensorComposition
188 @test a*Ã == Ã*a 188 @test a*Ã == Ã*a
189 @test range_size(a*Ã) == range_size(Ã) 189 @test range_size(a*Ã) == range_size(Ã)
190 @test domain_size(a*Ã) == domain_size(Ã) 190 @test domain_size(a*Ã) == domain_size(Ã)
191 @test a*Ã*v == a.*A*v 191 @test a*Ã*v ≈ a.*A*v rtol=1e-14
192 end 192 end
193 193
194 194
195 @testset "InflatedTensor" begin 195 @testset "InflatedTensor" begin
196 I(sz...) = IdentityTensor(sz...) 196 I(sz...) = IdentityTensor(sz...)