QPALM
A proximal augmented Lagrangian method for QPs.
QPALM: Proximal Augmented Lagrangian Solver for (Nonconvex) Quadratic Programs

Introduction

This is a C implementation of QPALM, a proximal augmented Lagrangian based solver for (possibly nonconvex) quadratic programs. QPALM solves problems of the form:

\begin{align*} \mbox{\Large\( \textrm{minimize \hspace{1cm}} \)} & \mbox{\Large\( \frac{1}{2}x^T Q x + q^T x \)} \\ \mbox{\Large\( \textrm{subject to \hspace{1cm}} \)} & \mbox{\Large\( b_\textrm{min} \leq Ax \leq b_\textrm{max} \)} \end{align*}

Installation

First of all, clone the repo with all the submodules! For this, run

git clone https://github.com/Benny44/QPALM_vLADEL.git
git submodule update --init --recursive

Matlab

To install the mex interface of QPALM, add QPALM and its subfolders to the matlab path. Then run qpalm_make.m. You can test whether QPALM is working using the examples/qpalm_mex_demo.m and examples/qpalm_mex_nonconvex_demo.m.

C

To install a C-callable library, check Bintray for the binaries. These were compiled against lapack and lapacke from conda. So install miniconda and run the following commands

conda install -c conda-forge lapack
conda install -c conda-forge/label/cf202003 liblapacke
export LD_LIBRARY_PATH=path-to-miniconda/lib/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=path-to-qpalm-binaries/lib/:$LD_LIBRARY_PATH

Python

The python interface unfortunately only works on Linux, not on MacOS. It has been compiled for python version 3.7. If you want to use a different version, do your own install with the instructions on custom compilation below. After following the instructions for installing the C-library above (or a custom compilation below), do

export LD_LIBRARY_PATH=path-to-qpalm-binaries/interfaces/python/build/lib/:$LD_LIBRARY_PATH
python3 path-to-qpalm-binaries/interfaces/python/qpalm_python_demo.py

Julia

Clone QPALM.jl. Follow the instructions on the C library above. In addition, copy the lib folder obtained from bintray to path-to-QPALM.jl/deps, and do

export LD_LIBRARY_PATH=path-to-QPALM.jl/deps/lib/:$LD_LIBRARY_PATH

Then from the Julia (>= 1.0) REPL, do

] dev path-to-QPALM.jl
include("test/runtests.jl")

Custom compilation

If you wish to do a custom compilation of the shared libraries, take a look at buildCustom.sh. First install the dependencies

conda install -c conda-forge lapack
conda install -c conda-forge/label/cf202003 liblapacke

Then change the following lines near the top of the script

export MINICONDA_LIB=path-to-miniconda/lib
export MINICONDA_INCLUDE=path-to-miniconda/include

Furthermore, change the cmake line to have whatever flags you want. To build the release version (with tests), use for example

cmake $curdir -DCMAKE_BUILD_TYPE=release -DCOVERAGE=ON

To build the python interface, use instead

cmake path-to-QPALM -DCMAKE_BUILD_TYPE=release -DINTERFACES=OFF -DUNITTESTS=OFF -DPYTHON=ON

Finally, run the buildCustom.sh script

chmod 755 buildCustom.sh
./buildCustom.sh

Code examples

  • For the mex interface of QPALM, check out examples/qpalm_mex_demo.m and examples/qpalm_mex_nonconvex_demo.m.
  • For the C-version of QPALM, check out examples/qpalm_demo.c.
  • For the python interface of QPALM, check out interfaces/python/qpalm_python_demo.py.
  • For the Julia interface of QPALM, check out any of the files in interfaces/QPALM.jl/test/.

Citing QPALM

If you use QPALM in your research, please cite the following paper

@inproceedings{hermans2019qpalm,
author = {Hermans, B. and Themelis, A. and Patrinos, P.},
booktitle = {58th IEEE Conference on Decision and Control},
title = {{QPALM}: {A} {N}ewton-type {P}roximal {A}ugmented {L}agrangian {M}ethod for {Q}uadratic {P}rograms},
year = {2019},
volume = {},
number = {},
pages = {},
doi = {},
issn = {},
month = {Dec.},
}

License

  • LGPL-3.0