Mercurial > repos > public > sbplib_julia
view test/LazyTensors/tensor_mapping_test.jl @ 810:a4d7ca5de3c6 refactor/sbp_operators_method_signatures
Review: Suggested changes to volume_operator.jl
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 20 Sep 2021 20:36:20 +0200 |
parents | de2df1214394 |
children | 1ba8a398af9c |
line wrap: on
line source
using Test using Sbplib.LazyTensors @testset "Generic Mapping methods" begin struct DummyMapping{T,R,D} <: TensorMapping{T,R,D} end LazyTensors.apply(m::DummyMapping{T,R,D}, v, I::Vararg{Any,R}) where {T,R,D} = :apply @test range_dim(DummyMapping{Int,2,3}()) == 2 @test domain_dim(DummyMapping{Int,2,3}()) == 3 @test apply(DummyMapping{Int,2,3}(), zeros(Int, (0,0,0)),0,0) == :apply @test eltype(DummyMapping{Int,2,3}()) == Int @test eltype(DummyMapping{Float64,2,3}()) == Float64 end