11 static constexpr auto NaN = alpaqa::NaN<config_t>;
22 const auto n = x.size(), m = y.size();
23 vec z(n), grad_Lx(n), work(n), g(m), e(m);
29 auto stationarity = norm_inf(z);
35 auto constr_violation = norm_inf(e);
37 real_t complementarity = std::inner_product(
38 y.begin(), y.end(), e.begin(),
real_t(0),
39 [](
real_t acc,
real_t ye) {
return std::fmax(acc, std::abs(ye)); }, std::multiplies<>{});
41 real_t bounds_violation = NaN<config_t>;
44 return {.stationarity = stationarity,
45 .constr_violation = constr_violation,
46 .complementarity = complementarity,
47 .bounds_violation = bounds_violation};
The main polymorphic minimization problem interface.
real_t eval_prox_grad_step(real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) const
[Required] Function that computes a proximal gradient step.
bool provides_get_box_C() const
Returns true if the problem provides an implementation of get_box_C.
void eval_grad_L(crvec x, crvec y, rvec grad_L, rvec work_n) const
[Optional] Evaluate the gradient of the Lagrangian
void eval_g(crvec x, rvec gx) const
[Required] Function that evaluates the constraints,
const Box & get_box_C() const
[Optional] Get the rectangular constraint set of the decision variables, .
void eval_proj_diff_g(crvec z, rvec e) const
[Required] Function that evaluates the difference between the given point and its projection onto th...
#define USING_ALPAQA_CONFIG(Conf)
auto norm_inf(const Eigen::MatrixBase< Derived > &v)
Get the maximum or infinity-norm of the given vector.
typename Conf::real_t real_t
typename Conf::crvec crvec
auto project(const auto &v, const Box< Conf > &box)
Project a vector onto a box.
KKTError< Conf > compute_kkt_error(const TypeErasedProblem< Conf > &problem, crvec< Conf > x, crvec< Conf > y)
static constexpr auto NaN