IntervalProd.approx_contains

IntervalProd.approx_contains(self, point, atol)[source]

Return True if point is “almost” contained in this set.

Parameters
pointarray-like or float

Point to be tested. Its length must be equal to ndim. In the 1d case, point can be given as a float.

atolfloat

Maximum allowed distance in maximum norm from point to self.

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