bundles / scipy latest / scipy / optimize / _trustregion_constr / qp_subproblem / box_intersections
function
scipy.optimize._trustregion_constr.qp_subproblem:box_intersections
source: /scipy/optimize/_trustregion_constr/qp_subproblem.py :151
Signature
def box_intersections ( z , d , lb , ub , entire_line = False ) Summary
Find the intersection between segment (or line) and box constraints.
Extended Summary
Find the intersection between the segment (or line) defined by the parametric equation x(t) = z + t*d and the rectangular box lb <= x <= ub.
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.entire_line: bool, optionalWhen
True, the function returns the intersection between the linex(t) = z + t*d(tcan assume any value) and the rectangular box. WhenFalse, the function returns the intersection between the segmentx(t) = z + t*d,0 <= t <= 1, and the rectangular box.
Returns
ta, tb: floatThe line/segment
x(t) = z + t*dis inside the box for forta <= t <= tb.intersect: boolWhen
True, there is a intersection between the line (or segment) and the rectangular box. On the other hand, whenFalse, there is no intersection.
Aliases
-
scipy.optimize._trustregion_constr.equality_constrained_sqp.box_intersections