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);
76 std::max(
real_t(1), 0.5 * g1_eval.squaredNorm());
77 σ = std::max(σ,
params.Σ_min);
78 σ = std::min(σ,
params.Σ_max);
86 std::max(
real_t(1), 0.5 * g2_eval.squaredNorm());
87 σ = std::max(σ,
params.Σ_min);
88 σ = std::min(σ,
params.Σ_max);
98 prec_f = 1. / std::max(
grad_f.lpNorm<Eigen::Infinity>(),
real_t{1});
101 for (Eigen::Index i = 0; i <
problem.m; ++i) {
105 prec_g(i) = 1. / std::max(grad_g.lpNorm<Eigen::Infinity>(),
real_t{1});
115 g = prec_g.asDiagonal() *
g;
118 vec prec_v = prec_g.asDiagonal() *
v;
119 problem.grad_g_prod(
x, prec_v, grad_g);
125 Box{prec_g.asDiagonal() *
problem.D.upperbound,
126 prec_g.asDiagonal() *
problem.D.lowerbound},
127 std::move(prec_f_fun),
128 std::move(prec_grad_f_fun),
129 std::move(prec_g_fun),
130 std::move(prec_grad_g_fun),
132 throw std::logic_error(
"Preconditioning for second-order solvers "
133 "has not yet been implemented");
136 throw std::logic_error(
"Preconditioning for second-order solvers "
137 "has not yet been implemented");
140 throw std::logic_error(
"Preconditioning for second-order solvers "
141 "has not yet been implemented");