Mercurial > repos > public > sbplib_julia
comparison test/testLazyTensors.jl @ 417:4c6604b7d990 feature/tensor_composition
Add dimension checking in the constructor
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 16 Oct 2020 20:32:09 +0200 |
parents | ebc9b2383dae |
children | 98ba9b7effd3 |
comparison
equal
deleted
inserted
replaced
416:ebc9b2383dae | 417:4c6604b7d990 |
---|---|
221 B̃ = LazyLinearMap(B, (1,), (2,)) | 221 B̃ = LazyLinearMap(B, (1,), (2,)) |
222 | 222 |
223 @test Ã∘B̃ isa TensorMappingComposition | 223 @test Ã∘B̃ isa TensorMappingComposition |
224 @test range_size(Ã∘B̃) == (2,) | 224 @test range_size(Ã∘B̃) == (2,) |
225 @test domain_size(Ã∘B̃) == (4,) | 225 @test domain_size(Ã∘B̃) == (4,) |
226 # @test_throws DimensionMismatch B̃∘Ã | 226 @test_throws DimensionMismatch B̃∘Ã |
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) | |
227 | 229 |
228 v = rand(4) | 230 v = rand(4) |
229 @test Ã∘B̃*v ≈ A*B*v | 231 @test Ã∘B̃*v ≈ A*B*v |
230 | 232 |
231 v = rand(2) | 233 v = rand(2) |