bundles / scipy latest / scipy / optimize / _trustregion_constr / qp_subproblem / box_sphere_intersections
function
scipy.optimize._trustregion_constr.qp_subproblem:box_sphere_intersections
source: /scipy/optimize/_trustregion_constr/qp_subproblem.py :236
Signature
def box_sphere_intersections ( z , d , lb , ub , trust_radius , entire_line = False , extra_info = False ) Summary
Find the intersection between segment (or line) and box/sphere constraints.
Extended Summary
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: floatBall radius.
entire_line: bool, optionalWhen
True, the function returns the intersection between the linex(t) = z + t*d(tcan assume any value) and the constraints. WhenFalse, the function returns the intersection between the segmentx(t) = z + t*d,0 <= t <= 1and the constraints.extra_info: bool, optionalWhen
True, the function returnsintersect_sphereandintersect_box.
Returns
ta, tb: floatThe line/segment
x(t) = z + t*dis inside the rectangular box and inside the ball forta <= t <= tb.intersect: boolWhen
True, there is a intersection between the line (or segment) and both constraints. On the other hand, whenFalse, there is no intersection.sphere_info: dict, optionalDictionary
{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, optionalDictionary
{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.
Aliases
-
scipy.optimize._trustregion_constr.qp_subproblem.box_sphere_intersections