51    size_t n = work->
data->
n;
 
   52    size_t m = work->
data->
m;
 
 
   78    c_float sigma_temp, mult_factor;
 
   81    for (k = 0; k < work->
data->
m; k++) {
 
   84            sigma_temp = mult_factor * work->
sigma[k];
 
   85            if (sigma_temp <= work->settings->sigma_max) { 
 
   86                if (work->
sigma[k] != sigma_temp) {
 
   90                work->
sigma[k] = sigma_temp;
 
   92                mult_factor = 
c_sqrt(mult_factor);
 
   94                At_scalex[k] = mult_factor;
 
 
  144        size_t nb_active = 0;
 
  145        for (
size_t i = 0; i < work->
data->
m; i++){
 
  164            A = ladel_transpose(At, 
TRUE, c);
 
  165            AtsigmaA = ladel_mat_mat_transpose(At, A, c);
 
  171        A = ladel_sparse_free(A);
 
  172        At = ladel_sparse_free(At);
 
  173        AtsigmaA = ladel_sparse_free(AtsigmaA);
 
  177    if (prev_gamma != work->
gamma) {
 
 
  290    size_t n = work->
data->
n;
 
  295            for (; i <= n-4; i+=4) {
 
  296                objective +=  (0.5*(work->
Qx[i] - 1/work->
gamma*work->
x[i]) + work->
data->
q[i])*work->
x[i] 
 
  297                            + (0.5*(work->
Qx[i+1] - 1/work->
gamma*work->
x[i+1]) + work->
data->
q[i+1])*work->
x[i+1]
 
  298                            + (0.5*(work->
Qx[i+2] - 1/work->
gamma*work->
x[i+2]) + work->
data->
q[i+2])*work->
x[i+2] 
 
  299                            + (0.5*(work->
Qx[i+3] - 1/work->
gamma*work->
x[i+3]) + work->
data->
q[i+3])*work->
x[i+3];
 
  303            objective += (0.5*(work->
Qx[i] - 1/work->
gamma*work->
x[i])+ work->
data->
q[i])*work->
x[i];
 
  307            for (; i <= n-4; i+=4) {
 
  308                objective += (0.5*work->
Qx[i] + work->
data->
q[i])*work->
x[i] 
 
  309                            + (0.5*work->
Qx[i+1] + work->
data->
q[i+1])*work->
x[i+1]
 
  310                            + (0.5*work->
Qx[i+2] + work->
data->
q[i+2])*work->
x[i+2] 
 
  311                            + (0.5*work->
Qx[i+3] + work->
data->
q[i+3])*work->
x[i+3];
 
  315            objective += (0.5*work->
Qx[i] + work->
data->
q[i])*work->
x[i];
 
  323    objective += work->
data->
c;
 
 
  336    for (
size_t i = 0; i < work->
data->
m; i++) {
 
  337      dual_objective -= work->
y[i] > 0 ? work->
y[i]*work->
data->
bmax[i] : work->
y[i]*work->
data->
bmin[i];
 
  344    dual_objective += work->
data->
c;
 
  346    return dual_objective;
 
 
#define FACTORIZE_SCHUR
factorize the Schur complement
 
#define FACTORIZE_KKT
factorize the kkt system
 
#define c_sqrt
square root
 
ladel_int c_int
type for integer numbers
 
ladel_double c_float
type for floating point numbers
 
#define c_max(a, b)
maximum of two values
 
#define c_absval(x)
absolute value
 
#define c_min(a, b)
minimum of two values
 
void initialize_sigma(QPALMWorkspace *work, solver_common *c)
Initialize penalty factors from initial x.
 
c_float compute_dual_objective(QPALMWorkspace *work, solver_common *c)
Compute the (unscaled) dual objective value at the current iterate.
 
void update_dual_iterate_and_parameters(QPALMWorkspace *work, solver_common *c, c_int iter_out, c_float *eps_k_abs, c_float *eps_k_rel)
 
void update_gamma(QPALMWorkspace *work)
Update the proximal penalty.
 
void update_proximal_point_and_penalty(QPALMWorkspace *work, solver_common *c, c_int iter_out, c_float *eps_k_abs, c_float *eps_k_rel)
 
void update_sigma(QPALMWorkspace *work, solver_common *c)
Update the penalty factors.
 
void update_or_boost_gamma(QPALMWorkspace *work, solver_common *c, c_int iter_out)
 
void update_primal_iterate(QPALMWorkspace *work, solver_common *c)
Update the primal iterate.
 
c_float compute_objective(QPALMWorkspace *work)
Compute the (unscaled) primal objective value at the current iterate.
 
void boost_gamma(QPALMWorkspace *work, solver_common *c)
Maximize the proximal penalty.
 
void compute_residuals(QPALMWorkspace *work, solver_common *c)
Compute the residuals (in vector form)
 
QPALM main solver routines.
 
void vec_add_scaled(const c_float *a, const c_float *b, c_float *c, c_float sc, size_t n)
Scaled addition of one vector to another vector, .
 
void vec_set_scalar(c_float *a, c_float sc, size_t n)
Fill float vector with a scalar value.
 
void vec_ew_div(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise division, .
 
void vec_self_mult_scalar(c_float *a, c_float sc, size_t n)
Mulitply vector with a constant scale factor.
 
void vec_ew_mid_vec(const c_float *a, const c_float *bmin, const c_float *bmax, c_float *c, size_t n)
Elementwise mid between vectors, .
 
void vec_ew_prod(const c_float *a, const c_float *b, c_float *c, size_t n)
Elementwise product, .
 
c_float vec_prod(const c_float *a, const c_float *b, size_t n)
Inner product between two vectors, .
 
void prea_vec_copy(const c_float *a, c_float *b, size_t n)
Copy vector a into preallocated vector b.
 
c_float vec_norm_inf(const c_float *a, size_t n)
Infinity norm of a vector, .
 
void vec_ew_recipr(const c_float *a, c_float *b, size_t n)
Elementwise reciprocal .
 
void vec_ew_sqrt(const c_float *a, c_float *b, size_t n)
Elementwise square root, .
 
Linear algebra with vectors.
 
c_float exact_linesearch(QPALMWorkspace *work, solver_common *c)
Execute exact linesearch (using qsort)
 
Routines to perform exact linesearch.
 
void set_entering_leaving_constraints(QPALMWorkspace *work)
Determines the entering and leaving constraints and stores them in work->solver->enter and work->solv...
 
void set_active_constraints(QPALMWorkspace *work)
Computes the set of active constraints and stores it in work->solver->active_constraints.
 
void newton_set_direction(QPALMWorkspace *work, solver_common *c)
Sets work->d to the direction calculated by the semismooth Newton method.
 
Functions to calculate the semismooth Newton direction.
 
c_float gershgorin_max(solver_sparse *M, c_float *center, c_float *radius)
Calculate the Gershgorin upper bound for the eigenvalues of a symmetric matrix.
 
Routines to deal with nonconvex QPs.
 
void ldlupdate_sigma_changed(QPALMWorkspace *work, solver_common *c)
Update the  factorization given a set of indexes where  has been updated.
 
void mat_tpose_vec(solver_sparse *A, solver_dense *x, solver_dense *y, solver_common *c)
Matrix-transpose-vector multiplication.
 
Interface and wrapper to matrix/factorization (ladel) functions.
 
size_t m
number of constraints m
 
c_float * bmin
dense array for lower bounds (size m)
 
c_float c
constant part of cost
 
size_t n
number of variables n
 
c_float * q
dense array for linear part of cost function (size n)
 
solver_sparse * A
sparse linear constraints matrix A (size m x n)
 
c_float * bmax
dense array for upper bounds (size m)
 
c_float pri_res_norm
norm of primal residual
 
c_float * Einv
dual variable rescaling
 
c_float cinv
objective rescaling
 
c_float gamma_upd
proximal penalty update factor
 
c_float sigma_max
penalty factor cap
 
c_float gamma_max
proximal penalty parameter cap
 
c_int proximal
boolean, use proximal method of multipliers or not
 
c_float delta
penalty update factor
 
c_float sigma_init
initial penalty parameter (guideline)
 
c_float rho
tolerance scaling factor
 
c_float theta
penalty update criterion parameter
 
c_int max_rank_update
maximum rank for the sparse factorization update
 
c_float max_rank_update_fraction
maximum rank (relative to n+m) for the factorization update
 
c_float eps_rel
relative convergence tolerance
 
c_int scaling
scaling iterations, if 0 then scaling is disabled
 
c_int nonconvex
boolean, indicates whether the QP is nonconvex
 
c_float eps_abs
absolute convergence tolerance
 
solver_sparse * At_sqrt_sigma
A' * sqrt(sigma)
 
c_int * active_constraints
index set of active constraints
 
solver_dense * yh
candidate dual update
 
c_int reset_newton
boolean, after sigma is updated perform a new factorization
 
c_int factorization_method
factorize KKT or Schur complement
 
c_int * enter
index set of entering constraints
 
c_int first_factorization
boolean, indicate we have not factorized previously
 
solver_dense * At_scale
running vector of sqrt(sigma), used to scale At_sqrt_sigma
 
solver_dense * Atyh
A' * yh.
 
solver_factor * LD_Q
LD factor of Q (useful in computing dual objective)
 
c_int nb_leave
number of leaving constraints
 
c_int nb_active_constraints
number of active constraints
 
c_int nb_enter
number of entering constraints
 
c_float * x
primal iterate
 
c_float * yh
candidate dual update
 
QPALMScaling * scaling
scaling vectors
 
c_int nb_sigma_changed
number of sigma-components that changed in an outer iteration (relevant for factorization update)
 
c_float * D_temp
temporary primal variable scaling vectors
 
c_float eps_pri
primal tolerance
 
QPALMInfo * info
solver information
 
c_float * z
projection of Axys onto the constraint set [bmin, bmax]
 
c_float * pri_res_in
intermediate primal residual
 
c_float * temp_m
placeholder for vector of size m
 
c_float * pri_res
primal residual
 
c_float * sqrt_sigma
elementwise sqrt(sigma)
 
c_float * sigma
penalty vector
 
c_float * x_prev
previous primal iterate
 
c_float * neg_dphi
-dphi, required as the rhs in SCHUR
 
c_float * Axys
Ax + y./sigma.
 
c_int gamma_maxed
flag to indicate whether gamma has been maximized when the primal residual was low
 
c_float sqrt_sigma_max
sqrt(sigma_max)
 
c_float * dphi_prev
previous gradient of the Lagrangian
 
c_float eps_rel_in
intermediate relative tolerance
 
QPALMSettings * settings
problem settings
 
c_float * x0
record of the primal iterate during the last dual update
 
c_float * sigma_inv
1./sigma
 
c_float gamma
proximal penalty factor
 
c_float * dphi
gradient of the Lagrangian
 
c_float * df
gradient of the primal objective (+proximal term)
 
QPALMSolver * solver
linsys variables
 
c_float * temp_2m
placeholder for vector of size 2m
 
c_float * Aty
A' * y (useful for saving one mat_tpose_vec)
 
c_float eps_abs_in
intermediate absolute tolerance
 
QPALMData * data
problem data to work on (possibly scaled)
 
c_float * temp_n
placeholder for vector of size n
 
c_float * d
primal update step
 
ladel_sparse_matrix solver_sparse