Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1262:5e28ae42caf2 refactor/grids
Clean up IteratorSize and eltype for EquidistantGrid, Grid, and ZeroDimGrid
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 23 Feb 2023 22:29:36 +0100 |
parents | ee57bdb366e4 |
children | 75a65db29be1 |
comparison
equal
deleted
inserted
replaced
1261:a4834779cd6d | 1262:5e28ae42caf2 |
---|---|
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{T,R}}) where {T,R} = Base.HasShape{1}() | 20 Base.IteratorSize(::Type{<:EquidistantGrid}) = Base.HasShape{1}() |
21 Base.eltype(::Type{EquidistantGrid{T}}) where T = T | |
22 Base.length(g::EquidistantGrid) = length(g.points) | 21 Base.length(g::EquidistantGrid) = length(g.points) |
23 Base.size(g::EquidistantGrid) = size(g.points) | 22 Base.size(g::EquidistantGrid) = size(g.points) |
24 | 23 |
25 | 24 |
26 """ | 25 """ |