IntervalProd.approx_contains¶
- IntervalProd.approx_contains(point, atol)[source]¶
Return
Trueifpointis "almost" contained in this set.- Parameters:
- point
array-likeor float Point to be tested. Its length must be equal to
ndim. In the 1d case,pointcan be given as a float.- atolfloat
Maximum allowed distance in maximum norm from
pointtoself.
- point
Examples
>>> min_pt, max_pt = [-1, 0, 2], [-0.5, 0, 3] >>> rbox = IntervalProd(min_pt, max_pt) >>> # Numerical error >>> rbox.approx_contains([-1 + np.sqrt(0.5)**2, 0., 2.9], atol=0) False >>> rbox.approx_contains([-1 + np.sqrt(0.5)**2, 0., 2.9], atol=1e-9) True