22 if (norm_e <=
params.dual_tolerance) {
27 if (
params.single_penalty_factor) {
28 if constexpr (
requires { Σ(0); }) {
29 if (first_iter || norm_e > θ * old_norm_e) {
34 throw std::logic_error(
"This configuration does not support "
35 "single-penalty parameter mode");
38 auto new_Σ = (e.cwiseAbs() * (Δ / norm_e))
41 .cwiseMin(
params.max_penalty);
51 auto incr = e.cwiseAbs().array() > θ * old_e.cwiseAbs().array();
52 Σ = incr.select(new_Σ, Σ);
65 std::max(
real_t(1), std::abs(f0)) /
67 σ = std::clamp(σ,
params.min_penalty,
params.max_penalty);
76 σ = std::clamp(σ,
params.min_penalty,
params.max_penalty);
Nonlinear optimal control problem with finite horizon .
The main polymorphic minimization problem interface.
void eval_constraints(crvec x, rvec gx) const
[Required] Function that evaluates the constraints,
real_t eval_objective(crvec x) const
[Required] Function that evaluates the cost,
length_t get_num_constraints() const
[Required] Number of constraints.
#define USING_ALPAQA_CONFIG(Conf)
#define ALPAQA_IF_QUADF(...)
#define ALPAQA_IF_LONGD(...)
#define ALPAQA_IF_FLOAT(...)
#define ALPAQA_EXPORT_EXTERN_TEMPLATE(...)
Parameters for the Augmented Lagrangian solver.
typename Conf::real_t real_t
typename Conf::crvec crvec
Double-precision double configuration.
Single-precision float configuration.
long double configuration.
static void initialize_penalty(const TypeErasedControlProblem< config_t > &p, const ALMParams< config_t > ¶ms, crvec x0, rvec Σ)
static void update_penalty_weights(const ALMParams< config_t > ¶ms, real_t Δ, bool first_iter, rvec e, rvec old_e, real_t norm_e, real_t old_norm_e, rvec Σ)
static void initialize_penalty(const TypeErasedProblem< config_t > &p, const ALMParams< config_t > ¶ms, crvec x0, rvec Σ)