comparison src/Grids/parameter_space.jl @ 1990:8cf1764ba124 feature/grids/parameter_spaces/in

Implement Base.in(x, ::HyperBox)
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 23 Apr 2025 15:42:38 +0200
parents 77ff0a2acbe5
children 7ead7a87af18
comparison
equal deleted inserted replaced
1989:77ff0a2acbe5 1990:8cf1764ba124
102 CartesianBoundary{d, UpperBoundary}(), 102 CartesianBoundary{d, UpperBoundary}(),
103 ] 103 ]
104 end 104 end
105 end 105 end
106 106
107 function Base.in(x, box::HyperBox)
108 return all(eachindex(x)) do i
109 box.a[i] <= x[i] <= box.b[i]
110 end
111 end
107 112
108 """ 113 """
109 unitsquare(T=Float64) 114 unitsquare(T=Float64)
110 115
111 The square limited by 0 and 1 in each dimension. 116 The square limited by 0 and 1 in each dimension.