Mercurial > repos > public > sbplib_julia
comparison test/testLazyTensors.jl @ 479:95f3b9036801 feature/compose_identity_mappings
Specialize composition operator for composing a tensormapping with an identitymapping.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 04 Nov 2020 20:03:37 +0100 |
parents | 3f3001d1020f |
children | 4b49f03bdb98 |
comparison
equal
deleted
inserted
replaced
473:3041f8578bba | 479:95f3b9036801 |
---|---|
310 @inferred (I'*v)[3,2] | 310 @inferred (I'*v)[3,2] |
311 @inferred range_size(I) | 311 @inferred range_size(I) |
312 | 312 |
313 @inferred range_dim(I) | 313 @inferred range_dim(I) |
314 @inferred domain_dim(I) | 314 @inferred domain_dim(I) |
315 | |
316 Ã = rand(4,2) | |
317 A = LazyLinearMap(Ã,(1,),(2,)) | |
318 I1 = IdentityMapping{Float64}(2) | |
319 I2 = IdentityMapping{Float64}(4) | |
320 @test A∘I1 == A | |
321 @test I2∘A == A | |
322 @test I1∘I1 == I1 | |
323 @test_throws DimensionMismatch I1∘A | |
324 @test_throws DimensionMismatch A∘I2 | |
325 @test_throws DimensionMismatch I1∘I2 | |
315 end | 326 end |
316 | 327 |
317 @testset "InflatedTensorMapping" begin | 328 @testset "InflatedTensorMapping" begin |
318 I(sz...) = IdentityMapping(sz...) | 329 I(sz...) = IdentityMapping(sz...) |
319 | 330 |