alpaqa 1.0.0a8
Nonconvex constrained optimization
Loading...
Searching...
No Matches
unconstr-problem.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace alpaqa {
6
7/// Implements common problem functions for minimization problems without
8/// constraints. Meant to be used as a base class for custom problem
9/// implementations.
10/// @ingroup grp_Problems
11template <Config Conf>
13 public:
15 /// Number of constraints
16 length_t get_m() const { return 0; }
17
18 void eval_g(crvec, rvec) const {}
19 void eval_grad_g_prod(crvec, crvec, rvec grad) const { grad.setZero(); }
21 void eval_grad_gi(crvec, index_t, rvec grad_gi) const { grad_gi.setZero(); }
22
23 /// @see @ref TypeErasedProblem::eval_prox_grad_step
24 real_t eval_prox_grad_step(real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) const {
25 p = -γ * grad_ψ;
26 x̂ = x + p;
27 return 0;
28 }
29
30 /// @see @ref TypeErasedProblem::eval_proj_diff_g
31 void eval_proj_diff_g(crvec, rvec) const {}
32
33 /// @see @ref TypeErasedProblem::eval_proj_multipliers
35};
36
37} // namespace alpaqa
Implements common problem functions for minimization problems without constraints.
length_t get_m() const
Number of constraints.
void eval_proj_multipliers(rvec, real_t) const
void eval_grad_gi(crvec, index_t, rvec grad_gi) const
void eval_proj_diff_g(crvec, rvec) const
void eval_g(crvec, rvec) const
real_t eval_prox_grad_step(real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) const
void eval_jac_g(crvec, rindexvec, rindexvec, rvec) const
void eval_grad_g_prod(crvec, crvec, rvec grad) const
#define USING_ALPAQA_CONFIG(Conf)
Definition: config.hpp:42
typename Conf::real_t real_t
Definition: config.hpp:51
typename Conf::rindexvec rindexvec
Definition: config.hpp:65
typename Conf::index_t index_t
Definition: config.hpp:63
typename Conf::length_t length_t
Definition: config.hpp:62
typename Conf::rvec rvec
Definition: config.hpp:55
typename Conf::crvec crvec
Definition: config.hpp:56