Optimization and Engineering

, Volume 13, Issue 1, pp 1–27

CVXGEN: a code generator for embedded convex optimization


DOI: 10.1007/s11081-011-9176-9

Cite this article as:
Mattingley, J. & Boyd, S. Optim Eng (2012) 13: 1. doi:10.1007/s11081-011-9176-9


CVXGEN is a software tool that takes a high level description of a convex optimization problem family, and automatically generates custom C code that compiles into a reliable, high speed solver for the problem family. The current implementation targets problem families that can be transformed, using disciplined convex programming techniques, to convex quadratic programs of modest size. CVXGEN generates simple, flat, library-free code suitable for embedding in real-time applications. The generated code is almost branch free, and so has highly predictable run-time behavior. The combination of regularization (both static and dynamic) and iterative refinement in the search direction computation yields reliable performance, even with poor quality data. In this paper we describe how CVXGEN is implemented, and give some results on the speed and reliability of the automatically generated solvers.


Convex optimizationCode generationEmbedded optimization

Copyright information

© Springer Science+Business Media, LLC 2011

Authors and Affiliations

  1. 1.Electrical EngineeringStanford UniversityStanfordUSA