QPALM main
Proximal Augmented Lagrangian method for Quadratic Programs
Loading...
Searching...
No Matches
Functions
solver_interface.c File Reference

Detailed Description

Interface and wrapper to matrix/factorization (ladel) functions.

Author
Ben Hermans

This file includes all calls to ladel functions apart from scaling in scaling.c and memory allocation/deallocation in the main functions in qpalm.c. It includes all matrix operations, such as matrix vector products, row- and columnwise norms, cholesky factorizations, factorization updates and solving the linear system.

Definition in file solver_interface.c.

#include <qpalm/lin_alg.h>
#include <qpalm/solver_interface.h>
#include <stdio.h>
#include <ladel.h>
+ Include dependency graph for solver_interface.c:

Go to the source code of this file.

Functions

void qpalm_set_factorization_method (QPALMWorkspace *work, solver_common *c)
 Choose the linear systems solver method based on the problem data sizes.
 
void mat_vec (solver_sparse *A, solver_dense *x, solver_dense *y, solver_common *c)
 Matrix-vector multiplication.
 
void mat_tpose_vec (solver_sparse *A, solver_dense *x, solver_dense *y, solver_common *c)
 Matrix-transpose-vector multiplication.
 
void qpalm_form_kkt (QPALMWorkspace *work)
 Form the KKT system \(\begin{bmatrix} Q & A^T \\ A & -\Sigma^{-1} \end{bmatrix} \).
 
void qpalm_reform_kkt (QPALMWorkspace *work)
 Reform the KKT system (i.e.
 
void kkt_update_entering_constraints (QPALMWorkspace *work, solver_common *c)
 Perform a factorization update for the entering constraints.
 
void kkt_update_leaving_constraints (QPALMWorkspace *work, solver_common *c)
 Perform a factorization update for the leaving constraints.
 
void kkt_solve (QPALMWorkspace *work, solver_common *c)
 Solve the KKT system \(\begin{bmatrix} Q + \frac{1}{\gamma}I & A^T \\ A & -\Sigma^{-1} \end{bmatrix} \begin{bmatrix} d \\ -\lambda \end{bmatrix} = \begin{bmatrix} -\nabla \varphi \\ 0 \end{bmatrix} \).
 
void ldlchol (solver_sparse *M, QPALMWorkspace *work, solver_common *c)
 Calculate \(LDL^T\) factorization of a matrix \(M\).
 
void ldlcholQAtsigmaA (QPALMWorkspace *work, solver_common *c)
 Calculate \(LDL^T\) factorization of \(Q+A{(a,:)}^T*\Sigma{(a,a)}*A{(a,:)}\), with \(\Sigma=diag(\sigma)\) and \(a\) the set of active constraints.
 
void ldlupdate_entering_constraints (QPALMWorkspace *work, solver_common *c)
 Update the \(LDL^T\) factorization given a set of entering constraints.
 
void ldldowndate_leaving_constraints (QPALMWorkspace *work, solver_common *c)
 Downdate the \(LDL^T\) factorization given a set of leaving constraints.
 
void ldlupdate_sigma_changed (QPALMWorkspace *work, solver_common *c)
 Update the \(LDL^T\) factorization given a set of indexes where \(sigma\) has been updated.
 
void ldlsolveLD_neg_dphi (QPALMWorkspace *work, solver_common *c)
 Solve the linear system \(LDL^T*d = -\nabla \varphi\).
 

Function Documentation

◆ qpalm_set_factorization_method()

void qpalm_set_factorization_method ( QPALMWorkspace work,
solver_common c 
)

Choose the linear systems solver method based on the problem data sizes.

This chooses between forming and solving the KKT system or the SCHUR complement. The resulting method is in work->solver->factorization_method.

Parameters
workWorkspace
cLinear systems solver environment

Definition at line 18 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ mat_vec()

void mat_vec ( solver_sparse A,
solver_dense x,
solver_dense y,
solver_common c 
)

Matrix-vector multiplication.

\(y = A*x\)

Parameters
ASparse matrix
xDense input vector
yDense output vector
cSolver environment

Definition at line 73 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ mat_tpose_vec()

void mat_tpose_vec ( solver_sparse A,
solver_dense x,
solver_dense y,
solver_common c 
)

Matrix-transpose-vector multiplication.

\(y = A^T*x\)

Parameters
ASparse matrix
xDense input vector
yDense output vector
cSolver environment

Definition at line 93 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ qpalm_form_kkt()

void qpalm_form_kkt ( QPALMWorkspace work)

Form the KKT system \(\begin{bmatrix} Q & A^T \\ A & -\Sigma^{-1} \end{bmatrix} \).

The result is in work->solver->kkt.

Note
Only the rows of A corresponding to active constraints are included in the system above. This routine also saves some structures that are useful in updating the kkt system later.
Parameters
workWorkspace

Definition at line 114 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ qpalm_reform_kkt()

void qpalm_reform_kkt ( QPALMWorkspace work)

Reform the KKT system (i.e.

delete constraints which are no longer active and add those that are now active).

Parameters
workWorkspace

Definition at line 172 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ kkt_update_entering_constraints()

void kkt_update_entering_constraints ( QPALMWorkspace work,
solver_common c 
)

Perform a factorization update for the entering constraints.

Parameters
workWorkspace
cLinear systems solver environment

Definition at line 197 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ kkt_update_leaving_constraints()

void kkt_update_leaving_constraints ( QPALMWorkspace work,
solver_common c 
)

Perform a factorization update for the leaving constraints.

Parameters
workWorkspace
cLinear systems solver environment

Definition at line 215 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ kkt_solve()

void kkt_solve ( QPALMWorkspace work,
solver_common c 
)

Solve the KKT system \(\begin{bmatrix} Q + \frac{1}{\gamma}I & A^T \\ A & -\Sigma^{-1} \end{bmatrix} \begin{bmatrix} d \\ -\lambda \end{bmatrix} = \begin{bmatrix} -\nabla \varphi \\ 0 \end{bmatrix} \).

Parameters
workWorkspace
cLinear systems solver environment

Definition at line 233 of file solver_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ldlchol()

void ldlchol ( solver_sparse M,
QPALMWorkspace work,
solver_common c 
)

Calculate \(LDL^T\) factorization of a matrix \(M\).

If work->settings->proximal = true, use \(M+\frac{1}{\gamma}*I\) instead.

Parameters
MMatrix to be factorized
workWorkspace
cSolver environment

Definition at line 246 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ ldlcholQAtsigmaA()

void ldlcholQAtsigmaA ( QPALMWorkspace work,
solver_common c 
)

Calculate \(LDL^T\) factorization of \(Q+A{(a,:)}^T*\Sigma{(a,a)}*A{(a,:)}\), with \(\Sigma=diag(\sigma)\) and \(a\) the set of active constraints.

If work->settings->proximal = true, use \(Q+\frac{1}{\gamma}*I+A{(a,:)}^T*\Sigma{(a,a)}*A{(a,:)}\) instead.

Parameters
workWorkspace
cSolver environment

Definition at line 274 of file solver_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ldlupdate_entering_constraints()

void ldlupdate_entering_constraints ( QPALMWorkspace work,
solver_common c 
)

Update the \(LDL^T\) factorization given a set of entering constraints.

The index set of entering constraints is assumed to be set in work->solver->enter.

Parameters
workWorkspace
cSolver environment

Definition at line 297 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ ldldowndate_leaving_constraints()

void ldldowndate_leaving_constraints ( QPALMWorkspace work,
solver_common c 
)

Downdate the \(LDL^T\) factorization given a set of leaving constraints.

The index set of leaving constraints is assumed to be set in work->solver->leave.

Parameters
workWorkspace
cSolver environment

Definition at line 306 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ ldlupdate_sigma_changed()

void ldlupdate_sigma_changed ( QPALMWorkspace work,
solver_common c 
)

Update the \(LDL^T\) factorization given a set of indexes where \(sigma\) has been updated.

The index set of changed \(sigma\) is assumed to be set in work->solver->enter.

Parameters
workWorkspace
cSolver environment

Definition at line 315 of file solver_interface.c.

+ Here is the caller graph for this function:

◆ ldlsolveLD_neg_dphi()

void ldlsolveLD_neg_dphi ( QPALMWorkspace work,
solver_common c 
)

Solve the linear system \(LDL^T*d = -\nabla \varphi\).

Parameters
workWorkspace
cSolver environment

Definition at line 359 of file solver_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: