Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1117:aeeffca46b94 feature/grids
Minor renamings
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 15 Jul 2022 09:56:25 +0200 |
parents | c2d7e940639e |
children | dfbd62c7eb09 |
comparison
equal
deleted
inserted
replaced
1116:c2d7e940639e | 1117:aeeffca46b94 |
---|---|
9 abstract type Grid end | 9 abstract type Grid end |
10 function dim end # TODO: Rename to Base.ndims instead? That's the name used for arrays. | 10 function dim end # TODO: Rename to Base.ndims instead? That's the name used for arrays. |
11 function points end | 11 function points end |
12 | 12 |
13 """ | 13 """ |
14 dims(g::Grid) | 14 dims(grid::Grid) |
15 | 15 |
16 A range containing the dimensions of the grid | 16 A range containing the dimensions of `grid` |
17 """ | 17 """ |
18 dims(grid::Grid) = 1:dim(grid) | 18 dims(grid::Grid) = 1:dim(grid) |
19 | 19 |
20 """ | 20 """ |
21 evalOn(g::Grid, f::Function) | 21 evalOn(grid::Grid, f::Function) |
22 | 22 |
23 Evaluate function f on the grid g | 23 Evaluate function `f` on `grid` |
24 """ | 24 """ |
25 function evalOn(g::Grid, f::Function) | 25 function evalOn(grid::Grid, f::Function) |
26 F(x) = f(x...) | 26 F(x) = f(x...) |
27 return F.(points(g)) | 27 return F.(points(grid)) |
28 end | 28 end |