Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/stencil_test.jl @ 875:067a322e4f73 laplace_benchmarks
Merge with feature/laplace_opset
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 27 Jan 2022 10:55:08 +0100 |
parents | 4433be383840 |
children | 313648b01504 11767fbb29f4 |
comparison
equal
deleted
inserted
replaced
874:7e9ebd572deb | 875:067a322e4f73 |
---|---|
13 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4)) | 13 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4)) |
14 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4)) | 14 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4)) |
15 | 15 |
16 @test CenteredStencil(1,2,3,4,5) == Stencil((-2, 2), (1,2,3,4,5)) | 16 @test CenteredStencil(1,2,3,4,5) == Stencil((-2, 2), (1,2,3,4,5)) |
17 @test_throws ArgumentError CenteredStencil(1,2,3,4) | 17 @test_throws ArgumentError CenteredStencil(1,2,3,4) |
18 | |
19 # Changing the type of the weights | |
20 @test Stencil{Float64}(Stencil(1,2,3,4,5; center=2)) == Stencil(1.,2.,3.,4.,5.; center=2) | |
21 @test Stencil{Float64}(CenteredStencil(1,2,3,4,5)) == CenteredStencil(1.,2.,3.,4.,5.) | |
22 @test Stencil{Int}(Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1,2,3,4,5; center=2) | |
23 @test Stencil{Rational}(Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1//1,2//1,3//1,4//1,5//1; center=2) | |
24 | |
25 @testset "convert" begin | |
26 @test convert(Stencil{Float64}, Stencil(1,2,3,4,5; center=2)) == Stencil(1.,2.,3.,4.,5.; center=2) | |
27 @test convert(Stencil{Float64}, CenteredStencil(1,2,3,4,5)) == CenteredStencil(1.,2.,3.,4.,5.) | |
28 @test convert(Stencil{Int}, Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1,2,3,4,5; center=2) | |
29 @test convert(Stencil{Rational}, Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1//1,2//1,3//1,4//1,5//1; center=2) | |
30 end | |
18 end | 31 end |