Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1779:2a8a2b52a112 feature/grids/manifolds
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 16 Sep 2024 08:33:43 +0200 |
parents | 03894fd7b132 |
children | f2b32da29b73 |
comparison
equal
deleted
inserted
replaced
1778:a93d2b668446 | 1779:2a8a2b52a112 |
---|---|
149 end | 149 end |
150 | 150 |
151 return EquidistantGrid(range(limit_lower, limit_upper, length=size)) # TBD: Should it use LinRange instead? | 151 return EquidistantGrid(range(limit_lower, limit_upper, length=size)) # TBD: Should it use LinRange instead? |
152 end | 152 end |
153 | 153 |
154 | 154 equidistant_grid(d::Interval, size::Int) = equidistant_grid(limits(d)..., size) |
155 equidistant_grid(hb::HyperBox, dims::Vararg{Int}) = equidistant_grid(hb.a, hb.b, dims...) | 155 equidistant_grid(hb::HyperBox, dims::Vararg{Int}) = equidistant_grid(limits(hb)..., dims...) |
156 # TODO: One dimensional grids shouldn't have vector eltype right?, Change here or in HyperBox? | |
157 | 156 |
158 function equidistant_grid(c::Chart, dims::Vararg{Int}) | 157 function equidistant_grid(c::Chart, dims::Vararg{Int}) |
159 lg = equidistant_grid(parameterspace(c), dims...) | 158 lg = equidistant_grid(parameterspace(c), dims...) |
160 return MappedGrid( | 159 return MappedGrid( |
161 lg, | 160 lg, |