Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.2 KB

README.md

File metadata and controls

44 lines (28 loc) · 1.2 KB

ecos-cpp

Ecos-cpp is a object-oriented modern-C++ wrapper of ECOS(Embedded Conic Solver), a lightweight Second-Order Cone Programming solver. Ecos-cpp uses Eigen for its interface and is meant to be more user-friendly than the original C interface.

Second-order Cone Programming

Ecos-cpp solves the following optimization problem:

$$\begin{align}\arg\min_{x}\quad & c^T x\\ \mathrm{s.t.}\quad& h-Gx\in K\\ & Ax-b = 0\end{align}$$

where $K$ is a direct product of positive orthant $\mathbb{R}_+^p$, quadratic cone ${(y, z) | |z|_2 \le y}$ and exponential cone $\mathrm{closure}{(x,y,z) | \exp\frac{x}{z} \le \frac{y}{z}, z>0}$.

Prerequisite

  • Eigen 3
  • CMake
  • A C++ compiler that can compile C++11 (test code uses C++17 features.)

Using the library through CMake

Write the following code in your CMakeLists.txt:

add_subdirectory(<path-to-this-directory>)

...

target_link_libraries(<your-target> PUBLIC|PRIVATE ecos-cpp)

#include <ecos_cpp.hpp> in your c++ code.

Building and running tests

mkdir build
cd build
cmake .. 
make ecos-cpp-test
./ecos-cpp-test 1 1 1