clarabel {clarabel}  R Documentation 
Clarabel solves linear programs (LPs), quadratic programs (QPs), secondorder cone programs (SOCPs) and semidefinite programs (SDPs). It also solves problems with exponential and power cone constraints. The specific problem solved is:
Minimize
\frac{1}{2}x^TPx + q^Tx
subject to
Ax + s =
b
s \in K
where x \in R^n
, s \in R^m
, P
= P^T
and nonnegativedefinite, q \in R^n
, A \in
R^{m\times n}
, and b \in R^m
. The set K
is a
composition of convex cones.
clarabel(A, b, q, P = NULL, cones, control = list(), strict_cone_order = TRUE)
A 
a matrix of constraint coefficients. 
b 
a numeric vector giving the primal constraints 
q 
a numeric vector giving the primal objective 
P 
a symmetric positive semidefinite matrix, default

cones 
a named list giving the cone sizes, see “Cone Parameters” below for specification 
control 
a list giving specific control parameters to use in place of default values, with an empty list indicating the default control parameters. Specified parameters should be correctly named and typed to avoid Rust system panics as no sanitization is done for efficiency reasons 
strict_cone_order 
a logical flag, default 
The order of the rows in matrix A
has to correspond to the
order given in the table “Cone Parameters”, which means
means rows corresponding to primal zero cones should be
first, rows corresponding to nonnegative cones second,
rows corresponding to secondorder cone third, rows
corresponding to positive semidefinite cones fourth, rows
corresponding to exponential cones fifth and rows
corresponding to power cones at last.
When the parameter strict_cone_order
is FALSE
, one can specify
the cones in any order and even repeat them in the order they
appear in the A
matrix. See below.
linear programs (LPs)
secondorder cone programs (SOCPs)
exponential cone programs (ECPs)
power cone programs (PCPs)
problems with any combination of cones, defined by the parameters listed in “Cone Parameters” below
The table below shows the cone parameter specifications
Parameter  Type  Length  Description  
z  integer  1  number of primal zero cones (dual free cones),  
which corresponds to the primal equality constraints  
l  integer  1  number of linear cones (nonnegative cones)  
q  integer  \geq1  vector of secondorder cone sizes  
s  integer  \geq1  vector of positive semidefinite cone sizes  
ep  integer  1  number of primal exponential cones  
p  numeric  \geq1  vector of primal power cone parameters 
When the parameter strict_cone_order
is FALSE
, one can specify
the cones in the order they appear in the A
matrix. The cones
argument in such a case should be a named list with names matching
^z*
indicating primal zero cones, ^l*
indicating linear cones,
and so on. For example, either of the following would be valid: list(z = 2L, l = 2L, q = 2L, z = 3L, q = 3L)
, or, list(z1 = 2L, l1 = 2L, q1 = 2L, zb = 3L, qx = 3L)
, indicating a zero
cone of size 2, followed by a linear cone of size 2, followed by a secondorder
cone of size 2, followed by a zero cone of size 3, and finally a secondorder
cone of size 3.
named list of solution vectors x, y, s and information about run
A < matrix(c(1, 1), ncol = 1)
b < c(1, 1)
obj < 1
cone < list(z = 2L)
control < clarabel_control(tol_gap_rel = 1e7, tol_gap_abs = 1e7, max_iter = 100)
clarabel(A = A, b = b, q = obj, cones = cone, control = control)