Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1701:74f051444e0e
Make equidistant_grid() for 1D more restrictive in the types it accepts
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 03 Sep 2024 23:51:34 +0200 |
parents | 5f348cc5598e |
children | b5690ab5f0b8 |
comparison
equal
deleted
inserted
replaced
1676:5a1f51b4e3d9 | 1701:74f051444e0e |
---|---|
119 """ | 119 """ |
120 equidistant_grid(limit_lower::T, limit_upper::T, size::Int) | 120 equidistant_grid(limit_lower::T, limit_upper::T, 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) |