This class is used to represent an optimization problem.
It stores the information needed to generate a solution using
an exact algorithm solver.
Most users should use compile()
to generate new optimization problem
objects, and the functions distributed with the package to interact
with them (e.g., base::as.list()
).
Only experts should use the fields and methods for this class directly.
Methods
Method new()
Usage
OptimizationProblem$new(ptr)
Method print()
Print concise information about the object.
Method show()
Print concise information about the object.
Method ncol()
Obtain the number of columns in the problem formulation.
Method nrow()
Obtain the number of rows in the problem formulation.
Method ncell()
Obtain the number of cells in the problem formulation.
Method modelsense()
Obtain the model sense.
Method vtype()
Obtain the decision variable types.
Method obj()
Obtain the objective function.
Method rhs()
Obtain the right-hand-side constraint values.
Method sense()
Obtain the constraint senses.
Method lb()
Obtain the lower bounds for the decision variables.
Method ub()
Obtain the upper bounds for the decision variables.
Method number_of_features()
Obtain the number of features.
Method number_of_planning_units()
Obtain the number of planning units.
Method number_of_zones()
Obtain the number of zones.
Method col_ids()
Obtain the identifiers for the columns.
Method row_ids()
Obtain the identifiers for the rows.
Method compressed_formulation()
Is the problem formulation compressed?
Method set_obj()
Set objective coefficients for the decision variables in the optimization problem.
Method set_lb()
Set lower bounds for the decision variables in the optimization problem.
Method set_ub()
Set upper bounds for the decision variables in the optimization problem.
Method remove_last_linear_constraint()
Remove last linear constraint added to a problem.
Method append_linear_constraints()
Append linear constraints to the optimization problem.
Arguments
rhs
numeric
vector with right-hand-side values.sense
character
vector with constraint sense values (i.e.,"<="
,">="
, or"="
).A
Matrix::sparseMatrix()
with constraint coefficients.row_ids
character
vector with identifier for constraints.