# darnstrom/daqp architecture

> Architecture diagram of the GitHub repository darnstrom/daqp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darnstrom/daqp
- Repository: https://github.com/darnstrom/daqp

## Overview

##### Project type and purpose
- DAQP is an open-source, library-free C solver for convex (and certain mixed-integer) quadratic programs.
- It exposes a pure-C core engine (the solver) and multi-language wrappers (Julia, MATLAB, Python, Eigen/C++, Simulink).

##### File structure
- Top level:
- CMakeLists.txt + include/ + src/ → the core solver library (API headers in include/, implementation in src/).
- codegen/ → a small utility (codegen.c/h) to auto-generate code (likely builds custom solver instances).
- interfaces/ → subdirectories for each language interface:
– daqp-eigen (C++ wrapper using Eigen)
– daqp-julia
– daqp-matlab
– daqp-python (Cython)
– daqp-simulink
- docs/ → static site (Jekyll/GitHub Pages) with installation and usage guides.
- .github/workflows/ → CI pipelines for building, testing, packaging wheels, releases, etc.

##### README for additional insights
- Core functionality: solve quadratic programs with bound or affine constraints.
- Interfaces: high-level language bindings rely on the core C library.
- CI badges and docs link indicate automated testing across languages and platforms.

##### Final advice
- Be very detailed and capture every distinct module.
- Lay out the core at center, cluster related wrappers around it, position CI/CD and docs at edges.
- Special build steps (CMake configuration, pyproject.toml, Project.toml, MEX compilation).
- The goal is maximal clarity on how the multi-language components all depend on the single C solver core.

## Diagram (Mermaid)

```mermaid
flowchart TB
  subgraph "C-based Modules"
    subgraph "Core Solver Library"
      CMakeCore["CMakeLists.txt"]:::config
      Include["include/"]:::core
      Src["src/"]:::core
    end
    Codegen["Codegen Utility"]:::core
  end

  subgraph "Language Wrappers"
    EIGEN["Eigen/C++ Wrapper"]:::wrapper
    JULIA["Julia Wrapper"]:::wrapper
    MATLAB["MATLAB Wrapper"]:::wrapper
    PYTHON["Python Wrapper"]:::wrapper
    SIMULINK["Simulink Wrapper"]:::wrapper
  end

  CI["CI/CD (GitHub Actions & CMake)"]:::ci
  DOCS["Documentation Site (Jekyll)"]:::docs
  DocsSrc["docs/"]:::docs

  %% Relationships
  EIGEN -->|"C API calls"| Include
  JULIA -->|"C API calls"| Include
  MATLAB -->|"C API calls"| Include
  PYTHON -->|"C API calls"| Include
  SIMULINK -->|"C API calls"| Include
  Codegen -->|"invokes Core"| CMakeCore
  CI -->|"build & test"| CMakeCore
  CI -->|"build & test"| EIGEN
  CI -->|"build & test"| JULIA
  CI -->|"build & test"| MATLAB
  CI -->|"build & test"| PYTHON
  CI -->|"build & test"| SIMULINK
  CI -.->|"publish docs"| DOCS
  DOCS -->|"sources"| DocsSrc

  %% Click Events
  click CMakeCore "https://github.com/darnstrom/daqp/blob/master/CMakeLists.txt"
  click Include "https://github.com/darnstrom/daqp/blob/master/include/api.h"
  click Src "https://github.com/darnstrom/daqp/blob/master/src/api.c"
  click Codegen "https://github.com/darnstrom/daqp/blob/master/codegen/codegen.c"
  click EIGEN "https://github.com/darnstrom/daqp/blob/master/interfaces/daqp-eigen/CMakeLists.txt"
  click JULIA "https://github.com/darnstrom/daqp/blob/master/interfaces/daqp-julia/Project.toml"
  click MATLAB "https://github.com/darnstrom/daqp/blob/master/interfaces/daqp-matlab/daqp.m"
  click PYTHON "https://github.com/darnstrom/daqp/blob/master/interfaces/daqp-python/setup.py"
  click SIMULINK "https://github.com/darnstrom/daqp/blob/master/interfaces/daqp-simulink/DAQP_sfunc.c"
  click CI "https://github.com/darnstrom/daqp/blob/master/.github/workflows/ci_python.yml"
  click DOCS "https://github.com/darnstrom/daqp/blob/master/docs/_config.yml"
  click DocsSrc "https://github.com/darnstrom/daqp/blob/master/docs/index.md"

  %% Styles
  classDef core fill:#AED6F1,stroke:#1B4F72,color:#1B2631;
  classDef config fill:#85C1E9,stroke:#1B4F72,color:#1B2631;
  classDef wrapper fill:#ABEBC6,stroke:#196F3D,color:#145A32;
  classDef ci fill:#F9E79F,stroke:#9A7D0A,color:#7D6608;
  classDef docs fill:#FAD7A0,stroke:#B9770E,color:#784212;
```
