Coek Documentation


Coek is a C++ library for expressing and solving optimization problems. Coek enables users to express optimization models in C++, interface directly with optimization solvers, and interact with solutions generated by solvers. The design of Coek was broadly inspired by the object-oriented design in [Gurobi], but Coek is designed to support the expression of mixed-integer nonlinear programs.

Coek is closely developed with the [Poek] library, and the goal of these libraries is to support fast optimization modeling capabilities in both C++ and Python. For example:

  • Coek can express large optimization problems in C++ nearly as fast [Gurobi],

  • Coek integrates [CppAD] to compute derivatives for nonlinear problems,

  • Coek and [Poek] include mutable parameters that allow model constants to be modified in place, and

  • Poek can express large optimization problems in Python with modest overhead.

Coek and [Poek] do not currently include high-level modeling abstractions supported by [Pyomo] and [Gravity]. However, this this is not a fundamental limitation of the design of these libraries. For example, preliminary methods for expressing models with compact syntax have been developed.

Coek development is being driven by targetted experiments and demonstrations, often with runtime performance as a major driver. Although the Coek API has stabilized, it continues to evolve as new capabilities are demonstrated. Consequently, the following documentation does not provide a detailed specification of the Coek API. Rather, we focus on examples that illustrate Coek capabilities.


  • Solvers

    • Ipopt - Coek can dynamically load the Ipopt C interface.

    • Gurobi - Coek links with the Gurobi C++ interface

  • Automatic Differentiation

    • CppAD is currently supported

    • There are general hooks in Coek for alternative AD packages

  • PyCoek

    • Python wrappers are supported using pybind11 and cppyy

    • The [Poek] library simplifies the use of PyCoek for end-users

  • Documentation

    • Sphinx, Doxygen and Breathe are used to generate documentation

Table of Contents

Indices and Tables