Creates an ECOS workspace that can be solved, updated with new numerical data, and solved again without repeating the expensive symbolic analysis phase. This is useful for parametric optimization, model predictive control, and other settings where the problem structure stays the same but data changes.
ECOS_setup(
c,
G,
h,
dims = list(l = integer(0), q = NULL, e = integer(0)),
A = NULL,
b = numeric(0),
control = ecos.control()
)an external pointer of class "ecos_workspace".
Must eventually be freed via ECOS_cleanup or R
garbage collection.
the coefficients of the objective function; the length of this determines the number of variables \(n\) in the problem.
the inequality constraint matrix in one of three forms: a
plain matrix, simple triplet matrix, or compressed column
format, e.g. dgCMatrix-class. Can also be
NULL
the right hand side of the inequality constraint. Can be empty numeric vector.
is a list of three named elements: dims['l'] an
integer specifying the dimension of positive orthant cone,
dims['q'] an integer vector specifying dimensions of
second-order cones, dims['e'] an integer specifying the
number of exponential cones
the optional equality constraint matrix in one of three
forms: a plain matrix, simple triplet matrix, or compressed
column format, e.g. dgCMatrix-class. Can be
NULL
the right hand side of the equality constraint, must be specified if \(A\) is. Can be empty numeric vector.
is a named list that controls various optimization parameters; see ecos.control.
ECOS_solve, ECOS_update,
ECOS_cleanup, ECOS_csolve