alpaqa
0.0.1
Nonconvex constrained optimization
|
Functions | |
void | project_y (rvec y, crvec z_lb, crvec z_ub, real_t M) |
void | update_penalty_weights (const ALMParams ¶ms, real_t Δ, bool first_iter, rvec e, rvec old_e, real_t norm_e, real_t old_norm_e, crvec Σ_old, rvec Σ) |
void | initialize_penalty (const Problem &p, const ALMParams ¶ms, crvec x0, rvec Σ) |
void | apply_preconditioning (const Problem &problem, Problem &prec_problem, crvec x, real_t &prec_f, vec &prec_g) |
real_t | calc_ψ_ŷ (const Problem &p, crvec x, crvec y, crvec Σ, rvec ŷ) |
Calculate both ψ(x) and the vector ŷ that can later be used to compute ∇ψ. More... | |
void | calc_grad_ψ_from_ŷ (const Problem &p, crvec x, crvec ŷ, rvec grad_ψ, rvec work_n) |
Calculate ∇ψ(x) using ŷ. More... | |
real_t | calc_ψ_grad_ψ (const Problem &p, crvec x, crvec y, crvec Σ, rvec grad_ψ, rvec work_n, rvec work_m) |
Calculate both ψ(x) and its gradient ∇ψ(x). More... | |
void | calc_grad_ψ (const Problem &p, crvec x, crvec y, crvec Σ, rvec grad_ψ, rvec work_n, rvec work_m) |
Calculate the gradient ∇ψ(x). More... | |
void | calc_err_z (const Problem &p, crvec x̂, crvec y, crvec Σ, rvec err_z) |
Calculate the error between ẑ and g(x). More... | |
auto | projected_gradient_step (const Box &C, real_t γ, crvec x, crvec grad_ψ) |
Projected gradient step. More... | |
void | calc_x̂ (const Problem &prob, real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) |
bool | stop_crit_requires_grad_̂ψₖ (PANOCStopCrit crit) |
real_t | calc_error_stop_crit (const Box &C, PANOCStopCrit crit, crvec pₖ, real_t γ, crvec xₖ, crvec x̂ₖ, crvec ŷₖ, crvec grad_ψₖ, crvec grad_̂ψₖ) |
Compute the ε from the stopping criterion, see PANOCStopCrit. More... | |
real_t | descent_lemma (const Problem &problem, real_t rounding_tolerance, real_t L_max, crvec xₖ, real_t ψₖ, crvec grad_ψₖ, crvec y, crvec Σ, rvec x̂ₖ, rvec pₖ, rvec ŷx̂ₖ, real_t &ψx̂ₖ, real_t &norm_sq_pₖ, real_t &grad_ψₖᵀpₖ, real_t &Lₖ, real_t &γₖ) |
Increase the estimate of the Lipschitz constant of the objective gradient and decrease the step size until quadratic upper bound or descent lemma is satisfied: More... | |
template<class ParamsT , class DurationT > | |
SolverStatus | check_all_stop_conditions (const ParamsT ¶ms, DurationT time_elapsed, unsigned iteration, const AtomicStopSignal &stop_signal, real_t ε, real_t εₖ, unsigned no_progress) |
Check all stop conditions (required tolerance reached, out of time, maximum number of iterations exceeded, interrupted by user, infinite iterate, no progress made) More... | |
void | calc_augmented_lagrangian_hessian (const Problem &problem, crvec xₖ, crvec ŷxₖ, crvec y, crvec Σ, rvec g, mat &H, rvec work_n) |
Compute the Hessian matrix of the augmented Lagrangian function. More... | |
void | calc_augmented_lagrangian_hessian_prod_fd (const Problem &problem, crvec xₖ, crvec y, crvec Σ, crvec grad_ψ, crvec v, rvec Hv, rvec work_n1, rvec work_n2, rvec work_m) |
Compute the Hessian matrix of the augmented Lagrangian function multiplied by the given vector, using finite differences. More... | |
real_t | initial_lipschitz_estimate (const Problem &problem, crvec xₖ, crvec y, crvec Σ, real_t ε, real_t δ, real_t L_min, real_t L_max, real_t &ψ, rvec grad_ψ, rvec work_n1, rvec work_n2, rvec work_n3, rvec work_m) |
Estimate the Lipschitz constant of the gradient | |
real_t | initial_lipschitz_estimate (const Problem &problem, crvec xₖ, crvec y, crvec Σ, real_t ε, real_t δ, real_t L_min, real_t L_max, rvec grad_ψ, rvec work_n1, rvec work_n2, rvec work_n3, rvec work_m) |
Estimate the Lipschitz constant of the gradient | |
template<class ObjFunT , class ObjGradFunT > | |
real_t | initial_lipschitz_estimate (const ObjFunT &ψ, const ObjGradFunT &grad_ψ, crvec xₖ, real_t ε, real_t δ, real_t L_min, real_t L_max, real_t &ψₖ, rvec grad_ψₖ, vec_allocator &alloc) |
Estimate the Lipschitz constant of the gradient | |
void | calc_x̂ (real_t γ, crvec x, const Box &C, crvec grad_ψ, rvec x̂, rvec p) |
template<class ObjFunT > | |
real_t | descent_lemma (const ObjFunT &ψ, const Box &C, real_t rounding_tolerance, real_t L_max, crvec xₖ, real_t ψₖ, crvec grad_ψₖ, rvec x̂ₖ, rvec pₖ, real_t &ψx̂ₖ, real_t &norm_sq_pₖ, real_t &grad_ψₖᵀpₖ, real_t &Lₖ, real_t &γₖ) |
Increase the estimate of the Lipschitz constant of the objective gradient and decrease the step size until quadratic upper bound or descent lemma is satisfied: More... | |
void | print_progress (unsigned k, real_t ψₖ, crvec grad_ψₖ, real_t pₖᵀpₖ, real_t γₖ, real_t εₖ) |
Calculate both ψ(x) and the vector ŷ that can later be used to compute ∇ψ.
[in] | p | Problem description |
[in] | x | Decision variable |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[out] | ŷ |
Definition at line 16 of file panoc-helpers.hpp.
|
inline |
Calculate ∇ψ(x) using ŷ.
[in] | p | Problem description |
[in] | x | Decision variable |
[in] | ŷ | |
[out] | grad_ψ | |
work_n | Dimension n |
Definition at line 44 of file panoc-helpers.hpp.
|
inline |
Calculate both ψ(x) and its gradient ∇ψ(x).
[in] | p | Problem description |
[in] | x | Decision variable |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[out] | grad_ψ | |
work_n | Dimension n | |
work_m | Dimension m |
Definition at line 62 of file panoc-helpers.hpp.
|
inline |
Calculate the gradient ∇ψ(x).
[in] | p | Problem description |
[in] | x | Decision variable |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[out] | grad_ψ | |
work_n | Dimension n | |
work_m | Dimension m |
Definition at line 79 of file panoc-helpers.hpp.
|
inline |
Calculate the error between ẑ and g(x).
[in] | p | Problem description |
[in] | x̂ | Decision variable |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[out] | err_z |
Definition at line 107 of file panoc-helpers.hpp.
|
inline |
Projected gradient step.
[in] | C | Set to project onto |
[in] | γ | Step size |
[in] | x | Decision variable |
[in] | grad_ψ |
Definition at line 131 of file panoc-helpers.hpp.
|
inline |
[in] | prob | Problem description |
[in] | γ | Step size |
[in] | x | Decision variable |
[in] | grad_ψ | |
[out] | x̂ | |
[out] | p |
Definition at line 142 of file panoc-helpers.hpp.
|
inline |
|
inline |
Compute the ε from the stopping criterion, see PANOCStopCrit.
[in] | C | Box constraints on x |
[in] | crit | What stoppint criterion to use |
[in] | pₖ | Projected gradient step |
[in] | γ | Step size |
[in] | xₖ | Current iterate |
[in] | x̂ₖ | Current iterate after projected gradient step |
[in] | ŷₖ | Candidate Lagrange multipliers |
[in] | grad_ψₖ | Gradient in |
[in] | grad_̂ψₖ | Gradient in |
Definition at line 169 of file panoc-helpers.hpp.
|
inline |
Increase the estimate of the Lipschitz constant of the objective gradient and decrease the step size until quadratic upper bound or descent lemma is satisfied:
The projected gradient iterate
[in] | problem | Problem description |
[in] | rounding_tolerance | Tolerance used to ignore rounding errors when the function |
[in] | L_max | Maximum allowed Lipschitz constant estimate (prevents infinite loop if function or derivatives are discontinuous, and keeps step size bounded away from zero). |
[in] | xₖ | Current iterate |
[in] | ψₖ | Objective function |
[in] | grad_ψₖ | Gradient of objective |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[out] | x̂ₖ | Projected gradient iterate |
[out] | pₖ | Projected gradient step |
[out] | ŷx̂ₖ | Intermediate vector |
[in,out] | ψx̂ₖ | Objective function |
[in,out] | norm_sq_pₖ | Squared norm of the step |
[in,out] | grad_ψₖᵀpₖ | Gradient of objective times step |
[in,out] | Lₖ | Lipschitz constant estimate |
[in,out] | γₖ | Step size |
Definition at line 242 of file panoc-helpers.hpp.
|
inline |
Check all stop conditions (required tolerance reached, out of time, maximum number of iterations exceeded, interrupted by user, infinite iterate, no progress made)
[in] | params | Parameters including `max_iter`, `max_time` and `max_no_progress` |
[in] | time_elapsed | Time elapsed since the start of the algorithm |
[in] | iteration | The current iteration number |
[in] | stop_signal | A stop signal for the user to interrupt the algorithm |
[in] | ε | Desired primal tolerance |
[in] | εₖ | Tolerance of the current iterate |
[in] | no_progress | The number of successive iterations no progress was made |
Definition at line 307 of file panoc-helpers.hpp.
|
inline |
Compute the Hessian matrix of the augmented Lagrangian function.
[in] | problem | Problem description |
[in] | xₖ | Current iterate |
[in] | ŷxₖ | Intermediate vector |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[out] | g | The constraint values |
[out] | H | Hessian matrix |
work_n | Dimension n |
Definition at line 342 of file panoc-helpers.hpp.
|
inline |
Compute the Hessian matrix of the augmented Lagrangian function multiplied by the given vector, using finite differences.
[in] | problem | Problem description |
[in] | xₖ | Current iterate |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[in] | grad_ψ | Gradient |
[in] | v | Vector to multiply with the Hessian |
[out] | Hv | Hessian-vector product |
work_n1 | Dimension n | |
work_n2 | Dimension n | |
work_m | Dimension m |
Definition at line 379 of file panoc-helpers.hpp.
|
inline |
Estimate the Lipschitz constant of the gradient
[in] | problem | Problem description |
[in] | xₖ | Current iterate |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[in] | ε | Finite difference step size relative to xₖ |
[in] | δ | Minimum absolute finite difference step size |
[in] | L_min | Minimum allowed Lipschitz estimate. |
[in] | L_max | Maximum allowed Lipschitz estimate. |
[out] | ψ | |
[out] | grad_ψ | Gradient |
work_n1 | Dimension n | |
work_n2 | Dimension n | |
work_n3 | Dimension n | |
work_m | Dimension m |
Definition at line 412 of file panoc-helpers.hpp.
|
inline |
Estimate the Lipschitz constant of the gradient
[in] | problem | Problem description |
[in] | xₖ | Current iterate |
[in] | y | Lagrange multipliers |
[in] | Σ | Penalty weights |
[in] | ε | Finite difference step size relative to xₖ |
[in] | δ | Minimum absolute finite difference step size |
[in] | L_min | Minimum allowed Lipschitz estimate. |
[in] | L_max | Maximum allowed Lipschitz estimate. |
[out] | grad_ψ | Gradient |
work_n1 | Dimension n | |
work_n2 | Dimension n | |
work_n3 | Dimension n | |
work_m | Dimension m |
Definition at line 459 of file panoc-helpers.hpp.
real_t alpaqa::detail::initial_lipschitz_estimate | ( | const ObjFunT & | ψ, |
const ObjGradFunT & | grad_ψ, | ||
crvec | xₖ, | ||
real_t | ε, | ||
real_t | δ, | ||
real_t | L_min, | ||
real_t | L_max, | ||
real_t & | ψₖ, | ||
rvec | grad_ψₖ, | ||
vec_allocator & | alloc | ||
) |
Estimate the Lipschitz constant of the gradient
[in] | ψ | Objective |
[in] | grad_ψ | Gradient of |
[in] | xₖ | Current iterate |
[in] | ε | Finite difference step size relative to xₖ |
[in] | δ | Minimum absolute finite difference step size |
[in] | L_min | Minimum allowed Lipschitz estimate. |
[in] | L_max | Maximum allowed Lipschitz estimate. |
[out] | ψₖ | |
[out] | grad_ψₖ | Gradient |
[in] | alloc |
Definition at line 20 of file standalone/panoc.hpp.
|
inline |
[in] | γ | Step size |
[in] | x | Decision variable |
[in] | C | Box constraints |
[in] | grad_ψ | |
[out] | x̂ | |
[out] | p |
Definition at line 58 of file standalone/panoc.hpp.
real_t alpaqa::detail::descent_lemma | ( | const ObjFunT & | ψ, |
const Box & | C, | ||
real_t | rounding_tolerance, | ||
real_t | L_max, | ||
crvec | xₖ, | ||
real_t | ψₖ, | ||
crvec | grad_ψₖ, | ||
rvec | x̂ₖ, | ||
rvec | pₖ, | ||
real_t & | ψx̂ₖ, | ||
real_t & | norm_sq_pₖ, | ||
real_t & | grad_ψₖᵀpₖ, | ||
real_t & | Lₖ, | ||
real_t & | γₖ | ||
) |
Increase the estimate of the Lipschitz constant of the objective gradient and decrease the step size until quadratic upper bound or descent lemma is satisfied:
The projected gradient iterate
[in] | ψ | Objective. |
[in] | C | Box constraints. |
[in] | rounding_tolerance | Tolerance used to ignore rounding errors when the function |
[in] | L_max | Maximum allowed Lipschitz constant estimate (prevents infinite loop if function or derivatives are discontinuous, and keeps step size bounded away from zero). |
[in] | xₖ | Current iterate |
[in] | ψₖ | Objective function |
[in] | grad_ψₖ | Gradient of objective |
[out] | x̂ₖ | Projected gradient iterate |
[out] | pₖ | Projected gradient step |
[in,out] | ψx̂ₖ | Objective function |
[in,out] | norm_sq_pₖ | Squared norm of the step |
[in,out] | grad_ψₖᵀpₖ | Gradient of objective times step |
[in,out] | Lₖ | Lipschitz constant estimate |
[in,out] | γₖ | Step size |
Definition at line 82 of file standalone/panoc.hpp.