bundles / scipy latest / scipy / optimize / _linprog / linprog_terse_callback
function
scipy.optimize._linprog:linprog_terse_callback
source: build-install/usr/lib/python3.14/site-packages/scipy/optimize/_linprog.py:123
Signature
def linprog_terse_callback(res)Summary
A sample callback function demonstrating the linprog callback interface. This callback produces brief 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 @ x.phase
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.linprog_terse_callback