Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1389:d2219cc8316b bugfix/grids/complete_interface_impl
Add `firstindex(g,d)` and `lastindex(g,d)` for `EquidistantGrid`
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 15 Aug 2023 22:38:48 +0200 |
| parents | 4684c7f1c4cb |
| children | adbdbf1c3480 |
comparison
equal
deleted
inserted
replaced
| 1388:c0208286234e | 1389:d2219cc8316b |
|---|---|
| 17 # Indexing interface | 17 # Indexing interface |
| 18 Base.getindex(g::EquidistantGrid, i) = g.points[i] | 18 Base.getindex(g::EquidistantGrid, i) = g.points[i] |
| 19 Base.eachindex(g::EquidistantGrid) = eachindex(g.points) | 19 Base.eachindex(g::EquidistantGrid) = eachindex(g.points) |
| 20 Base.firstindex(g::EquidistantGrid) = firstindex(g.points) | 20 Base.firstindex(g::EquidistantGrid) = firstindex(g.points) |
| 21 Base.lastindex(g::EquidistantGrid) = lastindex(g.points) | 21 Base.lastindex(g::EquidistantGrid) = lastindex(g.points) |
| 22 | |
| 23 Base.firstindex(g::EquidistantGrid, d) = firstindex(g) | |
| 24 Base.lastindex(g::EquidistantGrid, d) = lastindex(g) | |
| 22 | 25 |
| 23 # Iteration interface | 26 # Iteration interface |
| 24 Base.iterate(g::EquidistantGrid) = iterate(g.points) | 27 Base.iterate(g::EquidistantGrid) = iterate(g.points) |
| 25 Base.iterate(g::EquidistantGrid, state) = iterate(g.points, state) | 28 Base.iterate(g::EquidistantGrid, state) = iterate(g.points, state) |
| 26 | 29 |
