Mercurial > repos > public > sbplib_julia
comparison test/testLazyTensors.jl @ 442:e70e47fbfa7c feature/lazy_identity
Add another convenience constructor
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 19 Oct 2020 21:41:34 +0200 |
parents | 552189707fbe |
children | ac6d22570a08 |
comparison
equal
deleted
inserted
replaced
441:552189707fbe | 442:e70e47fbfa7c |
---|---|
285 @testset "IdentityMapping" begin | 285 @testset "IdentityMapping" begin |
286 @test IdentityMapping{Float64}((4,5)) isa IdentityMapping{T,2} where T | 286 @test IdentityMapping{Float64}((4,5)) isa IdentityMapping{T,2} where T |
287 @test IdentityMapping{Float64}((4,5)) isa TensorMapping{T,2,2} where T | 287 @test IdentityMapping{Float64}((4,5)) isa TensorMapping{T,2,2} where T |
288 @test IdentityMapping{Float64}((4,5)) == IdentityMapping{Float64}(4,5) | 288 @test IdentityMapping{Float64}((4,5)) == IdentityMapping{Float64}(4,5) |
289 | 289 |
290 @test IdentityMapping(3,2) isa IdentityMapping{Float64,2} | |
291 | |
290 for sz ∈ [(4,5),(3,),(5,6,4)] | 292 for sz ∈ [(4,5),(3,),(5,6,4)] |
291 I = IdentityMapping{Float64}(sz) | 293 I = IdentityMapping{Float64}(sz) |
292 v = rand(sz...) | 294 v = rand(sz...) |
293 @test I*v == v | 295 @test I*v == v |
294 @test I'*v == v | 296 @test I'*v == v |