comparison src/Grids/grid.jl @ 1888:eb70a0941cd6 allocation_testing

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 03 Feb 2023 23:02:46 +0100
parents dfbd62c7eb09
children 5f677cd6f0b6
comparison
equal deleted inserted replaced
1887:24590890e124 1888:eb70a0941cd6
1 """
2 Grid
3
4 Should implement
5 Base.ndims(grid::Grid)
6 points(grid::Grid)
7
8 """
9 abstract type Grid end
10 function points end
11
12 """
13 dims(grid::Grid)
14
15 A range containing the dimensions of `grid`
16 """
17 dims(grid::Grid) = 1:ndims(grid)
18
19 """
20 evalOn(grid::Grid, f::Function)
21
22 Evaluate function `f` on `grid`
23 """
24 function evalOn(grid::Grid, f::Function)
25 F(x) = f(x...)
26 return F.(points(grid))
27 end