![]() |
Epigraph
Convex Optimization in C++
|
Epigraph is a modern C++ interface to formulate and solve linear, quadratic and second order cone problems. It makes use of Eigen types and operator overloading for straightforward problem formulation.
The solvers are included as submodules for convenience. Note that some solvers have more restrictive licenses which automatically override the Epigraph license when activated. Pass the listed argument to cmake during configuration to enable the solvers.
-DENABLE_OSQP=TRUE
. Apache-2.0 License.-DENABLE_ECOS=TRUE
. GPLv3 License.To use Epigraph with a cmake project, simply enable the desired solvers, include the subdirectory and link the library.
While the example below is likely enough to get you started, the full documentation can be found here.
See the [tests](tests) for more examples, including the same problem in SOCP form.
The following terms may be passed to the constraint functions:
Function | Allowed expressions |
---|---|
equalTo() | Affine == Affine |
lessThan() | Affine <= Affine or Norm2 + Affine <= Affine (SOCP) |
greaterThan() | Affine >= Affine or Affine >= Norm2 + Affine (SOCP) |
box() | Affine <= Affine <= Affine |
addCostTerm() | Affine (SOCP) or QuadForm + Affine (QP) |
With the following expressions:
Expression | Form |
---|---|
Affine | p1 * x1 + p2 * x2 + ... + c |
Norm2 | (Affine1^2 + Affine2^2 + ...)^(1/2) |
QuadForm | x' * P * x where P is Hermitian |