IntervalProd.collapse

IntervalProd.collapse(self, indices, values)[source]

Partly collapse the interval product to single values.

Note that no changes are made in-place.

Parameters
indicesint or sequence of ints

The indices of the dimensions along which to collapse.

valuesarray-like or float

The values to which to collapse. Must have the same length as indices. Values must lie within the interval boundaries.

Returns
collapsedIntervalProd

The collapsed set.

Examples

>>> min_pt, max_pt = [-1, 0, 2], [-0.5, 1, 3]
>>> rbox = IntervalProd(min_pt, max_pt)
>>> rbox.collapse(1, 0)
IntervalProd([-1.,  0.,  2.], [-0.5,  0. ,  3. ])
>>> rbox.collapse([1, 2], [0, 2.5])
IntervalProd([-1. ,  0. ,  2.5], [-0.5,  0. ,  2.5])