CVXGEN: Code Generation for Convex Optimization


CVXGEN generates fast custom code for small, QP-representable convex optimization problems, using an online interface with no software installation. With minimal effort, turn a mathematical problem description into a high speed solver.


  • Describe your LP or convex QP
    Describe your small, quadratic program (QP) representable problem with a simple, powerful language.

  • Automatically generate a custom solver
    CVXGEN automatically creates library-free C code for a custom, high-speed solver. This can be downloaded and used immediately, and requires nothing but a C compiler. CVXGEN also supplies a Matlab function that, with one command, downloads and builds a custom Matlab mex solver.

  • Solve your problems up to 10,000 times faster
    CVXGEN performs most transformations and optimizations offline, to make online solution as fast as possible. Code generation takes a few seconds or minutes, producing solvers that work in microseconds or milliseconds. Compared with CVX, solution times are typically at least 20 times faster, with the smallest problems showing speedup as large as 10,000×.


CVXGEN is for convex, QP-representable problems only. It works best for small problems, where the final system has around 2000 total coefficients in the constraints and objective. CVXGEN does not work well for larger problems.