scipy.optimize.Bounds.
residual#
- Bounds.residual(x)[source]#
- Calculate the residual (slack) between the input and the bounds - For a bound constraint of the form: - lb <= x <= ub - the lower and upper residuals between x and the bounds are values - sland- sbsuch that:- lb + sl == x == ub - sb - When all elements of - sland- sbare positive, all elements of- xlie within the bounds; a negative element in- slor- sbindicates that the corresponding element of- xis out of bounds.- Parameters:
- x: array_like
- Vector of independent variables 
 
- Returns:
- sl, sbarray-like
- The lower and upper residuals