Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1128:dfbd62c7eb09 feature/grids
Rename dim to ndims in Grids.jl
| author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
|---|---|
| date | Wed, 05 Oct 2022 22:00:30 +0200 |
| parents | aeeffca46b94 |
| children | 5f677cd6f0b6 |
comparison
equal
deleted
inserted
replaced
| 1127:5490d0a38007 | 1128:dfbd62c7eb09 |
|---|---|
| 1 """ | 1 """ |
| 2 Grid | 2 Grid |
| 3 | 3 |
| 4 Should implement | 4 Should implement |
| 5 dim(grid::Grid) | 5 Base.ndims(grid::Grid) |
| 6 points(grid::Grid) | 6 points(grid::Grid) |
| 7 | 7 |
| 8 """ | 8 """ |
| 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. | |
| 11 function points end | 10 function points end |
| 12 | 11 |
| 13 """ | 12 """ |
| 14 dims(grid::Grid) | 13 dims(grid::Grid) |
| 15 | 14 |
| 16 A range containing the dimensions of `grid` | 15 A range containing the dimensions of `grid` |
| 17 """ | 16 """ |
| 18 dims(grid::Grid) = 1:dim(grid) | 17 dims(grid::Grid) = 1:ndims(grid) |
| 19 | 18 |
| 20 """ | 19 """ |
| 21 evalOn(grid::Grid, f::Function) | 20 evalOn(grid::Grid, f::Function) |
| 22 | 21 |
| 23 Evaluate function `f` on `grid` | 22 Evaluate function `f` on `grid` |
