QPALM
A proximal augmented Lagrangian method for QPs.
types.h
Go to the documentation of this file.
1 
8 #ifndef QPALM_TYPES_H
9 # define QPALM_TYPES_H
10 
11 # ifdef __cplusplus
12 extern "C" {
13 # endif // ifdef __cplusplus
14 
15 #include "global_opts.h"
16 
17 #ifdef USE_LADEL
18 #include "ladel.h"
19 typedef ladel_work solver_common;
20 typedef ladel_sparse_matrix solver_sparse;
21 typedef ladel_double solver_dense;
22 typedef ladel_factor solver_factor;
23 typedef ladel_symbolics solver_symbolics;
24 #elif defined USE_CHOLMOD
25 #include "cholmod.h"
26 typedef cholmod_common solver_common;
27 typedef cholmod_sparse solver_sparse;
28 typedef cholmod_dense solver_dense;
29 typedef cholmod_factor solver_factor;
30 typedef void solver_symbolics;
31 
32 #endif /* USE_CHOLMOD */
33 
37 typedef struct array_element {
39  size_t i;
41 
42 
43 /******************
44 * Internal types *
45 ******************/
46 
50 typedef struct {
54 
58 typedef struct QPALM_TIMER QPALMTimer;
59 
63 typedef struct {
70 } QPALMScaling;
71 
72 
76 typedef struct {
79  char status[32];
81 
85 
88 
89  #ifdef PROFILING
93  #endif
94 
95 } QPALMInfo;
96 
97 /**********************************
98 * Main structures and Data Types *
99 **********************************/
100 
104 typedef struct {
105  size_t n;
106  size_t m;
113 } QPALMData;
114 
115 
119 typedef struct {
150 } QPALMSettings;
151 
155 typedef struct {
187 } QPALMSolver;
188 
189 
197 typedef struct {
199 
211 
238 
261 
273 
281 
291 
301 
302 
309 
310  # ifdef PROFILING
312  # endif // ifdef PROFILING
313 
315 
316 
317 # ifdef __cplusplus
318 }
319 # endif // ifdef __cplusplus
320 
321 #endif // ifndef QPALM_TYPES_H
c_float * pri_res
primal residual
Definition: types.h:227
c_float * delta_y
difference of consecutive dual iterates
Definition: types.h:279
solver_factor * LD
LD factor (part of LDL' factorization)
Definition: types.h:162
c_float * Atyh
A' * yh.
Definition: types.h:230
ladel_work solver_common
Definition: types.h:19
c_int nb_sigma_changed
number of sigma-components that changed in an outer iteration (relevant for factorization update)
Definition: types.h:222
c_int inner_max_iter
maximum number of iterations per subproblem
Definition: types.h:121
size_t i
index
Definition: types.h:39
c_int proximal
boolean, use proximal method of multipliers or not
Definition: types.h:133
solver_sparse * At
A'.
Definition: types.h:159
c_float gamma
proximal penalty factor
Definition: types.h:223
solver_symbolics * sym
symbolics for kkt (only used in LADEL)
Definition: types.h:163
solver_sparse * Q
sparse quadratic part of the cost Q (size n x n)
Definition: types.h:107
solver_dense * Atyh
A' * yh.
Definition: types.h:175
c_int * enter
index set of entering constraints
Definition: types.h:181
c_int reset_newton
boolean, after sigma is updated perform a new factorization
Definition: types.h:177
c_int * active_constraints
index set of active constraints
Definition: types.h:178
c_float * temp_2m
placeholder for vector of size 2m
Definition: types.h:254
c_float setup_time
time taken for setup phase (seconds)
Definition: types.h:90
c_float * Axys
Ax + y./sigma.
Definition: types.h:225
c_float * x_prev
previous primal iterate
Definition: types.h:209
c_float gamma_init
initial proximal penalty parameter
Definition: types.h:134
Data structure.
Definition: types.h:104
c_float dual_objective_limit
termination value for the dual objective (useful in branch and bound)
Definition: types.h:144
c_float eps_dua_in
intermediate dual tolerance
Definition: types.h:270
c_float time_limit
time limit
Definition: types.h:145
solver_dense * rhs_kkt
[-dphi; zeros(m,1)]
Definition: types.h:169
c_float * pri_res_in
intermediate primal residual
Definition: types.h:228
solver_sparse * kkt
KKT matrix.
Definition: types.h:157
ladel_double solver_dense
Definition: types.h:21
c_float * x0
record of the primal iterate during the last dual update
Definition: types.h:232
c_float * Qx
scaled Q * x
Definition: types.h:207
c_float * temp_n
placeholder for vector of size n
Definition: types.h:218
solver_factor * LD_Q
LD factor of Q (useful in computing dual objective)
Definition: types.h:164
c_float eta
linesearch parameter
Definition: types.h:250
solver_dense * yh
candidate dual update
Definition: types.h:174
c_float sqrt_sigma_max
sqrt(sigma_max)
Definition: types.h:221
c_float * y
dual iterate
Definition: types.h:205
solver_dense * D_temp
temporary primal variable scaling vectors
Definition: types.h:167
c_int warm_start
boolean, warm start
Definition: types.h:141
solver_dense * Ad
A * d.
Definition: types.h:172
Settings struct.
Definition: types.h:119
c_float * dphi
gradient of the Lagrangian
Definition: types.h:234
c_int initialized
flag whether the iterates were initialized or not
Definition: types.h:210
c_int first_factorization
boolean, indicate we have not factorized previously
Definition: types.h:176
ladel_factor solver_factor
Definition: types.h:22
c_float * neg_dphi
-dphi, required as the rhs in SCHUR
Definition: types.h:235
c_float rho
tolerance scaling factor
Definition: types.h:126
solver_sparse * kkt_full
KKT matrix if all constraints would be active.
Definition: types.h:158
c_float dua_res_norm
norm of dual residual
Definition: types.h:83
c_float * E
dual variable scaling
Definition: types.h:66
c_float * df
gradient of the primal objective (+proximal term)
Definition: types.h:231
c_float eps_rel_in
intermediate relative tolerance
Definition: types.h:272
c_int status_val
status as c_int, defined in constants.h
Definition: types.h:80
c_float x
value of the element
Definition: types.h:38
c_int * active_constraints_old
index set of active constraints in the previous iteration
Definition: types.h:179
c_int reset_newton_iter
frequency of performing a complete Cholesky factorization
Definition: types.h:142
solver_symbolics * sym_Q
symbolics for Q (only used in LADEL)
Definition: types.h:165
QPALM Workspace.
Definition: types.h:197
c_float * Einv
dual variable rescaling
Definition: types.h:67
size_t m
number of constraints m
Definition: types.h:106
Array to sort in linesearch.
Definition: types.h:37
c_float * y
dual solution
Definition: types.h:52
c_float beta
linesearch parameter
Definition: types.h:251
c_float sigma_max
penalty factor cap
Definition: types.h:131
c_float * D_temp
temporary primal variable scaling vectors
Definition: types.h:299
c_float * x
primal solution
Definition: types.h:51
c_int verbose
boolean, write out progress
Definition: types.h:139
c_int * index_P
index set P (where delta>0)
Definition: types.h:259
c_float * temp_m
placeholder for vector of size m
Definition: types.h:217
solver_dense * Qd
Q * d.
Definition: types.h:173
c_float eps_abs_in
intermediate absolute convergence tolerance
Definition: types.h:124
c_float * Ad
A * d.
Definition: types.h:247
solver_dense * E_temp
temporary constraints scaling vectors
Definition: types.h:166
c_int nb_leave
number of leaving constraints
Definition: types.h:184
c_float eps_abs
absolute convergence tolerance
Definition: types.h:122
Custom memory allocation, print and utility functions, and data types for floats and ints.
struct array_element array_element
Array to sort in linesearch.
c_float eps_prim_inf
primal infeasibility tolerance
Definition: types.h:127
solver_dense * neg_dphi
-gradient of the Lagrangian
Definition: types.h:168
c_float * bmax
dense array for upper bounds (size m)
Definition: types.h:112
c_float eps_dua
dual tolerance
Definition: types.h:269
c_float * Aty
A' * y (useful for saving one mat_tpose_vec)
Definition: types.h:208
c_float * z
projection of Axys onto the constraint set [bmin, bmax]
Definition: types.h:226
c_int iter_out
number of outer iterations (i.e. dual updates)
Definition: types.h:78
c_float * Adelta_x
A * delta_x.
Definition: types.h:290
c_float gamma_max
proximal penalty parameter cap
Definition: types.h:136
c_int factorization_method
factorize KKT or Schur complement
Definition: types.h:156
c_float c
objective scaling
Definition: types.h:68
struct QPALM_TIMER QPALMTimer
QPALM Timer for statistics.
Definition: types.h:58
solver_dense * sol_kkt
sol_kkt = kkt \ rhs_kkt
Definition: types.h:170
Solution structure.
Definition: types.h:50
c_float eps_rel_in
intermediate relative convergence tolerance
Definition: types.h:125
c_float objective
objective function value
Definition: types.h:86
c_int enable_dual_termination
boolean, enable termination based on dual objective (useful in branch and bound)
Definition: types.h:143
c_float * d
primal update step
Definition: types.h:237
QPALMSettings * settings
problem settings
Definition: types.h:305
c_float tau
stepsize
Definition: types.h:245
c_float * yh
candidate dual update
Definition: types.h:229
c_float * alpha
linesearch parameter
Definition: types.h:253
c_float gamma_upd
proximal penalty update factor
Definition: types.h:135
c_float * x
primal iterate
Definition: types.h:204
QPALMSolver * solver
linsys variables
Definition: types.h:304
c_float * delta
linesearch parameter
Definition: types.h:252
c_float * first_elem_A
value of the first element in each column of A'
Definition: types.h:161
c_float * q
dense array for linear part of cost function (size n)
Definition: types.h:109
c_float eps_pri
primal tolerance
Definition: types.h:268
c_float * E_temp
temporary constraints scaling vectors
Definition: types.h:300
QPALMTimer * timer
timer object
Definition: types.h:311
c_int * first_row_A
row index of the first element in each column of A'
Definition: types.h:160
ladel_sparse_matrix solver_sparse
Definition: types.h:20
Problem scaling matrices stored as vectors.
Definition: types.h:63
c_float solve_time
time taken for solve phase (seconds)
Definition: types.h:91
solver_sparse * At_sqrt_sigma
A' * sqrt(sigma)
Definition: types.h:186
c_float * delta2
delta .* delta
Definition: types.h:255
c_float * Qdelta_x
Q * delta_x.
Definition: types.h:289
c_int ordering
ordering method for factorization
Definition: types.h:146
c_float eps_dual_inf
dual infeasibility tolerance
Definition: types.h:128
c_float max_rank_update_fraction
maximum rank (relative to n+m) for the factorization update
Definition: types.h:149
c_float * delta_x
difference of consecutive primal iterates
Definition: types.h:288
c_float * sigma
penalty vector
Definition: types.h:219
c_float dual_objective
dual objective function value (= NaN if enable_dual_termination is false)
Definition: types.h:87
QPALMInfo * info
solver information
Definition: types.h:308
size_t n
number of variables n
Definition: types.h:105
solver_dense * d
primal update step
Definition: types.h:171
c_int max_rank_update
maximum rank for the sparse factorization update
Definition: types.h:148
c_float * sqrt_sigma
elementwise sqrt(sigma)
Definition: types.h:248
c_float * xx0
x - x0
Definition: types.h:233
c_int * index_L
index set L (where s>0)
Definition: types.h:258
c_int gamma_maxed
flag to indicate whether gamma has been maximized when the primal residual was low
Definition: types.h:224
c_int print_iter
frequency of printing
Definition: types.h:140
c_float pri_res_norm
norm of primal residual
Definition: types.h:82
QPALMData * data
problem data to work on (possibly scaled)
Definition: types.h:198
solver_dense * At_scale
running vector of sqrt(sigma), used to scale At_sqrt_sigma
Definition: types.h:185
c_float eps_rel
relative convergence tolerance
Definition: types.h:123
c_float cinv
objective rescaling
Definition: types.h:69
c_float theta
penalty update criterion parameter
Definition: types.h:129
c_float eps_abs_in
intermediate absolute tolerance
Definition: types.h:271
c_float c
constant part of cost
Definition: types.h:110
ladel_symbolics solver_symbolics
Definition: types.h:23
ladel_int c_int
type for integer numbers
Definition: global_opts.h:22
c_int nonconvex
boolean, indicates whether the QP is nonconvex
Definition: types.h:138
c_int factorization_method
factorize KKT or Schur complement
Definition: types.h:147
array_element * s
alpha ./ delta
Definition: types.h:257
c_int nb_enter
number of entering constraints
Definition: types.h:182
c_float * bmin
dense array for lower bounds (size m)
Definition: types.h:111
c_float run_time
total time (seconds)
Definition: types.h:92
c_float dua2_res_norm
norm of intermediate dual residual (minus proximal term)
Definition: types.h:84
QPALMScaling * scaling
scaling vectors
Definition: types.h:306
c_int * leave
index set of leaving constraints
Definition: types.h:183
Solver return information.
Definition: types.h:76
c_float * dphi_prev
previous gradient of the Lagrangian
Definition: types.h:236
c_float * Ax
scaled A * x
Definition: types.h:206
c_float * Dinv
primal variable rescaling
Definition: types.h:65
c_float sqrt_delta
sqrt(penalty update factor)
Definition: types.h:249
c_int iter
number of iterations taken
Definition: types.h:77
c_float sigma_init
initial penalty parameter (guideline)
Definition: types.h:132
c_float * delta_alpha
delta .* alpha
Definition: types.h:256
Variables for linear system solving.
Definition: types.h:155
c_float delta
penalty update factor
Definition: types.h:130
c_float * D
primal variable scaling
Definition: types.h:64
c_int max_iter
maximum number of iterations
Definition: types.h:120
c_float * Atdelta_y
A' * delta_y.
Definition: types.h:280
c_int nb_active_constraints
number of active constraints
Definition: types.h:180
QPALMSolution * solution
problem solution
Definition: types.h:307
c_float * sigma_inv
1./sigma
Definition: types.h:220
c_int * index_J
index set J (L xor P)
Definition: types.h:260
ladel_double c_float
type for floating point numbers
Definition: global_opts.h:21
c_float * Qd
Q * d.
Definition: types.h:246
solver_sparse * A
sparse linear constraints matrix A (size m x n)
Definition: types.h:108
c_int scaling
scaling iterations, if 0 then scaling is disabled
Definition: types.h:137