C

Highs_addColMethod
Highs_addCol(highs, cost, lower, upper, num_new_nz, index, value)

Add a new column (variable) to the model.

Parameters

  • 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_addColsMethod
Highs_addCols(highs, num_new_col, costs, lower, upper, num_new_nz, starts, index, value)

Add multiple columns (variables) to the model.

Parameters

  • 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_addRowMethod
Highs_addRow(highs, lower, upper, num_new_nz, index, value)

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

Parameters

  • 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_addRowsMethod
Highs_addRows(highs, num_new_row, lower, upper, num_new_nz, starts, index, value)

Add multiple rows (linear constraints) to the model.

Parameters

  • 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_addVarMethod
Highs_addVar(highs, lower, upper)

Add a new variable to the model.

Parameters

  • 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_addVarsMethod
Highs_addVars(highs, num_new_var, lower, upper)

Add multiple variables to the model.

Parameters

  • 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_changeCoeffMethod
Highs_changeCoeff(highs, row, col, value)

Change a coefficient in the constraint matrix.

Parameters

  • 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_changeColBoundsMethod
Highs_changeColBounds(highs, col, lower, upper)

Change the variable bounds of a column.

Parameters

  • 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_changeColCostMethod
Highs_changeColCost(highs, col, cost)

Change the objective coefficient of a column.

Parameters

  • 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_changeColIntegralityMethod
Highs_changeColIntegrality(highs, col, integrality)

Change the integrality of a column.

Parameters

  • 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_changeColsBoundsByMaskMethod
Highs_changeColsBoundsByMask(highs, mask, lower, upper)

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

Parameters

  • 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_changeColsBoundsByRangeMethod
Highs_changeColsBoundsByRange(highs, from_col, to_col, lower, upper)

Change the variable bounds of multiple adjacent columns.

Parameters

  • 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_changeColsBoundsBySetMethod
Highs_changeColsBoundsBySet(highs, num_set_entries, set, lower, upper)

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

Parameters

  • 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_changeColsCostByMaskMethod
Highs_changeColsCostByMask(highs, mask, cost)

Change the cost of multiple columns given by a mask.

Parameters

  • 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_changeColsCostByRangeMethod
Highs_changeColsCostByRange(highs, from_col, to_col, cost)

Change the cost coefficients of multiple adjacent columns.

Parameters

  • 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_changeColsCostBySetMethod
Highs_changeColsCostBySet(highs, num_set_entries, set, cost)

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

Parameters

  • 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_changeColsIntegralityByMaskMethod
Highs_changeColsIntegralityByMask(highs, mask, integrality)

Change the integrality of multiple columns given by a mask.

Parameters

  • 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_changeColsIntegralityByRangeMethod
Highs_changeColsIntegralityByRange(highs, from_col, to_col, integrality)

Change the integrality of multiple adjacent columns.

Parameters

  • 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_changeColsIntegralityBySetMethod
Highs_changeColsIntegralityBySet(highs, num_set_entries, set, integrality)

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

Parameters

  • 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_changeObjectiveOffsetMethod
Highs_changeObjectiveOffset(highs, offset)

Change the objective offset of the model.

Parameters

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

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeObjectiveSenseMethod
Highs_changeObjectiveSense(highs, sense)

Change the objective sense of the model.

Parameters

  • 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_changeRowBoundsMethod
Highs_changeRowBounds(highs, row, lower, upper)

Change the bounds of a row.

Parameters

  • 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_changeRowsBoundsByMaskMethod
Highs_changeRowsBoundsByMask(highs, mask, lower, upper)

Change the bounds of multiple rows given by a mask.

Parameters

  • 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_changeRowsBoundsBySetMethod
Highs_changeRowsBoundsBySet(highs, num_set_entries, set, lower, upper)

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

Parameters

  • 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_clearMethod
Highs_clear(highs)

Reset the options and then call clearModel.

See Highs_destroy to free all associated memory.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearIntegralityMethod
Highs_clearIntegrality(highs)

Clear the integrality of all columns

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearModelMethod
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.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearSolverMethod
Highs_clearSolver(highs)

Clear all solution data associated with the model.

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

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_createMethod
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_crossoverMethod
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.

Parameters

  • 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_deleteColsByMaskMethod
Highs_deleteColsByMask(highs, mask)

Delete multiple columns given by a mask.

Parameters

  • 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_deleteColsByRangeMethod
Highs_deleteColsByRange(highs, from_col, to_col)

Delete multiple adjacent columns.

Parameters

  • 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_deleteColsBySetMethod
Highs_deleteColsBySet(highs, num_set_entries, set)

Delete multiple columns given by an array of indices.

Parameters

  • 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_deleteRowsByMaskMethod
Highs_deleteRowsByMask(highs, mask)

Delete multiple rows given by a mask.

Parameters

  • 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_deleteRowsByRangeMethod
Highs_deleteRowsByRange(highs, from_row, to_row)

Delete multiple adjacent rows.

Parameters

  • 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_deleteRowsBySetMethod
Highs_deleteRowsBySet(highs, num_set_entries, set)

Delete multiple rows given by an array of indices.

Parameters

  • 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_destroyMethod
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.

Parameters

  • highs: A pointer to the Highs instance.
source
Highs_feasibilityRelaxationMethod
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

Parameters

  • 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_getBasicVariablesMethod
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:

Parameters

  • 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_getBasisMethod
Highs_getBasis(highs, col_status, row_status)

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

Parameters

  • 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_getBasisInverseColMethod
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.

Parameters

  • 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_getBasisInverseRowMethod
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.

Parameters

  • 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_getBasisSolveMethod
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.

Parameters

  • 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_getBasisTransposeSolveMethod
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.

Parameters

  • 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_getBoolOptionValueMethod
Highs_getBoolOptionValue(highs, option, value)

Get a boolean-valued option.

Parameters

  • 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_getBoolOptionValuesMethod
Highs_getBoolOptionValues(highs, option, current_value, default_value)

Get the current and default values of a bool option

Parameters

  • 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_getCallbackDataOutItemMethod
Highs_getCallbackDataOutItem(data_out, item_name)

Get a void* pointer to a callback data item

Parameters

Returns

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

source
Highs_getColByNameMethod
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.

Parameters

  • 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_getColIntegralityMethod
Highs_getColIntegrality(highs, col, integrality)

Get the integrality of a column.

Parameters

  • col: The index of the column to query.
  • integrality: An integer 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_getColNameMethod
Highs_getColName(highs, col, name)

Get the name of a column.

Parameters

  • 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_getColsByMaskMethod
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.

Parameters

  • 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_getColsByRangeMethod
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.

Parameters

  • 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: An integer 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: An integer 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_getColsBySetMethod
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.

Parameters

  • 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_getDoubleInfoValueMethod
Highs_getDoubleInfoValue(highs, info, value)

Get a double-valued info value.

Parameters

  • 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_getDoubleOptionValueMethod
Highs_getDoubleOptionValue(highs, option, value)

Get a double-valued option.

Parameters

  • 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_getDoubleOptionValuesMethod
Highs_getDoubleOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of a double option

Parameters

  • 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_getDualRayMethod
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.

Parameters

  • highs: A pointer to the Highs instance.
  • has_dual_ray: A pointer to an int 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_getHessianNumNzMethod
Highs_getHessianNumNz(highs)

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

Parameters

  • highs: A pointer to the Highs instance.

Returns

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

source
Highs_getInfinityMethod
Highs_getInfinity(highs)

Return the value of infinity used by HiGHS.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The value of infinity used by HiGHS.

source
Highs_getInfoTypeMethod
Highs_getInfoType(highs, info, type)

Get the type expected by an info item.

Parameters

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

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getInt64InfoValueMethod
Highs_getInt64InfoValue(highs, info, value)

Get an int64-valued info value.

Parameters

  • 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_getIntInfoValueMethod
Highs_getIntInfoValue(highs, info, value)

Get an int-valued info value.

Parameters

  • 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_getIntOptionValueMethod
Highs_getIntOptionValue(highs, option, value)

Get an int-valued option.

Parameters

  • 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_getIntOptionValuesMethod
Highs_getIntOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of an int option

Parameters

  • 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_getLpMethod
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_getModelMethod
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_getModelStatusMethod
Highs_getModelStatus(highs)

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

Parameters

  • highs: A pointer to the Highs instance.

Returns

An integer corresponding to the kHighsModelStatus constant

source
Highs_getNumColMethod
Highs_getNumCol(highs)

Return the number of columns in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the model.

source
Highs_getNumNzMethod
Highs_getNumNz(highs)

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

Parameters

  • highs: A pointer to the Highs instance.

Returns

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

source
Highs_getNumOptionsMethod
Highs_getNumOptions(highs)

Return the number of options

Parameters

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

Return the number of rows in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the model.

source
Highs_getObjectiveOffsetMethod
Highs_getObjectiveOffset(highs, offset)

Get the objective offset.

Parameters

  • 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_getObjectiveSenseMethod
Highs_getObjectiveSense(highs, sense)

Get the objective sense.

Parameters

  • 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_getObjectiveValueMethod
Highs_getObjectiveValue(highs)

Get the primal objective function value.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The primal objective function value

source
Highs_getOptionNameMethod
Highs_getOptionName(highs, index, name)

Get the name of an option identified by index

Parameters

  • 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_getOptionTypeMethod
Highs_getOptionType(highs, option, type)

Get the type expected by an option.

Parameters

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

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedLpMethod
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_getPresolvedNumColMethod
Highs_getPresolvedNumCol(highs)

Return the number of columns in the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the presolved model.

source
Highs_getPresolvedNumNzMethod
Highs_getPresolvedNumNz(highs)

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

Parameters

  • highs: A pointer to the Highs instance.

Returns

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

source
Highs_getPresolvedNumRowMethod
Highs_getPresolvedNumRow(highs)

Return the number of rows in the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the presolved model.

source
Highs_getPrimalRayMethod
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.

Parameters

  • highs: A pointer to the Highs instance.
  • has_primal_ray: A pointer to an int 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_getRangingMethod
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.

Parameters

  • 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_getReducedColumnMethod
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.

Parameters

  • 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_getReducedRowMethod
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_row]. However, check row_num_nz to see how many non-zero elements are actually stored.

Parameters

  • 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_getRowByNameMethod
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.

Parameters

  • 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_getRowNameMethod
Highs_getRowName(highs, row, name)

Get the name of a row.

Parameters

  • 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_getRowsByMaskMethod
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.

Parameters

  • 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_getRowsByRangeMethod
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.

Parameters

  • 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: An integer to be populated with the number of rows got from the smodel.
  • 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: An integer 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_getRowsBySetMethod
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.

Parameters

  • 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_getRunTimeMethod
Highs_getRunTime(highs)

Return the cumulative wall-clock time spent in Highs_run.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The cumulative wall-clock time spent in Highs_run

source
Highs_getSizeofHighsIntMethod
Highs_getSizeofHighsInt(highs)

Return the size of integers used by HiGHS.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The size of integers used by HiGHS.

source
Highs_getSolutionMethod
Highs_getSolution(highs, col_value, col_dual, row_value, row_dual)

Get the primal and dual solution from an optimized model.

Parameters

  • 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_getStringOptionValueMethod
Highs_getStringOptionValue(highs, option, value)

Get a string-valued option.

Parameters

  • 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_getStringOptionValuesMethod
Highs_getStringOptionValues(highs, option, current_value, default_value)

Get the current and default values of a string option

Parameters

  • 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_githashMethod
Highs_githash()

Return the HiGHS githash.

Returns

The HiGHS githash.

source
Highs_lpCallMethod
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.

Parameters

  • 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_mipCallMethod
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.

Parameters

  • 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_passColNameMethod
Highs_passColName(highs, col, name)

Pass the name of a column.

Parameters

  • 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_passHessianMethod
Highs_passHessian(highs, dim, num_nz, format, start, index, value)

Set the Hessian matrix for a quadratic objective.

Parameters

  • 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_passLpMethod
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_passMipMethod
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_passModelMethod
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.

Parameters

  • 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_passModelNameMethod
Highs_passModelName(highs, name)

Pass the name of the model.

Parameters

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

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passRowNameMethod
Highs_passRowName(highs, row, name)

Pass the name of a row.

Parameters

  • 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_postsolveMethod
Highs_postsolve(highs, col_value, col_dual, row_dual)

Postsolve a model using a primal (and possibly dual) solution.

Parameters

  • 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_presolveMethod
Highs_presolve(highs)

Presolve a model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_qpCallMethod
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.

Parameters

  • 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_readModelMethod
Highs_readModel(highs, filename)

Read a model from filename into highs.

Parameters

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

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_readOptionsMethod
Highs_readOptions(highs, filename)

Read the option values from file.

Parameters

  • 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_resetGlobalSchedulerMethod
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.

Parameters

  • 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_resetOptionsMethod
Highs_resetOptions(highs)

Reset all options to their default value.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_runMethod
Highs_run(highs)

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

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_scaleColMethod
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.

Parameters

  • 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_scaleRowMethod
Highs_scaleRow(highs, row, scaleval)

Scale a row by a constant.

Parameters

  • 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_setBasisMethod
Highs_setBasis(highs, col_status, row_status)

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

Parameters

  • 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_setBoolOptionValueMethod
Highs_setBoolOptionValue(highs, option, value)

Set a boolean-valued option.

Parameters

  • 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_setCallbackMethod
Highs_setCallback(highs, user_callback, user_callback_data)

Set the callback method to use for HiGHS

Parameters

  • 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_setDoubleOptionValueMethod
Highs_setDoubleOptionValue(highs, option, value)

Set a double-valued option.

Parameters

  • 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_setIntOptionValueMethod
Highs_setIntOptionValue(highs, option, value)

Set an int-valued option.

Parameters

  • 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_setLogicalBasisMethod
Highs_setLogicalBasis(highs)

Set a logical basis in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setSolutionMethod
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.

Parameters

  • 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_setSparseSolutionMethod
Highs_setSparseSolution(highs, num_entries, index, value)

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

Parameters

  • 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_setStringOptionValueMethod
Highs_setStringOptionValue(highs, option, value)

Set a string-valued option.

Parameters

  • 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_startCallbackMethod
Highs_startCallback(highs, callback_type)

Start callback of given type

Parameters

  • 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_stopCallbackMethod
Highs_stopCallback(highs, callback_type)

Stop callback of given type

Parameters

  • 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_versionMethod
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_versionMajorMethod
Highs_versionMajor()

Return the HiGHS major version number.

Returns

The HiGHS major version number.

source
Highs_versionMinorMethod
Highs_versionMinor()

Return the HiGHS minor version number.

Returns

The HiGHS minor version number.

source
Highs_versionPatchMethod
Highs_versionPatch()

Return the HiGHS patch version number.

Returns

The HiGHS patch version number.

source
Highs_writeModelMethod
Highs_writeModel(highs, filename)

Write the model in highs to filename.

Parameters

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

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeOptionsMethod
Highs_writeOptions(highs, filename)

Write the current options to file.

Parameters

  • 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_writeOptionsDeviationsMethod
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.

Parameters

  • 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_writePresolvedModelMethod
Highs_writePresolvedModel(highs, filename)

Write the presolved model in highs to filename.

Parameters

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

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeSolutionMethod
Highs_writeSolution(highs, filename)

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

See also: Highs_writeSolutionPretty.

Parameters

  • 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_writeSolutionPrettyMethod
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.

Parameters

  • 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_zeroAllClocksMethod
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.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source