Learn R Programming

ECOSolveR

Embedded Conic Solver in R. This is an R wrapper around the ecos project on GitHub which describes ECOS as below.

ECOS is a numerical software for solving convex second-order cone programs (SOCPs) of type

$$ \mbox{Minimize } c'x \mbox{ such that } {\mathbf Ax} = {\mathbf b} \mbox{ and } {\mathbf G \mathbf x},, \leq_{\mathbf K},, {\mathbf h} $$ where the last inequality is generalized, that is, ${\mathbf h}-\mathbf{Gx}$ belongs to the cone ${\mathbf K}$.

ECOS supports the positive orthant ${\mathbf R}_+$, second-order cones ${\mathbf Q}_n$ defined as

$$ {\mathbf Q}_n = \bigl{ (t,{\mathbf x}) | t >= \lVert{\mathbf x}\rVert_2 \bigr} $$

with $t$ a scalar and ${\mathbf x} \in {\mathbf R}_{n-1}$, and the exponential cone ${\mathbf K}_e$ defined as

$$ \mathbf{K}_e = \mbox{closure} \bigl{ (x,y,z) | exp(x/z) <= y/z, z>0 \bigr}, $$

where $(x,y,z) \in {\mathbf R}^3$.

The cone ${\mathbf K}$ is therefore a direct product of the positive orthant, second-order, and exponential cones:

$$ {\mathbf K} = {\mathbf R}+ \times {\mathbf Q}{n_1} \times \cdots \times {\mathbf Q}_{n_N} \times {\mathbf K}_e \times \cdots \times {\mathbf K}_e. $$

Further Details

Note that the ECOS C language sources are included here. Changes to the original source are clearly delineated for easy reference.

Copy Link

Version

Install

install.packages('ECOSolveR')

Monthly Downloads

7,789

Version

0.6.1

License

GPL (>= 3)

Maintainer

Balasubramanian Narasimhan

Last Published

February 18th, 2026

Functions in ECOSolveR (0.6.1)

ECOS_setup

Set up an ECOS workspace for multi-step solving
ECOS_cleanup

Clean up an ECOS workspace
print.ecos_workspace

Print method for ECOS workspace objects
make_csc_matrix

Convert a plain matrix or simple triplet form matrix to a [Matrix::dgCMatrix-class] (implicit) form
ECOS_solve

Solve an ECOS workspace
ecos.control

Return the default optimization parameters for ECOS
ECOS_update

Update numerical data in an ECOS workspace
ECOS_csolve

Solve a conic optimization problem
ECOSolveR-package

ECOSolveR: Embedded Conic Solver in R
ECOS_exitcodes

ECOS solver exit codes