| OptimizationProblem-methods | R Documentation |
These functions are used to query and update a optimization_problem().
## S4 method for signature 'OptimizationProblem'
nrow(x)
## S4 method for signature 'OptimizationProblem'
ncol(x)
## S4 method for signature 'OptimizationProblem'
ncell(x)
modelsense(x)
## S4 method for signature 'OptimizationProblem'
modelsense(x)
vtype(x)
## S4 method for signature 'OptimizationProblem'
vtype(x)
obj(x)
## S4 method for signature 'OptimizationProblem'
obj(x)
A(x)
## S4 method for signature 'OptimizationProblem'
A(x)
rhs(x)
## S4 method for signature 'OptimizationProblem'
rhs(x)
sense(x)
## S4 method for signature 'OptimizationProblem'
sense(x)
lb(x)
## S4 method for signature 'OptimizationProblem'
lb(x)
ub(x)
## S4 method for signature 'OptimizationProblem'
ub(x)
col_ids(x)
## S4 method for signature 'OptimizationProblem'
col_ids(x)
row_ids(x)
## S4 method for signature 'OptimizationProblem'
row_ids(x)
compressed_formulation(x)
## S4 method for signature 'OptimizationProblem'
compressed_formulation(x)
set_obj(x, obj)
## S4 method for signature 'OptimizationProblem,ANY'
set_obj(x, obj)
set_lb(x, lb)
## S4 method for signature 'OptimizationProblem,ANY'
set_lb(x, lb)
set_ub(x, ub)
## S4 method for signature 'OptimizationProblem,ANY'
set_ub(x, ub)
append_linear_constraints(x, rhs, sense, A, row_ids)
## S4 method for signature 'OptimizationProblem,ANY,ANY,ANY,ANY'
append_linear_constraints(x, rhs, sense, A, row_ids)
remove_last_linear_constraint(x)
## S4 method for signature 'OptimizationProblem'
remove_last_linear_constraint(x)
x |
|
obj |
|
lb |
|
ub |
|
rhs |
|
sense |
|
A |
|
row_ids |
|
The following functions are used to query data.
nrow(x)integer number of rows (constraints).
ncol(x)integer number of columns (decision variables).
ncell(x)integer number of cells.
modelsense(x)character describing if the problem is to be
maximized ("max") or minimized ("min").
vtype(x)character describing the type of each decision variable:
binary ("B"), semi-continuous ("S"), or continuous
("C")
obj(x)numeric vector specifying the objective function.
A(x)Matrix::dgCMatrix matrix object defining the
problem matrix.
rhs(x)numeric vector with right-hand-side linear constraints
sense(x)character vector with the senses of the linear
constraints ("<=", ">=", "=").
lb(x)numeric lower bound for each decision variable. Missing data
values (NA) indicate no lower bound for a given variable.
ub(x)numeric upper bounds for each decision variable. Missing
data values (NA) indicate no upper bound for a given variable.
number_of_planning_units(x)integer number of planning units in
the problem.
number_of_features(x)integer number of features
the problem.
The following functions are used to update data. Note that these
functions return an invisible TRUE indicating success.
set_obj(x, obj)override the objective in the problem.
Here, obj is a numeric vector containing a new linear coefficient for
each decision variable in the problem.
set_lb(x, lb)override the variable lower bounds in the problem.
Here, lb is a numeric vector containing a new lower bound.for each
decision variable in the problem.
set_ub(x, ub)override the variable upper bounds in the problem.
Here, ub is a numeric vector containing a new upper bound.for each
decision variable in the problem.
remove_last_linear_constraint()remove the last linear constraint added to a problem.
append_linear_constraints(x, A, sense, rhs, row_ids)add an additional linear constraints to a problem. Here,
A is a Matrix::sparseMatrix() matrix, sense is a
character vector with constraint senses (i.e., ">=", "<=", or "="
values), rhs is a numeric vector with the right-hand-side values,
and row_ids is a character vector with identifiers.
A Matrix::dgCMatrix, numeric vector,
numeric vector, or scalar integer depending on the method
used.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.