Skip to content

Commit

Permalink
Update to [email protected] (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Oct 19, 2024
1 parent c736c02 commit 7db9d47
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
HiGHS_jll = "=1.5.1, =1.5.3, =1.6.0, =1.7.0, =1.7.1, =1.7.2"
HiGHS_jll = "=1.5.1, =1.5.3, =1.6.0, =1.7.0, =1.7.1, =1.7.2, =1.8.0"
MathOptInterface = "1.21"
PrecompileTools = "1"
SparseArrays = "1.6"
Expand Down
131 changes: 111 additions & 20 deletions src/gen/libhighs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

const HighsInt = Cint

"""
HighsCallbackDataOut
Struct to handle callback output data
"""
struct HighsCallbackDataOut
log_type::Cint
running_time::Cdouble
Expand All @@ -16,6 +21,7 @@ struct HighsCallbackDataOut
pdlp_iteration_count::HighsInt
objective_function_value::Cdouble
mip_node_count::Int64
mip_total_lp_iterations::Int64
mip_primal_bound::Cdouble
mip_dual_bound::Cdouble
mip_gap::Cdouble
Expand Down Expand Up @@ -97,8 +103,8 @@ The signature of this method is identical to [`Highs_lpCall`](@ref), except that
### 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 in the same format as the constraint matrix, using `q_start`, `q_index`, and `q_value` in the place of `a_start`, `a_index`, and `a_value`.
* `q_index`: An array of length [q\\_num\\_nz] with indices of matrix sentries.
* `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.
Expand Down Expand Up @@ -195,18 +201,6 @@ function Highs_githash()
ccall((:Highs_githash, libhighs), Ptr{Cchar}, ())
end

"""
Highs_compilationDate()
Return the HiGHS compilation date.
### Returns
Thse HiGHS compilation date.
"""
function Highs_compilationDate()
ccall((:Highs_compilationDate, libhighs), Ptr{Cchar}, ())
end

"""
Highs_readModel(highs, filename)
Expand Down Expand Up @@ -237,6 +231,21 @@ function Highs_writeModel(highs, filename)
ccall((:Highs_writeModel, libhighs), HighsInt, (Ptr{Cvoid}, Ptr{Cchar}), highs, filename)
end

"""
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.
"""
function Highs_writePresolvedModel(highs, filename)
ccall((:Highs_writePresolvedModel, libhighs), HighsInt, (Ptr{Cvoid}, Ptr{Cchar}), highs, filename)
end

"""
Highs_clear(highs)
Expand Down Expand Up @@ -413,7 +422,7 @@ Pass a model to HiGHS in a single function call. This is faster than constructin
* `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 in the same format as the constraint matrix, using `q_start`, `q_index`, and `q_value` in the place of `a_start`, `a_index`, and `a_value`. If the model is linear, pass NULL.
* `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.
Expand All @@ -434,7 +443,7 @@ Set the Hessian matrix for a quadratic objective.
* `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 upper 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`.
* `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
Expand Down Expand Up @@ -476,6 +485,21 @@ function Highs_passColName(highs, col, name)
ccall((:Highs_passColName, libhighs), HighsInt, (Ptr{Cvoid}, HighsInt, Ptr{Cchar}), highs, col, name)
end

"""
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.
"""
function Highs_passModelName(highs, name)
ccall((:Highs_passModelName, libhighs), HighsInt, (Ptr{Cvoid}, Ptr{Cchar}), highs, name)
end

"""
Highs_readOptions(highs, filename)
Expand Down Expand Up @@ -1138,6 +1162,23 @@ function Highs_setSolution(highs, col_value, row_value, col_dual, row_dual)
ccall((:Highs_setSolution, libhighs), HighsInt, (Ptr{Cvoid}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), highs, col_value, row_value, col_dual, row_dual)
end

"""
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.
"""
function Highs_setSparseSolution(highs, num_entries, index, value)
ccall((:Highs_setSparseSolution, libhighs), HighsInt, (Ptr{Cvoid}, HighsInt, Ptr{HighsInt}, Ptr{Cdouble}), highs, num_entries, index, value)
end

"""
Highs_setCallback(highs, user_callback, user_callback_data)
Expand Down Expand Up @@ -2241,6 +2282,28 @@ function Highs_getRanging(highs, col_cost_up_value, col_cost_up_objective, col_c
ccall((:Highs_getRanging, libhighs), HighsInt, (Ptr{Cvoid}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}), 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)
end

"""
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.
"""
function Highs_feasibilityRelaxation(highs, global_lower_penalty, global_upper_penalty, global_rhs_penalty, local_lower_penalty, local_upper_penalty, local_rhs_penalty)
ccall((:Highs_feasibilityRelaxation, libhighs), HighsInt, (Ptr{Cvoid}, Cdouble, Cdouble, Cdouble, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), highs, global_lower_penalty, global_upper_penalty, global_rhs_penalty, local_lower_penalty, local_upper_penalty, local_rhs_penalty)
end

"""
Highs_resetGlobalScheduler(blocking)
Expand All @@ -2261,6 +2324,33 @@ function Highs_resetGlobalScheduler(blocking)
ccall((:Highs_resetGlobalScheduler, libhighs), Cvoid, (HighsInt,), blocking)
end

"""
Highs_getCallbackDataOutItem(data_out, item_name)
Get a void* pointer to a callback data item
### Parameters
* `data_out`: A pointer to the [`HighsCallbackDataOut`](@ref) instance.
* `item_name`: The name of the item.
### Returns
A void* pointer to the callback data item, or NULL if item\\_name not valid
"""
function Highs_getCallbackDataOutItem(data_out, item_name)
ccall((:Highs_getCallbackDataOutItem, libhighs), Ptr{Cvoid}, (Ptr{HighsCallbackDataOut}, Ptr{Cchar}), data_out, item_name)
end

"""
Highs_compilationDate()
Return the HiGHS compilation date.
### Returns
Thse HiGHS compilation date.
"""
function Highs_compilationDate()
ccall((:Highs_compilationDate, libhighs), Ptr{Cchar}, ())
end

function Highs_call(num_col, num_row, num_nz, 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)
ccall((:Highs_call, libhighs), HighsInt, (HighsInt, HighsInt, HighsInt, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{HighsInt}, Ptr{HighsInt}, Ptr{HighsInt}), num_col, num_row, num_nz, 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)
end
Expand Down Expand Up @@ -2367,13 +2457,11 @@ const CMAKE_BUILD_TYPE = "Release"

const CMAKE_INSTALL_PREFIX = "/workspace/destdir"

const HIGHS_GITHASH = "50670fd4c"

const HIGHS_COMPILATION_DATE = "1970-01-01"
const HIGHS_GITHASH = "fcfb53414"

const HIGHS_VERSION_MAJOR = 1

const HIGHS_VERSION_MINOR = 7
const HIGHS_VERSION_MINOR = 8

const HIGHS_VERSION_PATCH = 0

Expand Down Expand Up @@ -2416,6 +2504,7 @@ const kHighsPresolveStatusReducedToEmpty = HighsInt(4)
const kHighsPresolveStatusTimeout = HighsInt(5)
const kHighsPresolveStatusNullError = HighsInt(6)
const kHighsPresolveStatusOptionsError = HighsInt(7)
const kHighsPresolveStatusOutOfMemory = HighsInt(8)
const kHighsModelStatusNotset = HighsInt(0)
const kHighsModelStatusLoadError = HighsInt(1)
const kHighsModelStatusModelError = HighsInt(2)
Expand Down Expand Up @@ -2446,3 +2535,5 @@ const kHighsCallbackMipSolution = HighsInt(3)
const kHighsCallbackMipImprovingSolution = HighsInt(4)
const kHighsCallbackMipLogging = HighsInt(5)
const kHighsCallbackMipInterrupt = HighsInt(6)
const kHighsCallbackMipGetCutPool = HighsInt(7)
const kHighsCallbackMipDefineLazyConstraints = HighsInt(8)

0 comments on commit 7db9d47

Please sign in to comment.