Struct rplex::Problem [−][src]
pub struct Problem<'a> { /* fields omitted */ }
Expand description
A CPLEX Problem.
Implementations
Add a variable to the problem. The Variable is moved into the problem. At this time, it is not possible to get a reference to it back.
The column index for the Variable is returned.
Add a constraint to the problem.
The row index for the constraint is returned.
Adds a lazy constraint to the problem.
Returns the index of the constraint. Unclear if this has any value whatsoever.
Set the objective coefficients. A Constraint object is used because it encodes a weighted sum, although it is semantically incorrect. The right-hand-side and kind of (in)equality of the Constraint are ignored.
Change the objective type. Default: ObjectiveType::Minimize
.
It is recommended to use this in conjunction with objective
coefficients set by the var!
macro rather than using
set_objective
.
Write the problem to a file named name
. At this time, it is
not possible to use a Write
object instead, as this calls C
code directly.
Add an initial solution to the problem.
vars
is an array of indices (i.e. the result of prob.add_variable
) and values
are
their values.
Solve the Problem, returning a Solution
object with the
result.