Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1764:d207e1abacc1 feature/jet_aqua
Fix ambiguity in getindex(::EquidistantGrid,...)
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 13 Sep 2024 16:12:25 +0200 |
parents | b5690ab5f0b8 |
children | 244311761969 |
comparison
equal
deleted
inserted
replaced
1763:65fd5331caa5 | 1764:d207e1abacc1 |
---|---|
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) |