highs_solver {highs} | R Documentation |
Highs Solver
Description
Create a wrapper around the HiGHS
solver. Manly usefull if one wants
a low level wrapper around highs with hot-start capabilities.
Usage
highs_solver(model, control = highs_control())
Arguments
model |
an object of class |
control |
an object of class |
Details
Methods
The following methods are provided by the "highs_solver"
class.
-
solve(...)
method to be called to solve the optimization problem. Returns an integer giving the status code returned by HiGHS. -
status()
method to obtain the status from the solver. -
status_message()
method to obtain the status message from the solver. -
solution()
method to obtain the solution from the solver. -
info()
info to obtain addtional information from the solver. -
L(i, v)
method to get and set the linear part of the objective. -
A(i, j, v)
method to get and set the constraint matrix coefficients. -
cbounds(i, lhs, rhs)
method to get and set the constraint bounds (left hand-side and right hand-side). -
types(i, v)
method to get and set the variable types. -
vbounds(i, lower, upper)
method to get and set the variable bounds. -
maximum(maximize)
method to get and set the sense of the problem.
Method arguments
-
...
optional control arguments, which can be used to alter the options set via thecontrol
argument when initializing the solver. -
i
a vector of integers giving the index (vector index or row index) of the coeficcients to be altered. -
j
a vector of integers giving the index (column index) of the coeficcients to be altered. -
v
a vector of doubles giving the values of the coeficcients to be altered. -
lhs
a vector of doubles giving left hand-side. -
rhs
a vector of doubles giving right hand-side. -
lower
a vector of doubles giving the lower bounds to be altered. -
upper
a vector of doubles giving the upper bounds to be altered.
Value
an object of class "highs_solver"
.
Examples
A <- rbind(c(0, 1), c(1, 2), c(3, 2))
m <- highs_model(L = c(1.0, 1), lower = c(0, 1), upper = c(4, Inf),
A = A, lhs = c(-Inf, 5, 6), rhs = c(7, 15, Inf),
offset = 3)
solver <- highs_solver(m)