bundles / scipy 1.18.0 / scipy / optimize / _linprog / linprog_verbose_callback
function
scipy.optimize._linprog:linprog_verbose_callback
source: /scipy/optimize/_linprog.py:42
Signature
def linprog_verbose_callback(res)Summary
A sample callback function demonstrating the linprog callback interface. This callback produces detailed output to sys.stdout before each iteration and after the final iteration of the simplex algorithm.
Parameters
res: A `scipy.optimize.OptimizeResult` consisting of the following fields:x
The independent variable vector which optimizes the linear programming problem.
fun
Value of the objective function.
success
True if the algorithm succeeded in finding an optimal solution.
slack
The values of the slack variables. Each slack variable corresponds to an inequality constraint. If the slack is zero, then the corresponding constraint is active.
con
The (nominally zero) residuals of the equality constraints, that is,
b - A_eq @ xphase
The phase of the optimization being executed. In phase 1 a basic feasible solution is sought and the T has an additional row representing an alternate objective function.
status
An integer representing the exit status of the optimization:
0Optimization terminated successfully1Iteration limit reached2Problem appears to be infeasible3Problem appears to be unbounded4Serious numerical difficulties encounterednit
The number of iterations performed.
message
A string descriptor of the exit status of the optimization.
Aliases
scipy.optimize.linprog_verbose_callback