QPALM 1.1.1
Proximal Augmented Lagrangian method for Quadratic Programs
solver_interface.h
Go to the documentation of this file.
1/**
2 * @file solver_interface.h
3 * @author Ben Hermans
4 * @brief Interface and wrapper to matrix/factorization (ladel) functions
5 * @details This file includes all calls to ladel functions apart from scaling in scaling.c and memory
6 * allocation/deallocation in the main functions in qpalm.c. It includes all matrix operations, such as
7 * matrix vector products, row- and columnwise norms, cholesky factorizations, factorization updates and
8 * solving the linear system.
9 *
10 */
11
12#ifndef SOLVER_INTERFACE_H
13#define SOLVER_INTERFACE_H
14
15# ifdef __cplusplus
16extern "C" {
17# endif
18
19#include "global_opts.h"
20#include "constants.h"
21#include "types.h"
22
23/**
24 * Matrix-vector multiplication.
25 *
26 * @f$y = A*x@f$
27 *
28 * @param A Sparse matrix
29 * @param x Dense input vector
30 * @param y Dense output vector
31 * @param c Solver environment
32 */
34 solver_dense *x,
35 solver_dense *y,
36 solver_common *c);
37/**
38 * Matrix-transpose-vector multiplication.
39 *
40 * @f$y = A^T*x@f$
41 *
42 * @param A Sparse matrix
43 * @param x Dense input vector
44 * @param y Dense output vector
45 * @param c Solver environment
46 */
48 solver_dense *x,
49 solver_dense *y,
50 solver_common *c);
51
52/**
53 * Choose the linear systems solver method based on the problem data sizes.
54 *
55 * This chooses between forming and solving the KKT system or the SCHUR complement.
56 * The resulting method is in work->solver->factorization_method.
57 *
58 * @param work Workspace
59 * @param c Linear systems solver environment
60 */
62 solver_common *c);
63
64#include "ladel.h"
65
66#define mat_inf_norm_cols ladel_infinity_norm_columns
67#define mat_inf_norm_rows ladel_infinity_norm_rows
68
69/**
70 * Form the KKT system
71 * @f$\begin{bmatrix}
72 * Q & A^T \\
73 * A & -\Sigma^{-1}
74 * \end{bmatrix} @f$. The result is in work->solver->kkt.
75 *
76 * @note Only the rows of A corresponding to active constraints are included in the system above.
77 * This routine also saves some structures that are useful in updating the kkt system later.
78 *
79 * @param work Workspace
80 */
82
83/**
84 * Reform the KKT system (i.e. delete constraints which are no longer active and add those that are now active).
85 *
86 * @param work Workspace
87 */
89
90/**
91 * Perform a factorization update for the entering constraints.
92 *
93 * @param work Workspace
94 * @param c Linear systems solver environment
95 */
97 solver_common *c);
98
99/**
100 * Perform a factorization update for the leaving constraints.
101 *
102 * @param work Workspace
103 * @param c Linear systems solver environment
104 */
106 solver_common *c);
107
108/**
109 * Solve the KKT system
110 * @f$\begin{bmatrix}
111 * Q + \frac{1}{\gamma}I & A^T \\
112 * A & -\Sigma^{-1}
113 * \end{bmatrix} \begin{bmatrix}
114 * d \\
115 * -\lambda
116 * \end{bmatrix} = \begin{bmatrix}
117 * -\nabla \varphi \\
118 * 0
119 * \end{bmatrix}
120 * @f$
121 *
122 * @param work Workspace
123 * @param c Linear systems solver environment
124 */
125void kkt_solve( QPALMWorkspace *work,
126 solver_common *c);
127
128
129/**
130 * Calculate @f$LDL^T@f$ factorization of a matrix @f$M@f$.
131 *
132 * If work->settings->proximal = true, use @f$M+\frac{1}{\gamma}*I@f$ instead.
133 *
134 * @param M Matrix to be factorized
135 * @param work Workspace
136 * @param c Solver environment
137 */
138void ldlchol(solver_sparse *M,
139 QPALMWorkspace *work,
140 solver_common *c);
141
142
143/**
144 * Calculate @f$LDL^T@f$ factorization of @f$Q+A{(a,:)}^T*\Sigma{(a,a)}*A{(a,:)}@f$, with @f$\Sigma=diag(\sigma)@f$ and @f$a@f$ the set of active constraints.
145 *
146 * If work->settings->proximal = true, use @f$Q+\frac{1}{\gamma}*I+A{(a,:)}^T*\Sigma{(a,a)}*A{(a,:)}@f$ instead.
147 *
148 * @param work Workspace
149 * @param c Solver environment
150 */
152 solver_common *c);
153
154/**
155 * Update the @f$LDL^T@f$ factorization given a set of entering constraints.
156 *
157 * The index set of entering constraints is assumed to be set in work->solver->enter.
158 *
159 * @param work Workspace
160 * @param c Solver environment
161 */
163 solver_common *c);
164
165/**
166 * Downdate the @f$LDL^T@f$ factorization given a set of leaving constraints.
167 *
168 * The index set of leaving constraints is assumed to be set in work->solver->leave.
169 *
170 * @param work Workspace
171 * @param c Solver environment
172 */
174 solver_common *c);
175
176/**
177 * Update the @f$LDL^T@f$ factorization given a set of indexes where @f$sigma@f$ has been updated.
178 *
179 * The index set of changed @f$sigma@f$ is assumed to be set in work->solver->enter.
180 *
181 * @param work Workspace
182 * @param c Solver environment
183 */
185 solver_common *c);
186
187
188/**
189 * Solve the linear system @f$LDL^T*d = -\nabla \varphi@f$.
190 *
191 * @param work Workspace
192 * @param c Solver environment
193 */
195 solver_common *c);
196
197
198# ifdef __cplusplus
199}
200# endif
201
202#endif // ifndef CHOLMOD_INTERFACE_H
Constants used in QPALM.
Custom memory allocation, print and utility functions, and data types for floats and ints.
void ldlsolveLD_neg_dphi(QPALMWorkspace *work, solver_common *c)
Solve the linear system .
void kkt_update_leaving_constraints(QPALMWorkspace *work, solver_common *c)
Perform a factorization update for the leaving constraints.
void qpalm_form_kkt(QPALMWorkspace *work)
Form the KKT system .
void mat_vec(solver_sparse *A, solver_dense *x, solver_dense *y, solver_common *c)
Matrix-vector multiplication.
void qpalm_set_factorization_method(QPALMWorkspace *work, solver_common *c)
Choose the linear systems solver method based on the problem data sizes.
void ldldowndate_leaving_constraints(QPALMWorkspace *work, solver_common *c)
Downdate the factorization given a set of leaving constraints.
void ldlupdate_sigma_changed(QPALMWorkspace *work, solver_common *c)
Update the factorization given a set of indexes where has been updated.
void kkt_update_entering_constraints(QPALMWorkspace *work, solver_common *c)
Perform a factorization update for the entering constraints.
void ldlcholQAtsigmaA(QPALMWorkspace *work, solver_common *c)
Calculate factorization of , with and the set of active constraints.
void mat_tpose_vec(solver_sparse *A, solver_dense *x, solver_dense *y, solver_common *c)
Matrix-transpose-vector multiplication.
void ldlchol(solver_sparse *M, QPALMWorkspace *work, solver_common *c)
Calculate factorization of a matrix .
void kkt_solve(QPALMWorkspace *work, solver_common *c)
Solve the KKT system .
void qpalm_reform_kkt(QPALMWorkspace *work)
Reform the KKT system (i.e.
void ldlupdate_entering_constraints(QPALMWorkspace *work, solver_common *c)
Update the factorization given a set of entering constraints.
QPALM Workspace.
Definition: types.h:197
Internal data structures used in QPALM.
ladel_work solver_common
Definition: types.h:18
ladel_double solver_dense
Definition: types.h:20
ladel_sparse_matrix solver_sparse
Definition: types.h:19