Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1259:ee57bdb366e4 refactor/grids
Reorganize some EquidistantGrid tests and add test for IteratorSize and eachindex
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 23 Feb 2023 12:22:00 +0100 |
parents | 198ccda331a6 |
children | 5e28ae42caf2 |
comparison
equal
deleted
inserted
replaced
1258:e67cddbb8adc | 1259:ee57bdb366e4 |
---|---|
15 | 15 |
16 # Iteration interface | 16 # Iteration interface |
17 Base.iterate(g::EquidistantGrid) = iterate(g.points) | 17 Base.iterate(g::EquidistantGrid) = iterate(g.points) |
18 Base.iterate(g::EquidistantGrid, state) = iterate(g.points, state) | 18 Base.iterate(g::EquidistantGrid, state) = iterate(g.points, state) |
19 | 19 |
20 Base.IteratorSize(::Type{EquidistantGrid}) = Base.HasShape{1}() | 20 Base.IteratorSize(::Type{EquidistantGrid{T,R}}) where {T,R} = Base.HasShape{1}() |
21 Base.eltype(::Type{EquidistantGrid{T}}) where T = T | 21 Base.eltype(::Type{EquidistantGrid{T}}) where T = T |
22 Base.length(g::EquidistantGrid) = length(g.points) | 22 Base.length(g::EquidistantGrid) = length(g.points) |
23 Base.size(g::EquidistantGrid) = size(g.points) | 23 Base.size(g::EquidistantGrid) = size(g.points) |
24 | 24 |
25 | 25 |