{ } Raw JSON

bundles / scipy latest / scipy / optimize / _linprog_util / _postsolve

function

scipy.optimize._linprog_util:_postsolve

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

Signature

def   _postsolve ( x postsolve_args complete = False )

Summary

Given solution x to presolved, standard form linear program x, add fixed variables back into the problem and undo the variable substitutions to get solution to original linear program. Also, calculate the objective function value, slack in original upper bound constraints, and residuals in original equality constraints.

Parameters

x : 1-D array

Solution vector to the standard-form problem.

postsolve_args : tuple

Data needed by _postsolve to convert the solution to the standard-form problem into the solution to the original problem, including:

lp : A `scipy.optimize._linprog_util._LPProblem` consisting of the following fields:

c

c

A_ub

A_ub

b_ub

b_ub

A_eq

A_eq

b_eq

b_eq

bounds

bounds

x0

x0

revstack: list of functions

the functions in the list reverse the operations of _presolve() the function signature is x_org = f(x_mod), where x_mod is the result of a presolve step and x_org the value at the start of the step

complete : bool

Whether the solution is was determined in presolve (True if so)

Returns

x : 1-D array

Solution vector to original linear programming problem

: fun: float

optimal objective value for original problem

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

Aliases

  • scipy.optimize._linprog._postsolve