comparison test/testLazyTensors.jl @ 491:2dc2eac27f75 feature/outer_product

Add special methods for Identity mappings
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 05 Nov 2020 12:48:30 +0100
parents 79a88269d7d0
children 5a600ec40ccc
comparison
equal deleted inserted replaced
477:79a88269d7d0 491:2dc2eac27f75
445 445
446 B̃Ã = LazyOuterProduct(B̃,Ã) 446 B̃Ã = LazyOuterProduct(B̃,Ã)
447 @tullio BAv[k,i] := A[i,j]*B[k,l,m]*v₂[l,m,j] 447 @tullio BAv[k,i] := A[i,j]*B[k,l,m]*v₂[l,m,j]
448 @test B̃Ã*v₂ ≈ BAv 448 @test B̃Ã*v₂ ≈ BAv
449 449
450 end 450 @testset "Indentity mapping arguments" begin
451 451 @test LazyOuterProduct(IdentityMapping(3,2), IdentityMapping(1,2)) == IdentityMapping(3,2,1,2)
452 end 452
453 Ã = LazyLinearMap(A,(1,),(2,))
454 @test LazyOuterProduct(IdentityMapping(3,2), Ã) == InflatedTensorMapping(IdentityMapping(3,2),Ã)
455 @test LazyOuterProduct(Ã, IdentityMapping(3,2)) == InflatedTensorMapping(Ã,IdentityMapping(3,2))
456 end
457
458 end
459
460 end