16 return std::max(
y, y_lb);
20 return std::min(
y, y_ub);
22 y =
y.binaryExpr(z_lb, max_lb).binaryExpr(z_ub, min_ub);
33 if (
params.single_penalty_factor) {
34 if (first_iter || norm_e >
params.θ * old_norm_e) {
41 for (Eigen::Index i = 0; i < e.rows(); ++i) {
42 if (first_iter || std::abs(e(i)) >
params.θ * std::abs(old_e(i))) {
44 std::fmax(Δ * std::abs(e(i)) / norm_e, 1) *
60 std::max(
real_t(1), 0.5 * g0.squaredNorm());
61 σ = std::max(σ,
params.Σ_min);
62 σ = std::min(σ,
params.Σ_max);
72 prec_f = 1. / std::max(
grad_f.lpNorm<Eigen::Infinity>(),
real_t{1});
75 for (Eigen::Index i = 0; i <
problem.m; ++i) {
79 prec_g(i) = 1. / std::max(grad_g.lpNorm<Eigen::Infinity>(),
real_t{1});
89 g = prec_g.asDiagonal() *
g;
92 vec prec_v = prec_g.asDiagonal() *
v;
93 problem.grad_g_prod(
x, prec_v, grad_g);
99 Box{prec_g.asDiagonal() *
problem.D.upperbound,
100 prec_g.asDiagonal() *
problem.D.lowerbound},
101 std::move(prec_f_fun),
102 std::move(prec_grad_f_fun),
103 std::move(prec_g_fun),
104 std::move(prec_grad_g_fun),
106 throw std::logic_error(
"Preconditioning for second-order solvers "
107 "has not yet been implemented");
110 throw std::logic_error(
"Preconditioning for second-order solvers "
111 "has not yet been implemented");
114 throw std::logic_error(
"Preconditioning for second-order solvers "
115 "has not yet been implemented");
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)
Eigen::Ref< const vec > crvec
Default type for immutable references to vectors.
realvec vec
Default type for vectors.
Eigen::Ref< mat > rmat
Default type for mutable references to matrices.
double real_t
Default floating point type.
Eigen::Ref< vec > rvec
Default type for mutable references to vectors.
Parameters for the Augmented Lagrangian solver.
Problem description for minimization problems.