alpaqa 1.0.0a11
Nonconvex constrained optimization
Loading...
Searching...
No Matches
pantr-direction.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace alpaqa {
7
8/// This class outlines the interface for direction providers used by PANTR-like
9/// algorithms.
10///
11/// @ingroup grp_DirectionProviders
12template <Config Conf>
16
17 /// Initialize the direction provider.
18 ///
19 /// @param[in] problem
20 /// Problem description.
21 /// @param[in] y
22 /// Lagrange multipliers.
23 /// @param[in] Σ
24 /// Penalty factors.
25 /// @param[in] γ_0
26 /// Initial step size.
27 /// @param[in] x_0
28 /// Initial iterate.
29 /// @param[in] x̂_0
30 /// Result of proximal gradient step in @p x_0.
31 /// @param[in] p_0
32 /// Proximal gradient step in @p x_0.
33 /// @param[in] grad_ψx_0
34 /// Gradient of the objective in @p x_0.
35 ///
36 /// The references @p problem, @p y and @p Σ are guaranteed to remain valid
37 /// for subsequent calls to @ref update, @ref apply, @ref changed_γ and
38 /// @ref reset.
39 void initialize(const Problem &problem, crvec y, crvec Σ, real_t γ_0,
40 crvec x_0, crvec x̂_0, crvec p_0, crvec grad_ψx_0) = delete;
41
42 /// Return whether a direction is available on the very first iteration,
43 /// before the first call to @ref update.
44 bool has_initial_direction() const { return true; }
45
46 /// Update the direction provider when accepting the next iterate.
47 ///
48 /// @param[in] γₖ
49 /// Current step size.
50 /// @param[in] γₙₑₓₜ
51 /// Step size for the next iterate.
52 /// @param[in] xₖ
53 /// Current iterate.
54 /// @param[in] xₙₑₓₜ
55 /// Next iterate.
56 /// @param[in] pₖ
57 /// Proximal gradient step in the current iterate.
58 /// @param[in] pₙₑₓₜ
59 /// Proximal gradient step in the next iterate.
60 /// @param[in] grad_ψxₖ
61 /// Gradient of the objective in the current iterate.
62 /// @param[in] grad_ψxₙₑₓₜ
63 /// Gradient of the objective in the next iterate.
64 bool update(real_t γₖ, real_t γₙₑₓₜ, crvec xₖ, crvec xₙₑₓₜ, crvec pₖ,
65 crvec pₙₑₓₜ, crvec grad_ψxₖ, crvec grad_ψxₙₑₓₜ) = delete;
66
67 /// Compute the direction in the given point.
68 ///
69 /// @param[in] γₖ
70 /// Current step size.
71 /// @param[in] xₖ
72 /// Current iterate.
73 /// @param[in] x̂ₖ
74 /// Result of proximal gradient step in @p xₖ.
75 /// @param[in] pₖ
76 /// Proximal gradient step in @p xₖ.
77 /// @param[in] grad_ψxₖ
78 /// Gradient of the objective at @p xₖ.
79 /// @param[in] radius
80 /// Trust radius Δ.
81 /// @param[out] qₖ
82 /// Resulting step.
83 /// @return Model decrease.
84 real_t apply(real_t γₖ, crvec xₖ, crvec x̂ₖ, crvec pₖ, crvec grad_ψxₖ,
85 real_t radius, rvec qₖ) const = delete;
86
87 /// Called when the PANTR step size changes.
88 void changed_γ(real_t γₖ, real_t old_γₖ) = delete;
89
90 /// Called when using the direction failed. A possible behavior could be to
91 /// flush the buffers, hopefully yielding a better direction on the next
92 /// iteration.
93 void reset() = delete;
94
95 /// Get a human-readable name for this direction provider.
96 std::string get_name() const = delete;
97};
98
99} // namespace alpaqa
#define USING_ALPAQA_CONFIG(Conf)
Definition: config.hpp:54
typename Conf::real_t real_t
Definition: config.hpp:63
typename Conf::rvec rvec
Definition: config.hpp:67
typename Conf::crvec crvec
Definition: config.hpp:68
This class outlines the interface for direction providers used by PANTR-like algorithms.
void changed_γ(real_t γₖ, real_t old_γₖ)=delete
Called when the PANTR step size changes.
std::string get_name() const =delete
Get a human-readable name for this direction provider.
void reset()=delete
Called when using the direction failed.
void initialize(const Problem &problem, crvec y, crvec Σ, real_t γ_0, crvec x_0, crvec x̂_0, crvec p_0, crvec grad_ψx_0)=delete
Initialize the direction provider.
bool has_initial_direction() const
Return whether a direction is available on the very first iteration, before the first call to update.
real_t apply(real_t γₖ, crvec xₖ, crvec x̂ₖ, crvec pₖ, crvec grad_ψxₖ, real_t radius, rvec qₖ) const =delete
Compute the direction in the given point.
bool update(real_t γₖ, real_t γₙₑₓₜ, crvec xₖ, crvec xₙₑₓₜ, crvec pₖ, crvec pₙₑₓₜ, crvec grad_ψxₖ, crvec grad_ψxₙₑₓₜ)=delete
Update the direction provider when accepting the next iterate.