{ } Raw JSON

bundles / scipy latest / scipy / optimize / _linprog_util / _check_result

function

scipy.optimize._linprog_util:_check_result

source: /scipy/optimize/_linprog_util.py :1418

Signature

def   _check_result ( x fun status slack con bounds tol message integrality )

Summary

Check the validity of the provided solution.

Extended Summary

A valid (optimal) solution satisfies all bounds, all slack variables are negative and all equality constraint residuals are strictly non-zero. Further, the lower-bounds, upper-bounds, slack and residuals contain no nan values.

Parameters

x : 1-D array

Solution vector to original linear programming problem

fun: float

optimal objective value for original problem

status : int

An integer representing the exit status of the optimization

0 : Optimization terminated successfully
1 : Iteration limit reached
2 : Problem appears to be infeasible
3 : Problem appears to be unbounded
4 : Serious numerical difficulties encountered
slack : 1-D array

The (non-negative) slack in the upper bound constraints, that is, b_ub - A_ub @ x

con : 1-D array

The (nominally zero) residuals of the equality constraints, that is, b - A_eq @ x

bounds : 2D array

The bounds on the original variables x

message : str

A string descriptor of the exit status of the optimization.

tol : float

Termination tolerance; see [1] Section 4.5.

Returns

status : int

An integer representing the exit status of the optimization

0 : Optimization terminated successfully
1 : Iteration limit reached
2 : Problem appears to be infeasible
3 : Problem appears to be unbounded
4 : Serious numerical difficulties encountered
message : str

A string descriptor of the exit status of the optimization.

Aliases

  • scipy.optimize._linprog._check_result