A C++ Second Order Cone Solver for problems of the form
The last constraint is generalized and includes both the positive orthant and second order cones, so that the top rows of G
represent the linear constraints
and the remaining rows contain stacked representations of the second order cones:
#include "eicos.hpp"
Eigen::SparseMatrix<double> G, A;
Eigen::VectorXd c, h, b;
Eigen::VectorXi q;
// (Set up problem data)
// Construct a solver instance
EiCOS::Solver solver(G, A, c, h, b, q);
// Solve the problem
solver.solve()
// Save the solution
Eigen::VectorXd s = solver.solution();
// (Change entries in G, A, c, h, b)
// Update problem data: Using this method instead of constructing a new problem can
// save a lot of time, especially for larger problems. The only restriction is that
// the sparsity pattern and dimensions must be the same as in the original problem.
solver.updateData(G, A, c, h, b);
// Rinse and repeat
solver.solve()
Eigen
for linear algebra functionalityfmt
(optional) for printing and formatting
To use the solver with a cmake project, simply include the subdirectory and link the library.
add_subdirectory(EiCOS)
target_link_libraries(my_library eicos)
This solver is entirely based on ECOS.
- Alexander Domahidi (ECOS principal developer)
- Eric Chu (ECOS unit tests)
- Stephen Boyd (methods and maths)