Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1863:516eaabf1169 refactor/grids/iterable_boundary_indices
Merge default
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Wed, 22 Jan 2025 09:00:40 +0100 |
| parents | 805b9b7fcc39 244311761969 |
| children | edee7d677efb f93ba5832146 |
comparison
equal
deleted
inserted
replaced
| 1845:aa7da5c899d8 | 1863:516eaabf1169 |
|---|---|
| 13 struct EquidistantGrid{T,R<:AbstractRange{T}} <: Grid{T,1} | 13 struct EquidistantGrid{T,R<:AbstractRange{T}} <: Grid{T,1} |
| 14 points::R | 14 points::R |
| 15 end | 15 end |
| 16 | 16 |
| 17 # Indexing interface | 17 # Indexing interface |
| 18 Base.getindex(g::EquidistantGrid, i) = g.points[i] | 18 Base.getindex(g::EquidistantGrid, i::Int) = 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 | 22 |
| 23 Base.axes(g::EquidistantGrid, d) = axes(g.points, d) | 23 Base.axes(g::EquidistantGrid, d) = axes(g.points, d) |
