Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1149:5ddf5ae48391 refactor/sbpoperators/inflation
Merge default
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 18 Oct 2022 20:27:31 +0200 |
| parents | dfbd62c7eb09 |
| children | 5f677cd6f0b6 |
comparison
equal
deleted
inserted
replaced
| 1124:f5d381e66346 | 1149:5ddf5ae48391 |
|---|---|
| 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 |
