alpaqa 1.0.0a11
Nonconvex constrained optimization
Loading...
Searching...
No Matches
noop.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace alpaqa {
7
8/// Direction provider that provides no directions (apply always returns false).
9/// @ingroup grp_DirectionProviders
10template <Config Conf>
13
15 using AcceleratorParams = void;
16 using DirectionParams = void;
17
18 NoopDirection() = default;
19
20 /// @see @ref PANOCDirection::initialize
21 void initialize([[maybe_unused]] const Problem &problem,
22 [[maybe_unused]] crvec y, [[maybe_unused]] crvec Σ,
23 [[maybe_unused]] real_t γ_0, [[maybe_unused]] crvec x_0,
24 [[maybe_unused]] crvec x̂_0, [[maybe_unused]] crvec p_0,
25 [[maybe_unused]] crvec grad_ψx_0) {}
26
27 /// @see @ref PANOCDirection::has_initial_direction
28 [[nodiscard]] bool has_initial_direction() const { return false; }
29
30 /// @see @ref PANOCDirection::update
31 [[nodiscard]] bool
32 update([[maybe_unused]] real_t γₖ, [[maybe_unused]] real_t γₙₑₓₜ,
33 [[maybe_unused]] crvec xₖ, [[maybe_unused]] crvec xₙₑₓₜ,
34 [[maybe_unused]] crvec pₖ, [[maybe_unused]] crvec pₙₑₓₜ,
35 [[maybe_unused]] crvec grad_ψxₖ,
36 [[maybe_unused]] crvec grad_ψxₙₑₓₜ) {
37 return true;
38 }
39
40 /// @see @ref PANOCDirection::apply
41 [[nodiscard]] bool
42 apply([[maybe_unused]] real_t γₖ, [[maybe_unused]] crvec xₖ,
43 [[maybe_unused]] crvec x̂ₖ, [[maybe_unused]] crvec pₖ,
44 [[maybe_unused]] crvec grad_ψxₖ, [[maybe_unused]] rvec qₖ) const {
45 return false;
46 }
47
48 /// @see @ref PANOCDirection::changed_γ
49 void changed_γ([[maybe_unused]] real_t γₖ, [[maybe_unused]] real_t old_γₖ) {
50 }
51
52 /// @see @ref PANOCDirection::reset
53 void reset() {}
54
55 /// @see @ref PANOCDirection::get_name
56 [[nodiscard]] std::string get_name() const {
57 return "NoopDirection<" + std::string(config_t::get_name()) + '>';
58 }
59 void get_params() const {}
60};
61
62} // 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
Direction provider that provides no directions (apply always returns false).
Definition: noop.hpp:11
std::string get_name() const
Definition: noop.hpp:56
void changed_γ(real_t γₖ, real_t old_γₖ)
Definition: noop.hpp:49
bool update(real_t γₖ, real_t γₙₑₓₜ, crvec xₖ, crvec xₙₑₓₜ, crvec pₖ, crvec pₙₑₓₜ, crvec grad_ψxₖ, crvec grad_ψxₙₑₓₜ)
Definition: noop.hpp:32
void AcceleratorParams
Definition: noop.hpp:15
void get_params() const
Definition: noop.hpp:59
void initialize(const Problem &problem, crvec y, crvec Σ, real_t γ_0, crvec x_0, crvec x̂_0, crvec p_0, crvec grad_ψx_0)
Definition: noop.hpp:21
bool apply(real_t γₖ, crvec xₖ, crvec x̂ₖ, crvec pₖ, crvec grad_ψxₖ, rvec qₖ) const
Definition: noop.hpp:42
bool has_initial_direction() const
Definition: noop.hpp:28