template<Config Conf = DefaultConfig>
class alpaqa::FunctionalProblem< Conf >
Problem class that allows specifying the basic functions as C++ std::functions.
Definition at line 12 of file functional-problem.hpp.
|
real_t | eval_objective (crvec x) const |
void | eval_objective_gradient (crvec x, rvec grad_fx) const |
void | eval_constraints (crvec x, rvec gx) const |
void | eval_constraints_gradient_product (crvec x, crvec y, rvec grad_gxy) const |
void | eval_grad_gi (crvec x, index_t i, rvec grad_gix) const |
void | eval_lagrangian_hessian_product (crvec x, crvec y, real_t scale, crvec v, rvec Hv) const |
void | eval_augmented_lagrangian_hessian_product (crvec x, crvec y, crvec Σ, real_t scale, crvec v, rvec Hv) const |
void | eval_constraints_jacobian (crvec x, rvec J_values) const |
void | eval_lagrangian_hessian (crvec x, crvec y, real_t scale, rvec H_values) const |
void | eval_augmented_lagrangian_hessian (crvec x, crvec y, crvec Σ, real_t scale, rvec H_values) const |
bool | provides_eval_grad_gi () const |
bool | provides_eval_constraints_jacobian () const |
bool | provides_eval_lagrangian_hessian_product () const |
bool | provides_eval_lagrangian_hessian () const |
bool | provides_eval_augmented_lagrangian_hessian_product () const |
bool | provides_eval_augmented_lagrangian_hessian () const |
std::string | get_name () const |
| FunctionalProblem (const FunctionalProblem &)=default |
FunctionalProblem & | operator= (const FunctionalProblem &)=default |
| FunctionalProblem (FunctionalProblem &&) noexcept=default |
FunctionalProblem & | operator= (FunctionalProblem &&) noexcept=default |
void | resize (length_t num_variables, length_t num_constraints) |
| Change the dimensions of the problem (number of decision variables and number of constraints).
|
length_t | get_num_variables () const |
| Number of decision variables \( n \), num_variables.
|
length_t | get_num_constraints () const |
| Number of constraints \( m \), num_constraints.
|
real_t | eval_proximal_gradient_step (real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) const |
void | eval_projecting_difference_constraints (crvec z, rvec p) const |
void | eval_projection_multipliers (rvec y, real_t M) const |
const Box & | get_variable_bounds () const |
const Box & | get_general_bounds () const |
bool | provides_get_variable_bounds () const |
| Only supported if the ℓ₁-regularization term is zero.
|
index_t | eval_inactive_indices_res_lna (real_t γ, crvec x, crvec grad_ψ, rindexvec J) const |
void | check () const |
|
static real_t | eval_proj_grad_step_box (const Box &C, real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) |
| Projected gradient step for rectangular box C.
|
static void | eval_prox_grad_step_box_l1_impl (const Box &C, const auto &λ, real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) |
| Proximal gradient step for rectangular box C with ℓ₁-regularization.
|
static real_t | eval_prox_grad_step_box_l1 (const Box &C, const auto &λ, real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) |
| Proximal gradient step for rectangular box C with ℓ₁-regularization.
|
static real_t | eval_prox_grad_step_box_l1_scal (const Box &C, real_t λ, real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) |
| Proximal gradient step for rectangular box C with ℓ₁-regularization.
|
static void | eval_proj_multipliers_box (const Box &D, rvec y, real_t M, index_t penalty_alm_split) |
|
std::function< real_t(crvec)> | f |
std::function< void(crvec, rvec)> | grad_f |
std::function< void(crvec, rvec)> | g |
std::function< void(crvec, crvec, rvec)> | grad_g_prod |
std::function< void(crvec, index_t, rvec)> | grad_gi |
std::function< void(crvec, rmat)> | jac_g |
std::function< void(crvec, crvec, real_t, crvec, rvec)> | hess_L_prod |
std::function< void(crvec, crvec, real_t, rmat)> | hess_L |
std::function< void(crvec, crvec, crvec, real_t, crvec, rvec)> | hess_ψ_prod |
std::function< void(crvec, crvec, crvec, real_t, rmat)> | hess_ψ |
length_t | num_variables |
| Number of decision variables, dimension of x.
|
length_t | num_constraints |
| Number of constraints, dimension of g(x) and z.
|
Box | variable_bounds |
| Constraints of the decision variables, \( x \in C \).
|
Box | general_bounds |
| Other constraints, \( g(x) \in D \).
|
vec | l1_reg |
| \( \ell_1 \) (1-norm) regularization parameter.
|
index_t | penalty_alm_split |
| Components of the constraint function with indices below this number are handled using a quadratic penalty method rather than using an augmented Lagrangian method.
|
Proximal gradient step for rectangular box C with ℓ₁-regularization.
\[ \begin{aligned} h(x) &= \|x\|_1 + \delta_C(x) \\
\hat x &= \prox_{\gamma h}(x - \gamma\nabla\psi(x)) \\
&= -\max\big(
x - \overline x,
\;\min\big(
x - \underline x,
\;\min\big(
\gamma(\nabla\psi(x) + \lambda),
\;\max\big(
\gamma(\nabla\psi(x) - \lambda),
x
\big)
\big)
\big)
\big) \end{aligned} \]
Definition at line 115 of file box-constr-problem.hpp.
Proximal gradient step for rectangular box C with ℓ₁-regularization.
\[ \begin{aligned} h(x) &= \|x\|_1 + \delta_C(x) \\
\hat x &= \prox_{\gamma h}(x - \gamma\nabla\psi(x)) \\
&= -\max\big(
x - \overline x,
\;\min\big(
x - \underline x,
\;\min\big(
\gamma(\nabla\psi(x) + \lambda),
\;\max\big(
\gamma(\nabla\psi(x) - \lambda),
x
\big)
\big)
\big)
\big) \end{aligned} \]
Definition at line 124 of file box-constr-problem.hpp.
Proximal gradient step for rectangular box C with ℓ₁-regularization.
\[ \begin{aligned} h(x) &= \|x\|_1 + \delta_C(x) \\
\hat x &= \prox_{\gamma h}(x - \gamma\nabla\psi(x)) \\
&= -\max\big(
x - \overline x,
\;\min\big(
x - \underline x,
\;\min\big(
\gamma(\nabla\psi(x) + \lambda),
\;\max\big(
\gamma(\nabla\psi(x) - \lambda),
x
\big)
\big)
\big)
\big) \end{aligned} \]
Definition at line 132 of file box-constr-problem.hpp.