Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1685:4aa0973bffb0 feature/grids/manifolds
Restrict the argument types of the simplest equidistant_grid to Number to avoid ambiguity
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 21 Aug 2024 19:10:37 +0200 |
parents | 13a7a4ff49e3 |
children | b996c35dd647 |
comparison
equal
deleted
inserted
replaced
1678:13a7a4ff49e3 | 1685:4aa0973bffb0 |
---|---|
115 gs = map(equidistant_grid, limit_lower, limit_upper, dims) | 115 gs = map(equidistant_grid, limit_lower, limit_upper, dims) |
116 return TensorGrid(gs...) | 116 return TensorGrid(gs...) |
117 end | 117 end |
118 | 118 |
119 """ | 119 """ |
120 equidistant_grid(limit_lower::T, limit_upper::T, size::Int) | 120 equidistant_grid(limit_lower::Number, limit_upper::Number, size::Int) |
121 | 121 |
122 Constructs a 1D equidistant grid. | 122 Constructs a 1D equidistant grid. |
123 """ | 123 """ |
124 function equidistant_grid(limit_lower::T, limit_upper::T, size::Int) where T | 124 function equidistant_grid(limit_lower::Number, limit_upper::Number, size::Int) |
125 if any(size .<= 0) | 125 if any(size .<= 0) |
126 throw(DomainError("size must be postive")) | 126 throw(DomainError("size must be postive")) |
127 end | 127 end |
128 | 128 |
129 if any(limit_upper.-limit_lower .<= 0) | 129 if any(limit_upper.-limit_lower .<= 0) |