alpaqa 1.0.0a15
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
PANOCHelpers< Conf > Struct Template Reference

Detailed Description

template<Config Conf>
struct alpaqa::detail::PANOCHelpers< Conf >

Definition at line 17 of file panoc-helpers.tpp.

+ Collaboration diagram for PANOCHelpers< Conf >:

Public Types

using Problem = alpaqa::TypeErasedProblem< config_t >
 
using Box = alpaqa::Box< config_t >
 

Static Public Member Functions

static void calc_err_z (const Problem &p, crvec x̂, crvec y, crvec Σ, rvec err_z)
 Calculate the error between ẑ and g(x).
 
static bool stop_crit_requires_grad_ψx̂ (PANOCStopCrit crit)
 
static real_t calc_error_stop_crit (const Problem &problem, PANOCStopCrit crit, crvec pₖ, real_t γ, crvec xₖ, crvec x̂ₖ, crvec ŷₖ, crvec grad_ψₖ, crvec grad_̂ψₖ, rvec work_n1, rvec work_n2)
 Compute the ε from the stopping criterion, see PANOCStopCrit.
 
static 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:
 
template<class ParamsT , class DurationT >
static SolverStatus check_all_stop_conditions (const ParamsT &params, const InnerSolveOptions< config_t > &opts, DurationT time_elapsed, unsigned iteration, const AtomicStopSignal &stop_signal, 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)
 
static 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.
 
static 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_x, rvec work_grad_ψ, rvec work_n, rvec work_m)
 Estimate the Lipschitz constant of the gradient \( \nabla \psi \) using finite differences.
 
static 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 \( \nabla \psi \) using finite differences.
 

Member Typedef Documentation

◆ Problem

template<Config Conf>
using Problem = alpaqa::TypeErasedProblem<config_t>

Definition at line 19 of file panoc-helpers.tpp.

◆ Box

template<Config Conf>
using Box = alpaqa::Box<config_t>

Definition at line 20 of file panoc-helpers.tpp.

Member Function Documentation

◆ calc_err_z()

template<Config Conf>
static void calc_err_z ( const Problem p,
crvec  ,
crvec  y,
crvec  Σ,
rvec  err_z 
)
inlinestatic

Calculate the error between ẑ and g(x).

\[ \hat{z}^k = \Pi_D\left(g(x^k) + \Sigma^{-1}y\right) \]

Parameters
[in]pProblem description
[in]Decision variable \( \hat{x} \)
[in]yLagrange multipliers \( y \)
[in]ΣPenalty weights \( \Sigma \)
[out]err_z\( g(\hat{x}) - \hat{z} \)

Definition at line 24 of file panoc-helpers.tpp.

+ Here is the call graph for this function:

◆ stop_crit_requires_grad_ψx̂()

template<Config Conf>
static bool stop_crit_requires_grad_ψx̂ ( PANOCStopCrit  crit)
inlinestatic

Definition at line 44 of file panoc-helpers.tpp.

◆ calc_error_stop_crit()

template<Config Conf>
static real_t calc_error_stop_crit ( const Problem problem,
PANOCStopCrit  crit,
crvec  pₖ,
real_t  γ,
crvec  xₖ,
crvec  x̂ₖ,
crvec  ŷₖ,
crvec  grad_ψₖ,
crvec  grad_̂ψₖ,
rvec  work_n1,
rvec  work_n2 
)
inlinestatic

Compute the ε from the stopping criterion, see PANOCStopCrit.

Parameters
[in]problemProblem description
[in]critWhat stoppint criterion to use
[in]pₖProjected gradient step \( \hat x^k - x^k \)
[in]γStep size
[in]xₖCurrent iterate
[in]x̂ₖCurrent iterate after projected gradient step
[in]ŷₖCandidate Lagrange multipliers
[in]grad_ψₖGradient in \( x^k \)
[in]grad_̂ψₖGradient in \( \hat x^k \)
work_n1Workspace of dimension n
work_n2Workspace of dimension n

Definition at line 62 of file panoc-helpers.tpp.

+ Here is the call graph for this function:

◆ descent_lemma()

template<Config Conf>
static 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 γₖ 
)
inlinestatic

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:

\[ \psi(x + p) \le \psi(x) + \nabla\psi(x)^\top p + \frac{L}{2} \|p\|^2 \]

The projected gradient iterate \( \hat x^k \) and step \( p^k \) are updated with the new step size \( \gamma^k \), and so are other quantities that depend on them, such as \( \nabla\psi(x^k)^\top p^k \) and \( \|p\|^2 \). The intermediate vector \( \hat y(x^k) \) can be used to compute the gradient \( \nabla\psi(\hat x^k) \) or to update the Lagrange multipliers.

Returns
The original step size, before it was reduced by this function.
Parameters
[in]problemProblem description
[in]rounding_toleranceTolerance used to ignore rounding errors when the function \( \psi(x) \) is relatively flat or the step size is very small, which could cause \( \psi(x^k) < \psi(\hat x^k) \), which is mathematically impossible but could occur in finite precision floating point arithmetic.
[in]L_maxMaximum 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 \( x^k \)
[in]ψₖObjective function \( \psi(x^k) \)
[in]grad_ψₖGradient of objective \( \nabla\psi(x^k) \)
[in]yLagrange multipliers \( y \)
[in]ΣPenalty weights \( \Sigma \)
[out]x̂ₖProjected gradient iterate \( \hat x^k \)
[out]pₖProjected gradient step \( p^k \)
[out]ŷx̂ₖIntermediate vector \( \hat y(\hat x^k) \)
[in,out]ψx̂ₖObjective function \( \psi(\hat x^k) \)
[in,out]norm_sq_pₖSquared norm of the step \( \left\| p^k \right\|^2 \)
[in,out]grad_ψₖᵀpₖGradient of objective times step \( \nabla\psi(x^k)^\top p^k\)
[in,out]LₖLipschitz constant estimate \( L_{\nabla\psi}^k \)
[in,out]γₖStep size \( \gamma^k \)

Definition at line 151 of file panoc-helpers.tpp.

+ Here is the call graph for this function:

◆ check_all_stop_conditions()

template<Config Conf>
template<class ParamsT , class DurationT >
static SolverStatus check_all_stop_conditions ( const ParamsT params,
const InnerSolveOptions< config_t > &  opts,
DurationT  time_elapsed,
unsigned  iteration,
const AtomicStopSignal stop_signal,
real_t  εₖ,
unsigned  no_progress 
)
inlinestatic

Check all stop conditions (required tolerance reached, out of time, maximum number of iterations exceeded, interrupted by user, infinite iterate, no progress made)

Parameters
[in]paramsParameters including max_iter, max_time and max_no_progress
[in]optsOptions for the current solve
[in]time_elapsedTime elapsed since the start of the algorithm
[in]iterationThe current iteration number
[in]stop_signalA stop signal for the user to interrupt the algorithm
[in]εₖTolerance of the current iterate
[in]no_progressThe number of successive iterations no progress was made

Definition at line 216 of file panoc-helpers.tpp.

+ Here is the call graph for this function:

◆ calc_augmented_lagrangian_hessian_prod_fd()

template<Config Conf>
static 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 
)
inlinestatic

Compute the Hessian matrix of the augmented Lagrangian function multiplied by the given vector, using finite differences.

\[ \nabla^2_{xx} L_\Sigma(x, y)\, v \approx \frac{\nabla_x L_\Sigma(x+hv, y) - \nabla_x L_\Sigma(x, y)}{h} \]

Parameters
[in]problemProblem description
[in]xₖCurrent iterate \( x^k \)
[in]yLagrange multipliers \( y \)
[in]ΣPenalty weights \( \Sigma \)
[in]grad_ψGradient \( \nabla \psi(x^k) \)
[in]vVector to multiply with the Hessian
[out]HvHessian-vector product
work_n1Dimension n
work_n2Dimension n
work_mDimension m

Definition at line 255 of file panoc-helpers.tpp.

+ Here is the call graph for this function:

◆ initial_lipschitz_estimate() [1/2]

template<Config Conf>
static 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_x,
rvec  work_grad_ψ,
rvec  work_n,
rvec  work_m 
)
inlinestatic

Estimate the Lipschitz constant of the gradient \( \nabla \psi \) using finite differences.

Parameters
[in]problemProblem description
[in]xCurrent iterate \( x^k \)
[in]yLagrange multipliers \( y \)
[in]ΣPenalty weights \( \Sigma \)
[in]εFinite difference step size relative to x
[in]δMinimum absolute finite difference step size
[in]L_minMinimum allowed Lipschitz estimate.
[in]L_maxMaximum allowed Lipschitz estimate.
[out]ψ\( \psi(x^k) \)
[out]grad_ψGradient \( \nabla \psi(x^k) \)
work_xDimension n
work_grad_ψDimension n
work_nDimension n
work_mDimension m

Definition at line 288 of file panoc-helpers.tpp.

+ Here is the call graph for this function:

◆ initial_lipschitz_estimate() [2/2]

template<Config Conf>
static 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 
)
inlinestatic

Estimate the Lipschitz constant of the gradient \( \nabla \psi \) using finite differences.

Parameters
[in]problemProblem description
[in]xₖCurrent iterate \( x^k \)
[in]yLagrange multipliers \( y \)
[in]ΣPenalty weights \( \Sigma \)
[in]εFinite difference step size relative to xₖ
[in]δMinimum absolute finite difference step size
[in]L_minMinimum allowed Lipschitz estimate.
[in]L_maxMaximum allowed Lipschitz estimate.
[out]grad_ψGradient \( \nabla \psi(x^k) \)
work_n1Dimension n
work_n2Dimension n
work_n3Dimension n
work_mDimension m

Definition at line 338 of file panoc-helpers.tpp.

+ Here is the call graph for this function:

The documentation for this struct was generated from the following file: