ROS-compatible Eigen-based Goldfarb-Idnani quadratic programming solver https://asherikov.github.io/qpmad/

Alexander Sherikov a39cd70678 README: update badge 6 miesięcy temu
.github b2fd8d57d9 Fix tag workflow 6 miesięcy temu
.make f58efe0889 Drop cpput, C++14, various small fixes and updates. 6 miesięcy temu
cmake 56f6b5d4a7 More cleanups, test with ccws, style. 6 miesięcy temu
doc 6a6b5d76c4 Bump version 2 lat temu
include 56f6b5d4a7 More cleanups, test with ccws, style. 6 miesięcy temu
matlab_octave f58efe0889 Drop cpput, C++14, various small fixes and updates. 6 miesięcy temu
test 56f6b5d4a7 More cleanups, test with ccws, style. 6 miesięcy temu
.clang-format f58efe0889 Drop cpput, C++14, various small fixes and updates. 6 miesięcy temu
.fpm aeb38f1459 Generate deb package using github actions 3 lat temu
.gitignore f58efe0889 Drop cpput, C++14, various small fixes and updates. 6 miesięcy temu
.gitmodules 567d155a42 Make refactoring 2 lat temu
CHANGELOG.rst c2f9eb1dc7 Bump version 6 miesięcy temu
CMakeLists.txt c2f9eb1dc7 Bump version 6 miesięcy temu
GNUmakefile d56a881692 Rename makefiles 4 lat temu
LICENSE a94e99db76 Initial commit. 8 lat temu
Makefile d56a881692 Rename makefiles 4 lat temu
NOTICE a94e99db76 Initial commit. 8 lat temu
README.md a39cd70678 README: update badge 6 miesięcy temu
package.xml c2f9eb1dc7 Bump version 6 miesięcy temu
vcpkg.json 5caf6157b8 Rework vcpkg manifest 2 lat temu

README.md

qpmad

CI status Debian package
Build Status

Eigen-based, header-only C++ implementation of Goldfarb-Idnani dual active set algorithm for quadratic programming. The package is ROS compatible.

The solver is optimized for performance, for this reason some of the computations are omitted as described below. See https://github.com/asherikov/qpmad_benchmark for comparison with qpOASES and eiQuadProg.

Contents

Links

Features:

  • Double sided inequality constraints: lb <= A*x <= ub. Such constraints can be handled in a more efficient way than lb <= A*x commonly used in other implementations of the algorithm. A can be sparse.

  • Simple bounds: lb <= x <= ub.

  • Lazy data initialization, e.g., perform inversion of the Cholesky factor only if some of the constraints are activated.

  • Works with positive-definite problems only (add regularization if necessary).

  • Performs in-place factorization of Hessian and can reuse it on subsequent iterations. Can optionally store inverted Cholesky factor in the Hessian matrix for additional performance gain.

  • Does not compute value of the objective function.

  • Does not compute/update Lagrange multipliers for equality constraints.

  • Three types of memory allocation:

    • on demand (default);
    • on compile time using template parameters;
    • dynamic preallocation using reserve() method.

Dependencies:

  • C++14 compatible compiler
  • cmake >= 3.0
  • Eigen >= 3.3.0
  • Boost (for C++ tests)

Notes:

  1. Before computing the full step length I check that the dot product of the chosen constraint with the step direction is not zero instead of checking the norm of the step direction. The former approach makes more sense since the said dot product appears later as a divisor and we can avoid computation of a useless norm.

  2. I am aware that activation of simple bounds zeroes out parts of matrix 'J'. Unfortunately, I don't see a way to exploit this on modern hardware -- updating the whole 'J' at once is computationally cheaper than doing this line by line selectively or permuting 'J' to collect sparse rows in one place.

  3. Since the solver may arbitrarily choose violated constraints for activation, it always prefers the cheapest ones, i.e., the simple bounds. In particular, this allows to avoid computation of violations of general constraints if there are violated bounds.

  4. Vector 'd' and primal step direction are updated during partial steps instead of being computed from scratch. This, however, does not result in a significant performance improvement.

Documentation and examples

FAQ

'Non-negative step lengths expected' exception

See discussion at https://github.com/asherikov/qpmad/issues/2