QPALM
A proximal augmented Lagrangian method for QPs.
qpalm.h File Reference

QPALM main solver API. More...

#include "constants.h"
#include "global_opts.h"
#include "iteration.h"
#include "lin_alg.h"
#include "linesearch.h"
#include "newton.h"
#include "nonconvex.h"
#include "scaling.h"
#include "solver_interface.h"
#include "termination.h"
#include "types.h"
#include "util.h"
#include "validate.h"

Go to the source code of this file.

Functions

Main solver API
void qpalm_set_default_settings (QPALMSettings *settings)
 Set default settings from constants.h file. More...
 
QPALMWorkspaceqpalm_setup (const QPALMData *data, const QPALMSettings *settings)
 Initialize QPALM solver allocating memory. More...
 
void qpalm_warm_start (QPALMWorkspace *work, c_float *x_warm_start, c_float *y_warm_start)
 Warm start workspace variables x, x_0, x_prev, Ax, Qx, y and sigma. More...
 
void qpalm_solve (QPALMWorkspace *work)
 Solve the quadratic program. More...
 
void qpalm_update_settings (QPALMWorkspace *work, const QPALMSettings *settings)
 Update the settings to the new settings. More...
 
void qpalm_update_bounds (QPALMWorkspace *work, const c_float *bmin, const c_float *bmax)
 Update the lower and upper bounds. More...
 
void qpalm_update_q (QPALMWorkspace *work, const c_float *q)
 Update the linear part of the cost. More...
 
void qpalm_cleanup (QPALMWorkspace *work)
 Cleanup the workspace by deallocating memory. More...
 

Detailed Description

QPALM main solver API.

Author
Ben Hermans

This file contains the main functions that can be called by the user. The user can load the default settings, setup the workspace with data and settings, warm_start the primal and dual variables, run the solver, update the settings, bounds and linear part of the cost, and finally cleanup the workspace afterwards.

Function Documentation

◆ qpalm_cleanup()

void qpalm_cleanup ( QPALMWorkspace work)

Cleanup the workspace by deallocating memory.

This function should be the called after the user is done using QPALM.

Parameters
workWorkspace

◆ qpalm_set_default_settings()

void qpalm_set_default_settings ( QPALMSettings settings)

Set default settings from constants.h file.

Assumes settings are already allocated in memory.

Parameters
settingsSettings structure

◆ qpalm_setup()

QPALMWorkspace* qpalm_setup ( const QPALMData data,
const QPALMSettings settings 
)

Initialize QPALM solver allocating memory.

All the inputs must be already allocated in memory before calling.

It performs:

  • data and settings validation
  • problem data scaling
Parameters
dataProblem data
settingsSolver settings
Returns
Solver environment

◆ qpalm_solve()

void qpalm_solve ( QPALMWorkspace work)

Solve the quadratic program.

The final solver information is stored in the work->info structure.

The solution is stored in the work->solution structure.

If the problem is primal infeasible, the certificate is stored in work->delta_y.

If the problem is dual infeasible, the certificate is stored in work->delta_x.

Parameters
workWorkspace

NB Implementation detail: store Einv*Ax and Einv*z in temp_2m. The infinity norm of that vector is equal to the maximum of the infinity norms of Einv*Ax and Einv*z.

◆ qpalm_update_bounds()

void qpalm_update_bounds ( QPALMWorkspace work,
const c_float bmin,
const c_float bmax 
)

Update the lower and upper bounds.

Use NULL to indicate that one of the bounds does not change.

Parameters
workWorkspace
bminNew lower bounds
bmaxNew upper bounds

◆ qpalm_update_q()

void qpalm_update_q ( QPALMWorkspace work,
const c_float q 
)

Update the linear part of the cost.

This causes an update of the cost scaling factor as well.

Parameters
workWorkspace
qLinear part of the objective

◆ qpalm_update_settings()

void qpalm_update_settings ( QPALMWorkspace work,
const QPALMSettings settings 
)

Update the settings to the new settings.

Warning
Decreasing settings->scaling is not allowed. Increasing it is possible.
Parameters
workWorkspace
settingsNew settings

◆ qpalm_warm_start()

void qpalm_warm_start ( QPALMWorkspace work,
c_float x_warm_start,
c_float y_warm_start 
)

Warm start workspace variables x, x_0, x_prev, Ax, Qx, y and sigma.

If x_warm_start or y_warm_start is given as NULL, then the related variables will be initialized to 0. This function also initializes the penalty parameters sigma and the matrix Asqrtsigma.

Parameters
workWorkspace
x_warm_startWarm start for the primal variables
y_warm_startWarm start for the dual variables