scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
box_sphere_intersections(z, d, lb, ub, trust_radius, entire_line=False, extra_info=False)

Find the intersection between the segment (or line) defined by the parametric equation x(t) = z + t*d , the rectangular box lb <= x <= ub and the ball ||x|| <= trust_radius .

Parameters

z : array_like, shape (n,)

Initial point.

d : array_like, shape (n,)

Direction.

lb : array_like, shape (n,)

Lower bounds to each one of the components of x . Used to delimit the rectangular box.

ub : array_like, shape (n, )

Upper bounds to each one of the components of x . Used to delimit the rectangular box.

trust_radius : float

Ball radius.

entire_line : bool, optional

When True , the function returns the intersection between the line x(t) = z + t*d ( t can assume any value) and the constraints. When False , the function returns the intersection between the segment x(t) = z + t*d , 0 <= t <= 1 and the constraints.

extra_info : bool, optional

When True , the function returns intersect_sphere and intersect_box .

Returns

ta, tb : float

The line/segment x(t) = z + t*d is inside the rectangular box and inside the ball for for ta <= t <= tb .

intersect : bool

When True , there is a intersection between the line (or segment) and both constraints. On the other hand, when False , there is no intersection.

sphere_info : dict, optional

Dictionary {ta, tb, intersect} containing the interval [ta, tb] for which the line intercepts the ball. And a boolean value indicating whether the sphere is intersected by the line.

box_info : dict, optional

Dictionary {ta, tb, intersect} containing the interval [ta, tb] for which the line intercepts the box. And a boolean value indicating whether the box is intersected by the line.

Find the intersection between segment (or line) and box/sphere constraints.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/optimize/_trustregion_constr/qp_subproblem.py#236
type: <class 'function'>
Commit: