alpaqa 1.0.0a15
Nonconvex constrained optimization
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 ψ 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 ψ 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).

z^k=ΠD(g(xk)+Σ1y)

Parameters
[in]pProblem description
[in]Decision variable x^
[in]yLagrange multipliers y
[in]ΣPenalty weights Σ
[out]err_zg(x^)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 x^kxk
[in]γStep size
[in]xₖCurrent iterate
[in]x̂ₖCurrent iterate after projected gradient step
[in]ŷₖCandidate Lagrange multipliers
[in]grad_ψₖGradient in xk
[in]grad_̂ψₖGradient in 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:

ψ(x+p)ψ(x)+ψ(x)p+L2p2

The projected gradient iterate x^k and step pk are updated with the new step size γk, and so are other quantities that depend on them, such as ψ(xk)pk and p2. The intermediate vector y^(xk) can be used to compute the gradient ψ(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 ψ(x) is relatively flat or the step size is very small, which could cause ψ(xk)<ψ(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 xk
[in]ψₖObjective function ψ(xk)
[in]grad_ψₖGradient of objective ψ(xk)
[in]yLagrange multipliers y
[in]ΣPenalty weights Σ
[out]x̂ₖProjected gradient iterate x^k
[out]pₖProjected gradient step pk
[out]ŷx̂ₖIntermediate vector y^(x^k)
[in,out]ψx̂ₖObjective function ψ(x^k)
[in,out]norm_sq_pₖSquared norm of the step pk2
[in,out]grad_ψₖᵀpₖGradient of objective times step ψ(xk)pk
[in,out]LₖLipschitz constant estimate Lψk
[in,out]γₖStep size γ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.

xx2LΣ(x,y)vxLΣ(x+hv,y)xLΣ(x,y)h

Parameters
[in]problemProblem description
[in]xₖCurrent iterate xk
[in]yLagrange multipliers y
[in]ΣPenalty weights Σ
[in]grad_ψGradient ψ(xk)
[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 ψ using finite differences.

Parameters
[in]problemProblem description
[in]xCurrent iterate xk
[in]yLagrange multipliers y
[in]ΣPenalty weights Σ
[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]ψψ(xk)
[out]grad_ψGradient ψ(xk)
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 ψ using finite differences.

Parameters
[in]problemProblem description
[in]xₖCurrent iterate xk
[in]yLagrange multipliers y
[in]ΣPenalty weights Σ
[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 ψ(xk)
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: