C

Highs_addCol — Method
Highs_addCol(highs, cost, lower, upper, num_new_nz, index, value)

Add a new column (variable) to the model.

Arguments

  • highs: A pointer to the Highs instance.
  • cost: The objective coefficient of the column.
  • lower: The lower bound of the column.
  • upper: The upper bound of the column.
  • num_new_nz: The number of non-zeros in the column.
  • index: An array of size [num_new_nz] with the row indices.
  • value: An array of size [num_new_nz] with row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addCols — Method
Highs_addCols(highs, num_new_col, costs, lower, upper, num_new_nz, starts, index, value)

Add multiple columns (variables) to the model.

Arguments

  • highs: A pointer to the Highs instance.
  • num_new_col: The number of new columns to add.
  • costs: An array of size [num_new_col] with objective coefficients.
  • lower: An array of size [num_new_col] with lower bounds.
  • upper: An array of size [num_new_col] with upper bounds.
  • num_new_nz: The number of new nonzeros in the constraint matrix.
  • starts: The constraint coefficients are given as a matrix in compressed sparse column form by the arrays starts, index, and value. starts is an array of size [num_new_cols] with the start index of each row in indices and values.
  • index: An array of size [num_new_nz] with row indices.
  • value: An array of size [num_new_nz] with row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addLinearObjective — Method
Highs_addLinearObjective(highs, weight, offset, coefficients, abs_tolerance, rel_tolerance, priority)

Adds linear objective data to HiGHS

Arguments

  • highs: A pointer to the Highs instance.
  • weight: The weight of the linear objective, with its positive/negative sign determining whether it is minimized or maximized during lexicographic optimization
  • offset: The objective offset
  • coefficients: A pointer to the objective coefficients
  • abs_tolerance: The absolute tolerance used when constructing an objective constraint during lexicographic optimization
  • rel_tolerance: The relative tolerance used when constructing an objective constraint during lexicographic optimization
  • priority: The priority of this objective during lexicographic optimization

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addRow — Method
Highs_addRow(highs, lower, upper, num_new_nz, index, value)

Add a new row (a linear constraint) to the model.

Arguments

  • highs: A pointer to the Highs instance.
  • lower: The lower bound of the row.
  • upper: The upper bound of the row.
  • num_new_nz: The number of non-zeros in the row
  • index: An array of size [num_new_nz] with column indices.
  • value: An array of size [num_new_nz] with column values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addRows — Method
Highs_addRows(highs, num_new_row, lower, upper, num_new_nz, starts, index, value)

Add multiple rows (linear constraints) to the model.

Arguments

  • highs: A pointer to the Highs instance.
  • num_new_row: The number of new rows to add
  • lower: An array of size [num_new_row] with the lower bounds of the rows.
  • upper: An array of size [num_new_row] with the upper bounds of the rows.
  • num_new_nz: The number of non-zeros in the rows.
  • starts: The constraint coefficients are given as a matrix in compressed sparse row form by the arrays starts, index, and value. starts is an array of size [num_new_rows] with the start index of each row in indices and values.
  • index: An array of size [num_new_nz] with column indices.
  • value: An array of size [num_new_nz] with column values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addVar — Method
Highs_addVar(highs, lower, upper)

Add a new variable to the model.

Arguments

  • highs: A pointer to the Highs instance.
  • lower: The lower bound of the column.
  • upper: The upper bound of the column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addVars — Method
Highs_addVars(highs, num_new_var, lower, upper)

Add multiple variables to the model.

Arguments

  • highs: A pointer to the Highs instance.
  • num_new_var: The number of new variables to add.
  • lower: An array of size [num_new_var] with lower bounds.
  • upper: An array of size [num_new_var] with upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeCoeff — Method
Highs_changeCoeff(highs, row, col, value)

Change a coefficient in the constraint matrix.

Arguments

  • highs: A pointer to the Highs instance.
  • row: The index of the row to change.
  • col: The index of the column to change.
  • value: The new constraint coefficient.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColBounds — Method
Highs_changeColBounds(highs, col, lower, upper)

Change the variable bounds of a column.

Arguments

  • highs: A pointer to the Highs instance.
  • col: The index of the column whose bounds are to change.
  • lower: The new lower bound.
  • upper: The new upper bound.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColCost — Method
Highs_changeColCost(highs, col, cost)

Change the objective coefficient of a column.

Arguments

  • highs: A pointer to the Highs instance.
  • col: The index of the column fo change.
  • cost: The new objective coefficient.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColIntegrality — Method
Highs_changeColIntegrality(highs, col, integrality)

Change the integrality of a column.

Arguments

  • highs: A pointer to the Highs instance.
  • col: The column index to change.
  • integrality: The new integrality of the column in the form of a kHighsVarType constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsByMask — Method
Highs_changeColsBoundsByMask(highs, mask, lower, upper)

Change the variable bounds of multiple columns given by a mask.

Arguments

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column bounds should be changed and 0 otherwise.
  • lower: An array of length [num_col] with the new lower bounds.
  • upper: An array of length [num_col] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsByRange — Method
Highs_changeColsBoundsByRange(highs, from_col, to_col, lower, upper)

Change the variable bounds of multiple adjacent columns.

Arguments

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose bound changes.
  • to_col: The index of the last column whose bound changes.
  • lower: An array of length [to_col - from_col + 1] with the new lower bounds.
  • upper: An array of length [to_col - from_col + 1] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsBySet — Method
Highs_changeColsBoundsBySet(highs, num_set_entries, set, lower, upper)

Change the bounds of multiple columns given by an array of indices.

Arguments

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • lower: An array of length [num_set_entries] with the new lower bounds.
  • upper: An array of length [num_set_entries] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostByMask — Method
Highs_changeColsCostByMask(highs, mask, cost)

Change the cost of multiple columns given by a mask.

Arguments

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column cost should be changed and 0 otherwise.
  • cost: An array of length [num_col] with the new costs.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostByRange — Method
Highs_changeColsCostByRange(highs, from_col, to_col, cost)

Change the cost coefficients of multiple adjacent columns.

Arguments

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose cost changes.
  • to_col: The index of the last column whose cost changes.
  • cost: An array of length [to_col - from_col + 1] with the new objective coefficients.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostBySet — Method
Highs_changeColsCostBySet(highs, num_set_entries, set, cost)

Change the cost of multiple columns given by an array of indices.

Arguments

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • cost: An array of length [num_set_entries] with the new costs of the columns.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityByMask — Method
Highs_changeColsIntegralityByMask(highs, mask, integrality)

Change the integrality of multiple columns given by a mask.

Arguments

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column integrality should be changed and 0 otherwise.
  • integrality: An array of length [num_col] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityByRange — Method
Highs_changeColsIntegralityByRange(highs, from_col, to_col, integrality)

Change the integrality of multiple adjacent columns.

Arguments

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose integrality changes.
  • to_col: The index of the last column whose integrality changes.
  • integrality: An array of length [to_col - from_col + 1] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityBySet — Method
Highs_changeColsIntegralityBySet(highs, num_set_entries, set, integrality)

Change the integrality of multiple columns given by an array of indices.

Arguments

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • integrality: An array of length [num_set_entries] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeObjectiveOffset — Method
Highs_changeObjectiveOffset(highs, offset)

Change the objective offset of the model.

Arguments

  • highs: A pointer to the Highs instance.
  • offset: The new objective offset.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeObjectiveSense — Method
Highs_changeObjectiveSense(highs, sense)

Change the objective sense of the model.

Arguments

  • highs: A pointer to the Highs instance.
  • sense: The new optimization sense in the form of a kHighsObjSense constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowBounds — Method
Highs_changeRowBounds(highs, row, lower, upper)

Change the bounds of a row.

Arguments

  • highs: A pointer to the Highs instance.
  • row: The index of the row whose bounds are to change.
  • lower: The new lower bound.
  • upper: The new upper bound.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowsBoundsByMask — Method
Highs_changeRowsBoundsByMask(highs, mask, lower, upper)

Change the bounds of multiple rows given by a mask.

Arguments

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_row] with 1 if the row bounds should be changed and 0 otherwise.
  • lower: An array of length [num_row] with the new lower bounds.
  • upper: An array of length [num_row] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowsBoundsByRange — Method
Highs_changeRowsBoundsByRange(highs, from_row, to_row, lower, upper)

Change the variable bounds of multiple adjacent rows.

Arguments

  • highs: A pointer to the Highs instance.
  • from_row: The index of the first row whose bound changes.
  • to_row: The index of the last row whose bound changes.
  • lower: An array of length [to_row - from_row + 1] with the new lower bounds.
  • upper: An array of length [to_row - from_row + 1] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowsBoundsBySet — Method
Highs_changeRowsBoundsBySet(highs, num_set_entries, set, lower, upper)

Change the bounds of multiple rows given by an array of indices.

Arguments

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of rows to change.
  • set: An array of size [num_set_entries] with the indices of the rows to change.
  • lower: An array of length [num_set_entries] with the new lower bounds.
  • upper: An array of length [num_set_entries] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clear — Method
Highs_clear(highs)

Reset the options and then call clearModel.

See Highs_destroy to free all associated memory.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearIntegrality — Method
Highs_clearIntegrality(highs)

Clear the integrality of all columns

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearLinearObjectives — Method
Highs_clearLinearObjectives(highs)

Clears any multiple linear objective data in HiGHS

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearModel — Method
Highs_clearModel(highs)

Remove all variables and constraints from the model highs, but do not invalidate the pointer highs. Future calls (for example, adding new variables and constraints) are allowed.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearSolver — Method
Highs_clearSolver(highs)

Clear all solution data associated with the model.

See Highs_destroy to clear the model and free all associated memory.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_create — Method
Highs_create()

Create a Highs instance and return the reference.

Call Highs_destroy on the returned reference to clean up allocated memory.

Returns

A pointer to the Highs instance.

source
Highs_crossover — Method
Highs_crossover(highs, num_col, num_row, col_value, col_dual, row_dual)

Set a primal (and possibly dual) solution as a starting point, then run crossover to compute a basic feasible solution.

Arguments

  • highs: A pointer to the Highs instance.
  • num_col: The number of variables.
  • num_row: The number of rows.
  • col_value: An array of length [num_col] with optimal primal solution for each column.
  • col_dual: An array of length [num_col] with optimal dual solution for each column. May be NULL, in which case no dual solution is passed.
  • row_dual: An array of length [num_row] with optimal dual solution for each row. . May be NULL, in which case no dual solution is passed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsByMask — Method
Highs_deleteColsByMask(highs, mask)

Delete multiple columns given by a mask.

Arguments

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column should be deleted and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsByRange — Method
Highs_deleteColsByRange(highs, from_col, to_col)

Delete multiple adjacent columns.

Arguments

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column to delete.
  • to_col: The index of the last column to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsBySet — Method
Highs_deleteColsBySet(highs, num_set_entries, set)

Delete multiple columns given by an array of indices.

Arguments

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to delete.
  • set: An array of size [num_set_entries] with the indices of the columns to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsByMask — Method
Highs_deleteRowsByMask(highs, mask)

Delete multiple rows given by a mask.

Arguments

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_row] with 1 if the row should be deleted and 0 otherwise. The new index of any column not deleted is stored in place of the value 0.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsByRange — Method
Highs_deleteRowsByRange(highs, from_row, to_row)

Delete multiple adjacent rows.

Arguments

  • highs: A pointer to the Highs instance.
  • from_row: The index of the first row to delete.
  • to_row: The index of the last row to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsBySet — Method
Highs_deleteRowsBySet(highs, num_set_entries, set)

Delete multiple rows given by an array of indices.

Arguments

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of rows to delete.
  • set: An array of size [num_set_entries] with the indices of the rows to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_destroy — Method
Highs_destroy(highs)

Destroy the model highs created by Highs_create and free all corresponding memory. Future calls using highs are not allowed.

To empty a model without invalidating highs, see Highs_clearModel.

Arguments

  • highs: A pointer to the Highs instance.
source
Highs_ensureColwise — Method
Highs_ensureColwise(highs)

Ensure that the constraint matrix of the incumbent model is stored column-wise.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_ensureRowwise — Method
Highs_ensureRowwise(highs)

Ensure that the constraint matrix of the incumbent model is stored row-wise.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_feasibilityRelaxation — Method
Highs_feasibilityRelaxation(highs, global_lower_penalty, global_upper_penalty, global_rhs_penalty, local_lower_penalty, local_upper_penalty, local_rhs_penalty)

Compute the solution corresponding to a (possibly weighted) sum of (allowable) infeasibilities in an LP/MIP.

If local penalties are not defined, pass NULL, and the global penalty will be used. Negative penalty values imply that the bound or RHS value cannot be violated

Arguments

  • highs: A pointer to the Highs instance.
  • const: double global_lower_penalty The penalty for violating lower bounds on variables
  • const: double global_upper_penalty The penalty for violating upper bounds on variables
  • const: double global_rhs_penalty The penalty for violating constraint RHS values
  • const: double* local_lower_penalty The penalties for violating specific lower bounds on variables
  • const: double* local_upper_penalty The penalties for violating specific upper bounds on variables
  • const: double* local_rhs_penalty The penalties for violating specific constraint RHS values

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasicVariables — Method
Highs_getBasicVariables(highs, basic_variables)

Get the indices of the rows and columns that make up the basis matrix $B$ of a basic feasible solution.

Non-negative entries are indices of columns, and negative entries are -row\_index - 1. For example, {1, -1} would be the second column and first row.

The order of these rows and columns is important for calls to the functions:

Arguments

  • highs: A pointer to the Highs instance.
  • basic_variables: An array of size [num_rows], filled with the indices of the basic variables.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasis — Method
Highs_getBasis(highs, col_status, row_status)

Given a linear program with a basic feasible solution, get the column and row basis statuses.

Arguments

  • highs: A pointer to the Highs instance.
  • col_status: An array of length [num_col], to be filled with the column basis statuses in the form of a kHighsBasisStatus constant.
  • row_status: An array of length [num_row], to be filled with the row basis statuses in the form of a kHighsBasisStatus constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisInverseCol — Method
Highs_getBasisInverseCol(highs, col, col_vector, col_num_nz, col_index)

Get a column of the inverse basis matrix $B^{-1}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays col_vector and col_index must have an allocated length of [num_row]. However, check col_num_nz to see how many non-zero elements are actually stored.

Arguments

  • highs: A pointer to the Highs instance.
  • col: The index of the column to compute.
  • col_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • col_num_nz: The number of non-zeros in the column.
  • col_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisInverseRow — Method
Highs_getBasisInverseRow(highs, row, row_vector, row_num_nz, row_index)

Get a row of the inverse basis matrix $B^{-1}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays row_vector and row_index must have an allocated length of [num_row]. However, check row_num_nz to see how many non-zero elements are actually stored.

Arguments

  • highs: A pointer to the Highs instance.
  • row: The index of the row to compute.
  • row_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • row_num_nz: The number of non-zeros in the row.
  • row_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisSolve — Method
Highs_getBasisSolve(highs, rhs, solution_vector, solution_num_nz, solution_index)

Compute ${x}=B^{-1}{b}$ for a given vector ${b}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays solution_vector and solution_index must have an allocated length of [num_row]. However, check solution_num_nz to see how many non-zero elements are actually stored.

Arguments

  • highs: A pointer to the Highs instance.
  • rhs: The right-hand side vector $b$.
  • solution_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • solution_num_nz: The number of non-zeros in the solution.
  • solution_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisTransposeSolve — Method
Highs_getBasisTransposeSolve(highs, rhs, solution_vector, solution_nz, solution_index)

Compute ${x}=B^{-T}{b}$ for a given vector ${b}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays solution_vector and solution_index must have an allocated length of [num_row]. However, check solution_num_nz to see how many non-zero elements are actually stored.

Arguments

  • highs: A pointer to the Highs instance.
  • rhs: The right-hand side vector $b$
  • solution_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • solution_num_nz: The number of non-zeros in the solution.
  • solution_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBoolOptionValue — Method
Highs_getBoolOptionValue(highs, option, value)

Get a boolean-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBoolOptionValues — Method
Highs_getBoolOptionValues(highs, option, current_value, default_value)

Get the current and default values of a bool option

Arguments

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getCallbackDataOutItem — Method
Highs_getCallbackDataOutItem(data_out, item_name)

Get a void* pointer to a callback data item

Arguments

Returns

A void* pointer to the callback data item, or NULL if item_name not valid

source
Highs_getColByName — Method
Highs_getColByName(highs, name, col)

Get the index of a column from its name.

If multiple columns have the same name, or if no column exists with name, this function returns kHighsStatusError.

Arguments

  • name: A pointer of the name of the column to query.
  • col: A pointer in which to store the index of the column

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColIntegrality — Method
Highs_getColIntegrality(highs, col, integrality)

Get the integrality of a column.

Arguments

  • col: The index of the column to query.
  • integrality: A HighsInt in which the integrality of the column should be placed. The integer is one of the kHighsVarTypeXXX constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColName — Method
Highs_getColName(highs, col, name)

Get the name of a column.

Arguments

  • col: The index of the column to query.
  • name: A pointer in which to store the name of the column. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsByMask — Method
Highs_getColsByMask(highs, mask, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple columns given by a mask.

This function is identical to Highs_getColsByRange, except for how the columns are specified.

Arguments

  • mask: An array of length [num_col] containing a 1 to get the column and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsByRange — Method
Highs_getColsByRange(highs, from_col, to_col, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple adjacent columns from the model.

To query the constraint coefficients, this function should be called twice.

First, call this function with matrix_start, matrix_index, and matrix_value as NULL. This call will populate num_nz with the number of nonzero elements in the corresponding section of the constraint matrix.

Second, allocate new matrix_index and matrix_value arrays of length num_nz and call this function again to populate the new arrays with their contents.

Arguments

  • highs: A pointer to the Highs instance.
  • from_col: The first column for which to query data for.
  • to_col: The last column (inclusive) for which to query data for.
  • num_col: A HighsInt populated with the number of columns got from the model (this should equal to\_col - from\_col + 1).
  • costs: An array of size [to_col - from_col + 1] for the column cost coefficients.
  • lower: An array of size [to_col - from_col + 1] for the column lower bounds.
  • upper: An array of size [to_col - from_col + 1] for the column upper bounds.
  • num_nz: A HighsInt to be populated with the number of non-zero elements in the constraint matrix.
  • matrix_start: An array of size [to_col - from_col + 1] with the start indices of each column in matrix_index and matrix_value.
  • matrix_index: An array of size [num_nz] with the row indices of each element in the constraint matrix.
  • matrix_value: An array of size [num_nz] with the non-zero elements of the constraint matrix.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsBySet — Method
Highs_getColsBySet(highs, num_set_entries, set, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple columns given by an array.

This function is identical to Highs_getColsByRange, except for how the columns are specified.

Arguments

  • num_set_indices: The number of indices in set.
  • set: An array of size [num_set_entries] with the column indices to get.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleInfoValue — Method
Highs_getDoubleInfoValue(highs, info, value)

Get a double-valued info value.

Arguments

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to a double that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleOptionValue — Method
Highs_getDoubleOptionValue(highs, option, value)

Get a double-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleOptionValues — Method
Highs_getDoubleOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of a double option

Arguments

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • min_value: A pointer to the minimum value of the option.
  • max_value: A pointer to the maximum value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDualRay — Method
Highs_getDualRay(highs, has_dual_ray, dual_ray_value)

Indicates whether a dual ray that is a certificate of primal infeasibility currently exists, and (at the expense of solving an LP) gets it if it does not and dual_ray_value is not nullptr.

Arguments

  • highs: A pointer to the Highs instance.
  • has_dual_ray: A pointer to a HighsInt to store 1 if a dual ray currently exists.
  • dual_ray_value: An array of length [num_row] filled with the unbounded ray.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDualUnboundednessDirection — Method
Highs_getDualUnboundednessDirection(highs, has_dual_unboundedness_direction, dual_unboundedness_direction_value)

Indicates whether a dual unboundedness direction (corresponding to a certificate of primal infeasibility) exists, and (at the expense of solving an LP) gets it if it does not and dual_unboundedness_direction is not nullptr

Arguments

  • highs: A pointer to the Highs instance.
  • has_dual_unboundedness_direction: A pointer to a HighsInt to store 1 if the dual unboundedness direction exists.
  • dual_unboundedness_direction_value: An array of length [num_col] filled with the unboundedness direction.
source
Highs_getFixedLp — Method
Highs_getFixedLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value)

Get the LP corresponding to a MIP with non-continuous variables fixed at a MIP solution

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getNumCol - Highs_getNumRow - Highs_getNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getHessianNumNz — Method
Highs_getHessianNumNz(highs)

Return the number of nonzeroes in the Hessian matrix of the model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeroes in the Hessian matrix of the model.

source
Highs_getIis — Method
Highs_getIis(highs, iis_num_col, iis_num_row, col_index, row_index, col_bound, row_bound, col_status, row_status)

Attempt to compute an irreducible infeasibility subsystem (IIS) for an LP, QP, or the relaxation of a MIP. If no IIS is found, then the number of IIS columns and rows will be zero.

Arguments

  • highs: A pointer to the Highs instance.
  • const: HighsInt iis_num_col Number of columns in the IIS.
  • const: HighsInt iis_num_row Number of rows in the IIS.
  • const: HighsInt* col_index An array of length [iis_num_col], to be filled with the indices of original variables in the IIS.
  • const: HighsInt* row_index An array of length [iis_num_col], to be filled with the indices of original constraints in the IIS.
  • const: HighsInt* col_bound An array of length [iis_num_col], to be filled with the bound status of variables in the IIS.
  • const: HighsInt* row_bound An array of length [iis_num_col], to be filled with the bound status of constraints in the IIS.
  • const: HighsInt* col_status An array of length [num_col], to be filled with the IIS status of all original variables.
  • const: HighsInt* row_status n array of length [num_col], to be filled with the IIS status of all original constraints.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIisLp — Method
Highs_getIisLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Get the data from a HiGHS IIS LP.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getPresolvedNumCol - Highs_getPresolvedNumRow - Highs_getPresolvedNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getInfinity — Method
Highs_getInfinity(highs)

Return the value of infinity used by HiGHS.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The value of infinity used by HiGHS.

source
Highs_getInfoType — Method
Highs_getInfoType(highs, info, type)

Get the type expected by an info item.

Arguments

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • type: A HighsInt in which the corresponding kHighsOptionType constant is stored.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getInt64InfoValue — Method
Highs_getInt64InfoValue(highs, info, value)

Get an int64-valued info value.

Arguments

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to an int64 that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntInfoValue — Method
Highs_getIntInfoValue(highs, info, value)

Get an int-valued info value.

Arguments

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to an integer that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntOptionValue — Method
Highs_getIntOptionValue(highs, option, value)

Get an int-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntOptionValues — Method
Highs_getIntOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of a HighsInt option

Arguments

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • min_value: A pointer to the minimum value of the option.
  • max_value: A pointer to the maximum value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getLp — Method
Highs_getLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Get the data from a HiGHS LP.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getNumCol - Highs_getNumRow - Highs_getNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getModel — Method
Highs_getModel(highs, a_format, q_format, num_col, num_row, num_nz, hessian_num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, integrality)

Get the data from a HiGHS model.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getNumCol - Highs_getNumRow - Highs_getNumNz - Highs_getHessianNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getModelStatus — Method
Highs_getModelStatus(highs)

Return the optimization status of the model in the form of a kHighsModelStatus constant.

Arguments

  • highs: A pointer to the Highs instance.

Returns

An integer corresponding to the kHighsModelStatus constant

source
Highs_getNumCol — Method
Highs_getNumCol(highs)

Return the number of columns in the model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the model.

source
Highs_getNumNz — Method
Highs_getNumNz(highs)

Return the number of nonzeros in the constraint matrix of the model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeros in the constraint matrix of the model.

source
Highs_getNumOptions — Method
Highs_getNumOptions(highs)

Return the number of options

Arguments

  • highs: A pointer to the Highs instance.
source
Highs_getNumRow — Method
Highs_getNumRow(highs)

Return the number of rows in the model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the model.

source
Highs_getObjectiveOffset — Method
Highs_getObjectiveOffset(highs, offset)

Get the objective offset.

Arguments

  • highs: A pointer to the Highs instance.
  • offset: The location in which the current objective offset should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getObjectiveSense — Method
Highs_getObjectiveSense(highs, sense)

Get the objective sense.

Arguments

  • highs: A pointer to the Highs instance.
  • sense: The location in which the current objective sense should be placed. The sense is a kHighsObjSense constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getObjectiveValue — Method
Highs_getObjectiveValue(highs)

Get the primal objective function value.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The primal objective function value

source
Highs_getOptionName — Method
Highs_getOptionName(highs, index, name)

Get the name of an option identified by index

Arguments

  • highs: A pointer to the Highs instance.
  • index: The index of the option.
  • name: The name of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getOptionType — Method
Highs_getOptionType(highs, option, type)

Get the type expected by an option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • type: A HighsInt in which the corresponding kHighsOptionType constant should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedColName — Method
Highs_getPresolvedColName(highs, col, name)

Get the name of a column of the presolved LP.

Arguments

  • col: The index of the column to query.
  • name: A pointer in which to store the name of the column. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedLp — Method
Highs_getPresolvedLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Get the data from a HiGHS presolved LP.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getPresolvedNumCol - Highs_getPresolvedNumRow - Highs_getPresolvedNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedNumCol — Method
Highs_getPresolvedNumCol(highs)

Return the number of columns in the presolved model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the presolved model.

source
Highs_getPresolvedNumNz — Method
Highs_getPresolvedNumNz(highs)

Return the number of nonzeros in the constraint matrix of the presolved model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeros in the constraint matrix of the presolved model.

source
Highs_getPresolvedNumRow — Method
Highs_getPresolvedNumRow(highs)

Return the number of rows in the presolved model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the presolved model.

source
Highs_getPresolvedRowName — Method
Highs_getPresolvedRowName(highs, row, name)

Get the name of a row of the presolved LP.

Arguments

  • row: The index of the row to query.
  • name: A pointer in which to store the name of the row. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPrimalRay — Method
Highs_getPrimalRay(highs, has_primal_ray, primal_ray_value)

Indicates whether a primal ray that is a certificate of primal unboundedness currently exists, and (at the expense of solving an LP) gets it if it does not and primal_ray_value is not nullptr.

Arguments

  • highs: A pointer to the Highs instance.
  • has_primal_ray: A pointer to a HighsInt to store 1 if the primal ray exists.
  • primal_ray_value: An array of length [num_col] filled with the unbounded ray.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRanging — Method
Highs_getRanging(highs, col_cost_up_value, col_cost_up_objective, col_cost_up_in_var, col_cost_up_ou_var, col_cost_dn_value, col_cost_dn_objective, col_cost_dn_in_var, col_cost_dn_ou_var, col_bound_up_value, col_bound_up_objective, col_bound_up_in_var, col_bound_up_ou_var, col_bound_dn_value, col_bound_dn_objective, col_bound_dn_in_var, col_bound_dn_ou_var, row_bound_up_value, row_bound_up_objective, row_bound_up_in_var, row_bound_up_ou_var, row_bound_dn_value, row_bound_dn_objective, row_bound_dn_in_var, row_bound_dn_ou_var)

Compute the ranging information for all costs and bounds. For nonbasic variables the ranging information is relative to the active bound. For basic variables the ranging information relates to...

For any values that are not required, pass NULL.

Arguments

  • highs: A pointer to the Highs instance.
  • col_cost_up_value: The upper range of the cost value
  • col_cost_up_objective: The objective at the upper cost range
  • col_cost_up_in_var: The variable entering the basis at the upper cost range
  • col_cost_up_ou_var: The variable leaving the basis at the upper cost range
  • col_cost_dn_value: The lower range of the cost value
  • col_cost_dn_objective: The objective at the lower cost range
  • col_cost_dn_in_var: The variable entering the basis at the lower cost range
  • col_cost_dn_ou_var: The variable leaving the basis at the lower cost range
  • col_bound_up_value: The upper range of the column bound value
  • col_bound_up_objective: The objective at the upper column bound range
  • col_bound_up_in_var: The variable entering the basis at the upper column bound range
  • col_bound_up_ou_var: The variable leaving the basis at the upper column bound range
  • col_bound_dn_value: The lower range of the column bound value
  • col_bound_dn_objective: The objective at the lower column bound range
  • col_bound_dn_in_var: The variable entering the basis at the lower column bound range
  • col_bound_dn_ou_var: The variable leaving the basis at the lower column bound range
  • row_bound_up_value: The upper range of the row bound value
  • row_bound_up_objective: The objective at the upper row bound range
  • row_bound_up_in_var: The variable entering the basis at the upper row bound range
  • row_bound_up_ou_var: The variable leaving the basis at the upper row bound range
  • row_bound_dn_value: The lower range of the row bound value
  • row_bound_dn_objective: The objective at the lower row bound range
  • row_bound_dn_in_var: The variable entering the basis at the lower row bound range
  • row_bound_dn_ou_var: The variable leaving the basis at the lower row bound range

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getReducedColumn — Method
Highs_getReducedColumn(highs, col, col_vector, col_num_nz, col_index)

Compute a column of $B^{-1}A$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays col_vector and col_index must have an allocated length of [num_row]. However, check col_num_nz to see how many non-zero elements are actually stored.

Arguments

  • highs: A pointer to the Highs instance.
  • col: The index of the column to compute.
  • col_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • col_num_nz: The number of non-zeros in the column.
  • col_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getReducedRow — Method
Highs_getReducedRow(highs, row, row_vector, row_num_nz, row_index)

Compute a row of $B^{-1}A$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays row_vector and row_index must have an allocated length of [num_col]. However, check row_num_nz to see how many non-zero elements are actually stored.

Arguments

  • highs: A pointer to the Highs instance.
  • row: The index of the row to compute.
  • row_vector: An array of length [num_col] in which to store the values of the non-zero elements.
  • row_num_nz: The number of non-zeros in the row.
  • row_index: An array of length [num_col] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowByName — Method
Highs_getRowByName(highs, name, row)

Get the index of a row from its name.

If multiple rows have the same name, or if no row exists with name, this function returns kHighsStatusError.

Arguments

  • name: A pointer of the name of the row to query.
  • row: A pointer in which to store the index of the row

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowName — Method
Highs_getRowName(highs, row, name)

Get the name of a row.

Arguments

  • row: The index of the row to query.
  • name: A pointer in which to store the name of the row. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsByMask — Method
Highs_getRowsByMask(highs, mask, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple rows given by a mask.

This function is identical to Highs_getRowsByRange, except for how the rows are specified.

Arguments

  • mask: An array of length [num_row] containing a 1 to get the row and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsByRange — Method
Highs_getRowsByRange(highs, from_row, to_row, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple adjacent rows from the model.

To query the constraint coefficients, this function should be called twice.

First, call this function with matrix_start, matrix_index, and matrix_value as NULL. This call will populate num_nz with the number of nonzero elements in the corresponding section of the constraint matrix.

Second, allocate new matrix_index and matrix_value arrays of length num_nz and call this function again to populate the new arrays with their contents.

Arguments

  • highs: A pointer to the Highs instance.
  • from_row: The first row for which to query data for.
  • to_row: The last row (inclusive) for which to query data for.
  • num_row: A HighsInt to be populated with the number of rows got from the model.
  • lower: An array of size [to_row - from_row + 1] for the row lower bounds.
  • upper: An array of size [to_row - from_row + 1] for the row upper bounds.
  • num_nz: A HighsInt to be populated with the number of non-zero elements in the constraint matrix.
  • matrix_start: An array of size [to_row - from_row + 1] with the start indices of each row in matrix_index and matrix_value.
  • matrix_index: An array of size [num_nz] with the column indices of each element in the constraint matrix.
  • matrix_value: An array of size [num_nz] with the non-zero elements of the constraint matrix.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsBySet — Method
Highs_getRowsBySet(highs, num_set_entries, set, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple rows given by an array.

This function is identical to Highs_getRowsByRange, except for how the rows are specified.

Arguments

  • num_set_indices: The number of indices in set.
  • set: An array of size [num_set_entries] containing the row indices to get.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRunTime — Method
Highs_getRunTime(highs)

Return the cumulative wall-clock time spent in Highs_run.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The cumulative wall-clock time spent in Highs_run

source
Highs_getSizeofHighsInt — Method
Highs_getSizeofHighsInt(highs)

Return the size of integers used by HiGHS.

Arguments

  • highs: A pointer to the Highs instance.

Returns

The size of integers used by HiGHS.

source
Highs_getSolution — Method
Highs_getSolution(highs, col_value, col_dual, row_value, row_dual)

Get the primal and dual solution from an optimized model.

Arguments

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col], to be filled with primal column values.
  • col_dual: An array of length [num_col], to be filled with dual column values.
  • row_value: An array of length [num_row], to be filled with primal row values.
  • row_dual: An array of length [num_row], to be filled with dual row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getStringOptionValue — Method
Highs_getStringOptionValue(highs, option, value)

Get a string-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: A pointer to allocated memory (of at least kMaximumStringLength) to store the current value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getStringOptionValues — Method
Highs_getStringOptionValues(highs, option, current_value, default_value)

Get the current and default values of a string option

Arguments

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_githash — Method
Highs_githash()

Return the HiGHS githash.

Returns

The HiGHS githash.

source
Highs_lpCall — Method
Highs_lpCall(num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, col_value, col_dual, row_value, row_dual, col_basis_status, row_basis_status, model_status)

Formulate and solve a linear program using HiGHS.

Arguments

  • num_col: The number of columns.
  • num_row: The number of rows.
  • num_nz: The number of nonzeros in the constraint matrix.
  • a_format: The format of the constraint matrix as a kHighsMatrixFormat constant.
  • sense: The optimization sense as a kHighsObjSense constant.
  • offset: The objective constant.
  • col_cost: An array of length [num_col] with the column costs.
  • col_lower: An array of length [num_col] with the column lower bounds.
  • col_upper: An array of length [num_col] with the column upper bounds.
  • row_lower: An array of length [num_row] with the row lower bounds.
  • row_upper: An array of length [num_row] with the row upper bounds.
  • a_start: The constraint matrix is provided to HiGHS in compressed sparse column form (if a_format is kHighsMatrixFormatColwise, otherwise compressed sparse row form). The sparse matrix consists of three arrays, a_start, a_index, and a_value. a_start is an array of length [num_col] containing the starting index of each column in a_index. If a_format is kHighsMatrixFormatRowwise the array is of length [num_row] corresponding to each row.
  • a_index: An array of length [num_nz] with indices of matrix entries.
  • a_value: An array of length [num_nz] with values of matrix entries.
  • col_value: An array of length [num_col], to be filled with the primal column solution.
  • col_dual: An array of length [num_col], to be filled with the dual column solution.
  • row_value: An array of length [num_row], to be filled with the primal row solution.
  • row_dual: An array of length [num_row], to be filled with the dual row solution.
  • col_basis_status: An array of length [num_col], to be filled with the basis status of the columns in the form of a kHighsBasisStatus constant.
  • row_basis_status: An array of length [num_row], to be filled with the basis status of the rows in the form of a kHighsBasisStatus constant.
  • model_status: The location in which to place the termination status of the model after the solve in the form of a kHighsModelStatus constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_mipCall — Method
Highs_mipCall(num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality, col_value, row_value, model_status)

Formulate and solve a mixed-integer linear program using HiGHS.

The signature of this method is identical to Highs_lpCall, except that it has an additional integrality argument, and that it is missing the col_dual, row_dual, col_basis_status and row_basis_status arguments.

Arguments

  • integrality: An array of length [num_col], containing a kHighsVarType constant for each column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passColName — Method
Highs_passColName(highs, col, name)

Pass the name of a column.

Arguments

  • highs: A pointer to the Highs instance.
  • col: The column for which the name is supplied.
  • name: The name of the column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passHessian — Method
Highs_passHessian(highs, dim, num_nz, format, start, index, value)

Set the Hessian matrix for a quadratic objective.

Arguments

  • highs: A pointer to the Highs instance.
  • dim: The dimension of the Hessian matrix. Should be [num_col].
  • num_nz: The number of non-zero elements in the Hessian matrix.
  • format: The format of the Hessian matrix as a kHighsHessianFormat constant. This must be kHighsHessianFormatTriangular.
  • start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form), using q_start, q_index, and q_value.The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form. The sparse matrix consists of three arrays, start, index, and value. start is an array of length [num_col] containing the starting index of each column in index.
  • index: An array of length [num_nz] with indices of matrix entries.
  • value: An array of length [num_nz] with values of matrix entries.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passLinearObjectives — Method
Highs_passLinearObjectives(highs, num_linear_objective, weight, offset, coefficients, abs_tolerance, rel_tolerance, priority)

Passes multiple linear objective data to HiGHS, clearing any such data already in HiGHS

Arguments

  • highs: A pointer to the Highs instance.
  • weight: A pointer to the weights of the linear objective, with its positive/negative sign determining whether it is minimized or maximized during lexicographic optimization
  • offset: A pointer to the objective offsets
  • coefficients: A pointer to the objective coefficients
  • abs_tolerance: A pointer to the absolute tolerances used when constructing objective constraints during lexicographic optimization
  • rel_tolerance: A pointer to the relative tolerances used when constructing objective constraints during lexicographic optimization
  • priority: A pointer to the priorities of the objectives during lexicographic optimization

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passLp — Method
Highs_passLp(highs, num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value)

Pass a linear program (LP) to HiGHS in a single function call.

The signature of this function is identical to Highs_passModel, without the arguments for passing the Hessian matrix of a quadratic program and the integrality vector.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passMip — Method
Highs_passMip(highs, num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Pass a mixed-integer linear program (MILP) to HiGHS in a single function call.

The signature of function is identical to Highs_passModel, without the arguments for passing the Hessian matrix of a quadratic program.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passModel — Method
Highs_passModel(highs, num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, integrality)

Pass a model to HiGHS in a single function call. This is faster than constructing the model using Highs_addRow and Highs_addCol.

Arguments

  • highs: A pointer to the Highs instance.
  • num_col: The number of columns.
  • num_row: The number of rows.
  • num_nz: The number of elements in the constraint matrix.
  • q_num_nz: The number of elements in the Hessian matrix.
  • a_format: The format of the constraint matrix to use in the form of a kHighsMatrixFormat constant.
  • q_format: The format of the Hessian matrix to use in the form of a kHighsHessianFormat constant.
  • sense: The optimization sense in the form of a kHighsObjSense constant.
  • offset: The constant term in the objective function.
  • col_cost: An array of length [num_col] with the objective coefficients.
  • col_lower: An array of length [num_col] with the lower column bounds.
  • col_upper: An array of length [num_col] with the upper column bounds.
  • row_lower: An array of length [num_row] with the upper row bounds.
  • row_upper: An array of length [num_row] with the upper row bounds.
  • a_start: The constraint matrix is provided to HiGHS in compressed sparse column form (if a_format is kHighsMatrixFormatColwise, otherwise compressed sparse row form). The sparse matrix consists of three arrays, a_start, a_index, and a_value. a_start is an array of length [num_col] containing the starting index of each column in a_index. If a_format is kHighsMatrixFormatRowwise the array is of length [num_row] corresponding to each row.
  • a_index: An array of length [num_nz] with indices of matrix entries.
  • a_value: An array of length [num_nz] with values of matrix entries.
  • q_start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form). The sparse matrix consists of three arrays, q_start, q_index, and q_value. q_start is an array of length [num_col]. If the model is linear, pass NULL.
  • q_index: An array of length [q_num_nz] with indices of matrix entries. If the model is linear, pass NULL.
  • q_value: An array of length [q_num_nz] with values of matrix entries. If the model is linear, pass NULL.
  • integrality: An array of length [num_col] containing a kHighsVarType constant for each column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passModelName — Method
Highs_passModelName(highs, name)

Pass the name of the model.

Arguments

  • highs: A pointer to the Highs instance.
  • name: The name of the model.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passRowName — Method
Highs_passRowName(highs, row, name)

Pass the name of a row.

Arguments

  • highs: A pointer to the Highs instance.
  • row: The row for which the name is supplied.
  • name: The name of the row.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_postsolve — Method
Highs_postsolve(highs, col_value, col_dual, row_dual)

Postsolve a model using a primal (and possibly dual) solution. The postsolved solution can be retrieved later by calling Highs_getSolution.

Arguments

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col] with the column solution values.
  • col_dual: An array of length [num_col] with the column dual values, or a null pointer if not known.
  • row_dual: An array of length [num_row] with the row dual values, or a null pointer if not known.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_presolve — Method
Highs_presolve(highs)

Presolve a model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_qpCall — Method
Highs_qpCall(num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, col_value, col_dual, row_value, row_dual, col_basis_status, row_basis_status, model_status)

Formulate and solve a quadratic program using HiGHS.

The signature of this method is identical to Highs_lpCall, except that it has additional arguments for specifying the Hessian matrix.

Arguments

  • q_num_nz: The number of nonzeros in the Hessian matrix.
  • q_format: The format of the Hessian matrix in the form of a kHighsHessianStatus constant. If q_num_nz > 0, this must be kHighsHessianFormatTriangular.
  • q_start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form). The sparse matrix consists of three arrays, q_start, q_index, and q_value. q_start is an array of length [num_col].
  • q_index: An array of length [q_num_nz] with indices of matrix entries.
  • q_value: An array of length [q_num_nz] with values of matrix entries.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_readModel — Method
Highs_readModel(highs, filename)

Read a model from filename into highs.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The filename to read.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_readOptions — Method
Highs_readOptions(highs, filename)

Read the option values from file.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The filename from which to read the option values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_releaseMemory — Method
Highs_releaseMemory(highs)

Release all retained memory back to the allocator.

Clears all solver state and shrinks internal vectors to free unused capacity. Useful in long-running services that reuse a Highs instance across multiple solves to prevent unbounded RSS growth from heap fragmentation.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_repairCallbackSolution — Method
Highs_repairCallbackSolution(data_in)

Finds a feasible solution for a given (partial) primal user solution, within a valid callback.

On success, the user solution is updated within the callback input data instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_resetGlobalScheduler — Method
Highs_resetGlobalScheduler(blocking)

Releases all resources held by the global scheduler instance.

It is not thread-safe to call this function while calling Highs_run or one of the Highs_XXXcall methods on any other Highs instance in any thread.

After this function has terminated, it is guaranteed that eventually all previously created scheduler threads will terminate and allocated memory will be released.

After this function has returned, the option value for the number of threads may be altered to a new value before the next call to Highs_run or one of the Highs_XXXcall methods.

Arguments

  • blocking: If the blocking parameter has a nonzero value, then this function will not return until all memory is freed, which might be desirable when debugging heap memory, but it requires the calling thread to wait for all scheduler threads to wake-up which is usually not necessary.

Returns

No status is returned since the function call cannot fail. Calling this function while any Highs instance is in use on any thread is undefined behavior and may cause crashes, but cannot be detected and hence is fully in the callers responsibility.

source
Highs_resetOptions — Method
Highs_resetOptions(highs)

Reset all options to their default value.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_run — Method
Highs_run(highs)

Optimize a model. The algorithm used by HiGHS depends on the options that have been set.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_scaleCol — Method
Highs_scaleCol(highs, col, scaleval)

Scale a column by a constant.

Scaling a column modifies the elements in the constraint matrix, the variable bounds, and the objective coefficient.

Arguments

  • highs: A pointer to the Highs instance.
  • col: The index of the column to scale.
  • scaleval: The value by which to scale the column. If scaleval < 0, the variable bounds flipped.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_scaleRow — Method
Highs_scaleRow(highs, row, scaleval)

Scale a row by a constant.

Arguments

  • highs: A pointer to the Highs instance.
  • row: The index of the row to scale.
  • scaleval: The value by which to scale the row. If scaleval < 0, the row bounds are flipped.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setBasis — Method
Highs_setBasis(highs, col_status, row_status)

Set a basic feasible solution by passing the column and row basis statuses to the model.

Arguments

  • highs: A pointer to the Highs instance.
  • col_status: an array of length [num_col] with the column basis status in the form of kHighsBasisStatus constants
  • row_status: an array of length [num_row] with the row basis status in the form of kHighsBasisStatus constants

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setBoolOptionValue — Method
Highs_setBoolOptionValue(highs, option, value)

Set a boolean-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setCallback — Method
Highs_setCallback(highs, user_callback, user_callback_data)

Set the callback method to use for HiGHS

Arguments

  • highs: A pointer to the Highs instance.
  • user_callback: A pointer to the user callback
  • user_callback_data: A pointer to the user callback data

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setCallbackSolution — Method
Highs_setCallbackSolution(data_in, num_entries, value)

Set a solution within a callback by passing a subset of the values.

For any values that are unavailable/unknown, pass kHighsUndefined.

Arguments

  • data_in: A pointer to the callback input data instance.
  • num_entries: Number of variables in the set
  • value: An array of length [num_entries <= num_col] with column solution values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setCallbackSparseSolution — Method
Highs_setCallbackSparseSolution(data_in, num_entries, index, value)

Set a partial primal solution by passing values for a set of variables, within a valid callback.

Arguments

  • data_in: A pointer to the callback input data instance.
  • num_entries: Number of variables in the set
  • index: Indices of variables in the set
  • value: Values of variables in the set

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setDoubleOptionValue — Method
Highs_setDoubleOptionValue(highs, option, value)

Set a double-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setIntOptionValue — Method
Highs_setIntOptionValue(highs, option, value)

Set an int-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setLogicalBasis — Method
Highs_setLogicalBasis(highs)

Set a logical basis in the model.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setSolution — Method
Highs_setSolution(highs, col_value, row_value, col_dual, row_dual)

Set a solution by passing the column and row primal and dual solution values.

For any values that are unavailable, pass NULL.

Arguments

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col] with the column solution values.
  • row_value: An array of length [num_row] with the row solution values.
  • col_dual: An array of length [num_col] with the column dual values.
  • row_dual: An array of length [num_row] with the row dual values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setSparseSolution — Method
Highs_setSparseSolution(highs, num_entries, index, value)

Set a partial primal solution by passing values for a set of variables

Arguments

  • highs: A pointer to the Highs instance.
  • num_entries: Number of variables in the set
  • index: Indices of variables in the set
  • value: Values of variables in the set

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setStringOptionValue — Method
Highs_setStringOptionValue(highs, option, value)

Set a string-valued option.

Arguments

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_startCallback — Method
Highs_startCallback(highs, callback_type)

Start callback of given type

Arguments

  • highs: A pointer to the Highs instance.
  • callback_type: The type of callback to be started

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_stopCallback — Method
Highs_stopCallback(highs, callback_type)

Stop callback of given type

Arguments

  • highs: A pointer to the Highs instance.
  • callback_type: The type of callback to be stopped

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_version — Method
Highs_version()

Return the HiGHS version number as a string of the form "vX.Y.Z".

Returns

The HiGHS version as a char*.

source
Highs_versionMajor — Method
Highs_versionMajor()

Return the HiGHS major version number.

Returns

The HiGHS major version number.

source
Highs_versionMinor — Method
Highs_versionMinor()

Return the HiGHS minor version number.

Returns

The HiGHS minor version number.

source
Highs_versionPatch — Method
Highs_versionPatch()

Return the HiGHS patch version number.

Returns

The HiGHS patch version number.

source
Highs_writeModel — Method
Highs_writeModel(highs, filename)

Write the model in highs to filename.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The filename to write.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeOptions — Method
Highs_writeOptions(highs, filename)

Write the current options to file.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The filename to write the options to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeOptionsDeviations — Method
Highs_writeOptionsDeviations(highs, filename)

Write the value of non-default options to file.

This is similar to Highs_writeOptions, except only options with non-default value are written to filename.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The filename to write the options to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writePresolvedModel — Method
Highs_writePresolvedModel(highs, filename)

Write the presolved model in highs to filename.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The filename to write.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeSolution — Method
Highs_writeSolution(highs, filename)

Write the solution information (including dual and basis status, if available) to a file.

See also: Highs_writeSolutionPretty.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The name of the file to write the results to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeSolutionPretty — Method
Highs_writeSolutionPretty(highs, filename)

Write the solution information (including dual and basis status, if available) to a file in a human-readable format.

The method identical to Highs_writeSolution, except that the printout is in a human-readable format.

Arguments

  • highs: A pointer to the Highs instance.
  • filename: The name of the file to write the results to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_zeroAllClocks — Method
Highs_zeroAllClocks(highs)

Reset the clocks in a highs model.

Each highs model contains a single instance of clock that records how much time is spent in various parts of the algorithm. This clock is not reset on entry to Highs_run, so repeated calls to Highs_run report the cumulative time spent in the algorithm. A side-effect is that this will trigger a time limit termination once the cumulative run time exceeds the time limit, rather than the run time of each individual call to Highs_run.

As a work-around, call Highs_zeroAllClocks before each call to Highs_run.

Arguments

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source