This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / optimize / _highspy / _highs_wrapper / _highs_wrapper

function

scipy.optimize._highspy._highs_wrapper:_highs_wrapper

source: build-install/usr/lib/python3.14/site-packages/scipy/optimize/_highspy/_highs_wrapper.py:10

Signature

def _highs_wrapper(c, indptr, indices, data, lhs, rhs, lb, ub, integrality, options)

Summary

Solve linear programs using HiGHS [1].

Extended Summary

Assume problems of the form:

MIN c.T @ x s.t. lhs <= A @ x <= rhs lb <= x <= ub

Parameters

c : 1-D array, (n,)

Array of objective value coefficients.

astart : 1-D array

CSC format index array.

aindex : 1-D array

CSC format index array.

avalue : 1-D array

Data array of the matrix.

lhs : 1-D array (or None), (m,)

Array of left hand side values of the inequality constraints. If lhs=None, then an array of -inf is assumed.

rhs : 1-D array, (m,)

Array of right hand side values of the inequality constraints.

lb : 1-D array (or None), (n,)

Lower bounds on solution variables x. If lb=None, then an array of all 0 is assumed.

ub : 1-D array (or None), (n,)

Upper bounds on solution variables x. If ub=None, then an array of inf is assumed.

options : dict

A dictionary of solver options

Returns

res : dict

If model_status is one of kOptimal, kObjectiveBound, kTimeLimit, kIterationLimit:

  • status

    Model status code.

  • message

    Message corresponding to model status code.

  • x

    Solution variables.

  • slack

    Slack variables.

  • lambda

    Lagrange multipliers associated with the constraints Ax = b.

  • s

    Lagrange multipliers associated with the constraints x >= 0.

  • fun

    Final objective value.

  • simplex_nit

    Number of iterations accomplished by the simplex solver.

  • ipm_nit

    Number of iterations accomplished by the interior- point solver.

If model_status is not one of the above:

  • status

    Model status code.

  • message

    Message corresponding to model status code.

Notes

If options['write_solution_to_file'] is True but options['solution_file'] is unset or '', then the solution will be printed to stdout.

If any iteration limit is reached, no solution will be available.

OptimizeWarning will be raised if any option value set by the user is found to be incorrect.

Aliases

  • scipy.optimize._linprog_highs._highs_wrapper