21 std::optional<rvec> Σ) {
22 using std::chrono::duration_cast;
23 using std::chrono::nanoseconds;
24 auto start_time = std::chrono::steady_clock::now();
29 if (params.max_iter == 0)
38 .max_time = params.max_time,
39 .tolerance = params.tolerance,
72 if (Σ && Σ->allFinite() && Σ->norm() > 0) {
76 else if (params.initial_penalty > 0) {
77 Σ_curr.fill(params.initial_penalty);
81 Helpers::initialize_penalty(p, params, x,
Σ_curr);
84 real_t ε = params.initial_tolerance;
86 real_t Δ = params.penalty_update_factor;
87 real_t ρ = params.tolerance_update_factor;
91 for (
unsigned i = 0; i < params.max_iter; ++i) {
94 p.eval_proj_multipliers(y, params.max_multiplier);
101 params.max_total_num_retries);
138 if (params.print_interval != 0 && i % params.print_interval == 0) {
142 *os <<
"[\x1b[0;34mALM\x1b[0m] " << std::setw(5) << i
148 <<
", iter = " << std::setw(13) <<
ps.iterations
182 Δ = std::fmax(params.min_penalty_update_factor,
183 Δ * params.penalty_update_factor_lower);
184 Helpers::update_penalty_weights(params, Δ,
false,
error_1,
188 ρ = std::fmin(params.ρ_max, ρ * params.ρ_increase);
189 ε = std::fmax(ρ *
ε_old, params.tolerance);
194 Σ_curr *= params.initial_penalty_lower;
195 ε *= params.initial_tolerance_increase;
230 Helpers::update_penalty_weights(
234 ε_old = std::exchange(ε, std::fmax(ρ * ε, params.tolerance));
238 throw std::logic_error(
"[ALM] loop error");