Mercurial > repos > public > sbplib_julia
comparison test/Grids/grid_test.jl @ 1276:75a65db29be1 refactor/grids
Minor clean up
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 26 Feb 2023 17:09:35 +0100 |
parents | dcd8654ca33b |
children | 1157f889bf50 |
comparison
equal
deleted
inserted
replaced
1275:dcd8654ca33b | 1276:75a65db29be1 |
---|---|
24 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) isa LazyArray | 24 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) isa LazyArray |
25 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) == 2 .* range(0,1,length=4) | 25 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) == 2 .* range(0,1,length=4) |
26 | 26 |
27 | 27 |
28 g = equidistant_grid((5,3), (0.0,0.0), (2.0,1.0)) | 28 g = equidistant_grid((5,3), (0.0,0.0), (2.0,1.0)) |
29 | |
30 | |
31 # Splat for only one dim, controllef by type specification in function. | |
32 | 29 |
33 @test eval_on(g, x̄ -> 0.) isa LazyArray | 30 @test eval_on(g, x̄ -> 0.) isa LazyArray |
34 @test eval_on(g, x̄ -> 0.) == fill(0., (5,3)) | 31 @test eval_on(g, x̄ -> 0.) == fill(0., (5,3)) |
35 | 32 |
36 @test eval_on(g, x̄ -> sin(x̄[1])*cos(x̄[2])) == map(x̄->sin(x̄[1])*cos(x̄[2]), g) | 33 @test eval_on(g, x̄ -> sin(x̄[1])*cos(x̄[2])) == map(x̄->sin(x̄[1])*cos(x̄[2]), g) |