PANOC-ALM  quadratic-penalty
Nonconvex constrained optimization
guarded-aa-pga.hpp
Go to the documentation of this file.
1 #pragma once
2 
9 
10 #include <cassert>
11 #include <chrono>
12 #include <cmath>
13 #include <iomanip>
14 #include <iostream>
15 #include <stdexcept>
16 
17 namespace pa {
18 
19 struct GAAPGAParams {
23  unsigned limitedqr_mem = 10;
25  unsigned max_iter = 100;
27  std::chrono::microseconds max_time = std::chrono::minutes(5);
29  real_t L_min = 1e-5;
31  real_t L_max = 1e9;
33  PANOCStopCrit stop_crit = PANOCStopCrit::ApproxKKT;
34 
37  unsigned print_interval = 0;
38 
40  10 * std::numeric_limits<real_t>::epsilon();
41 
43  unsigned max_no_progress = 10;
44 
46 };
47 
49  unsigned k;
63  const Problem &problem;
65 };
66 
72 class GAAPGASolver {
73  public:
75 
77 
78  struct Stats {
79  SolverStatus status = SolverStatus::Unknown;
81  std::chrono::microseconds elapsed_time;
82  unsigned iterations = 0;
84  };
85 
87 
88  Stats operator()(const Problem &problem, // in
89  crvec Σ, // in
90  real_t ε, // in
91  bool always_overwrite_results, // in
92  rvec x, // inout
93  rvec λ, // inout
94  rvec err_z); // out
95 
96  GAAPGASolver &
97  set_progress_callback(std::function<void(const ProgressInfo &)> cb) {
98  this->progress_cb = cb;
99  return *this;
100  }
101 
102  std::string get_name() const { return "GAAPGA"; }
103 
104  void stop() { stop_signal.stop(); }
105 
106  const Params &get_params() const { return params; }
107 
108  private:
111  std::function<void(const ProgressInfo &)> progress_cb;
112 };
113 
114 using std::chrono::duration_cast;
115 using std::chrono::microseconds;
116 
117 inline GAAPGASolver::Stats
119  crvec Σ, // in
120  real_t ε, // in
121  bool always_overwrite_results, // in
122  rvec x, // inout
123  rvec y, // inout
124  rvec err_z // out
125 ) {
126  auto start_time = std::chrono::steady_clock::now();
127  Stats s;
128 
129  const auto n = problem.n;
130  const auto m = problem.m;
131 
132  vec xₖ = x, // Value of x at the beginning of the iteration
133  x̂ₖ(n), // Value of x after a projected gradient step
134  gₖ(n), // <?>
135  rₖ₋₁(n), // <?>
136  rₖ(n), // <?>
137  pₖ(n), // Projected gradient step
138  yₖ(n), // Value of x after a gradient or AA step
139  ŷₖ(m), // <?>
140  grad_ψₖ(n), // ∇ψ(xₖ)
141  grad_ψx̂ₖ(n); // ∇ψ(x̂ₖ)
142 
143  vec work_n(n), work_n2(n), work_m(m);
144 
145  unsigned m_AA = std::min(params.limitedqr_mem, n);
146  LimitedMemoryQR qr(n, m_AA);
147  mat G(n, m_AA);
148  vec γ_LS(m_AA);
149 
150  // Helper functions --------------------------------------------------------
151 
152  // Wrappers for helper functions that automatically pass along any arguments
153  // that are constant within AAPGA (for readability in the main algorithm)
154  auto calc_ψ_ŷ = [&problem, &y, &Σ](crvec x, rvec ŷ) {
155  return detail::calc_ψ_ŷ(problem, x, y, Σ, ŷ);
156  };
157  auto calc_ψ_grad_ψ = [&problem, &y, &Σ, &work_n, &work_m](crvec x,
158  rvec grad_ψ) {
159  return detail::calc_ψ_grad_ψ(problem, x, y, Σ, grad_ψ, work_n, work_m);
160  };
161  auto calc_grad_ψ_from_ŷ = [&problem, &work_n](crvec x, crvec ŷ,
162  rvec grad_ψ) {
163  detail::calc_grad_ψ_from_ŷ(problem, x, ŷ, grad_ψ, work_n);
164  };
165  auto calc_x̂ = [&problem](real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p) {
166  detail::calc_x̂(problem, γ, x, grad_ψ, x̂, p);
167  };
168  auto calc_err_z = [&problem, &y, &Σ](crvec x̂, rvec err_z) {
170  };
171  auto descent_lemma = [this, &problem, &y,
172  &Σ](crvec xₖ, real_t ψₖ, crvec grad_ψₖ, rvec x̂ₖ,
173  rvec pₖ, rvec ŷx̂ₖ, real_t &ψx̂ₖ, real_t &pₖᵀpₖ,
174  real_t &grad_ψₖᵀpₖ, real_t &Lₖ, real_t &γₖ) {
175  return detail::descent_lemma(
177  xₖ, ψₖ, grad_ψₖ, y, Σ, x̂ₖ, pₖ, ŷx̂ₖ, ψx̂ₖ, pₖᵀpₖ, grad_ψₖᵀpₖ, Lₖ, γₖ);
178  };
179  auto print_progress = [&](unsigned k, real_t ψₖ, crvec grad_ψₖ, crvec pₖ,
180  real_t γₖ, real_t εₖ) {
181  std::cout << "[AAPGA] " << std::setw(6) << k
182  << ": ψ = " << std::setw(13) << ψₖ
183  << ", ‖∇ψ‖ = " << std::setw(13) << grad_ψₖ.norm()
184  << ", ‖p‖ = " << std::setw(13) << pₖ.norm()
185  << ", γ = " << std::setw(13) << γₖ
186  << ", εₖ = " << std::setw(13) << εₖ << "\r\n";
187  };
188 
189  // Estimate Lipschitz constant ---------------------------------------------
190 
191  real_t ψₖ, Lₖ;
192  // Finite difference approximation of ∇²ψ in starting point
193  if (params.Lipschitz.L₀ <= 0) {
197  /* in ⟹ out */ grad_ψₖ, /* work */ x̂ₖ, work_n2, work_n, work_m);
198  }
199  // Initial Lipschitz constant provided by the user
200  else {
201  Lₖ = params.Lipschitz.L₀;
202  // Calculate ψ(xₖ), ∇ψ(x₀)
203  ψₖ = calc_ψ_grad_ψ(xₖ, /* in ⟹ out */ grad_ψₖ);
204  }
205  if (not std::isfinite(Lₖ)) {
206  s.status = SolverStatus::NotFinite;
207  return s;
208  }
209 
210  real_t γₖ = params.Lipschitz.Lγ_factor / Lₖ;
211 
212  // First projected gradient step -------------------------------------------
213 
214  rₖ₋₁ = -γₖ * grad_ψₖ;
215  yₖ = xₖ + rₖ₋₁;
216  xₖ = project(yₖ, problem.C);
217  G.col(0) = yₖ;
218 
219  unsigned no_progress = 0;
220 
221  // Calculate gradient in second iterate ------------------------------------
222 
223  // Calculate ψ(x₁) and ∇ψ(x₁)
224  ψₖ = calc_ψ_grad_ψ(xₖ, /* in ⟹ out */ grad_ψₖ);
225 
226  // Main loop
227  // =========================================================================
228  for (unsigned k = 0; k <= params.max_iter; ++k) {
229  // From previous iteration:
230  // - xₖ
231  // - grad_ψₖ
232  // - ψₖ
233  // - rₖ₋₁
234  // - history in qr and G
235 
236  // Quadratic upper bound -----------------------------------------------
237 
238  // Projected gradient step: x̂ₖ and pₖ
239  calc_x̂(γₖ, xₖ, grad_ψₖ, /* in ⟹ out */ x̂ₖ, pₖ);
240  // Calculate ψ(x̂ₖ) and ŷ(x̂ₖ)
241  real_t ψx̂ₖ = calc_ψ_ŷ(x̂ₖ, /* in ⟹ out */ ŷₖ);
242  // Calculate ∇ψ(xₖ)ᵀpₖ and ‖pₖ‖²
243  real_t grad_ψₖᵀpₖ = grad_ψₖ.dot(pₖ);
244  real_t pₖᵀpₖ = pₖ.squaredNorm();
245 
246  real_t old_γₖ = descent_lemma(xₖ, ψₖ, grad_ψₖ, x̂ₖ, pₖ, ŷₖ, ψx̂ₖ, pₖᵀpₖ,
247  grad_ψₖᵀpₖ, Lₖ, γₖ);
248 
249  // Flush or update Anderson buffers if step size changed
250  if (γₖ != old_γₖ) {
252  // Save the latest function evaluation gₖ at the first index
253  size_t newest_g_idx = qr.ring_tail();
254  if (newest_g_idx != 0)
255  G.col(0) = G.col(newest_g_idx);
256  // Flush everything else and reset indices
257  qr.reset();
258  } else {
259  // When not near the boundaries of the feasible set,
260  // r(x) = g(x) - x = Π(x - γ∇ψ(x)) - x = -γ∇ψ(x),
261  // in other words, r(x) is proportional to γ, and so is Δr,
262  // so when γ changes, these values have to be updated as well
263  qr.scale_R(γₖ / old_γₖ);
264  }
265  rₖ₋₁ *= γₖ / old_γₖ;
266  }
267 
268  // Calculate ∇ψ(x̂ₖ)
269  calc_grad_ψ_from_ŷ(x̂ₖ, ŷₖ, /* in ⟹ out */ grad_ψx̂ₖ);
270 
271  // Check stop condition ------------------------------------------------
272 
273  real_t εₖ = detail::calc_error_stop_crit(params.stop_crit, pₖ, γₖ, xₖ,
274  grad_ψx̂ₖ, grad_ψₖ, problem.C);
275 
276  // Print progress
277  if (params.print_interval != 0 && k % params.print_interval == 0)
278  print_progress(k, ψₖ, grad_ψₖ, pₖ, γₖ, εₖ);
279  if (progress_cb)
280  progress_cb({k, xₖ, pₖ, pₖᵀpₖ, x̂ₖ, ψₖ, grad_ψₖ, ψx̂ₖ, grad_ψx̂ₖ, Lₖ,
281  γₖ, εₖ, Σ, y, problem, params});
282 
283  auto time_elapsed = std::chrono::steady_clock::now() - start_time;
284  auto stop_status = detail::check_all_stop_conditions(
285  params, time_elapsed, k, stop_signal, ε, εₖ, no_progress);
286  if (stop_status != SolverStatus::Unknown) {
287  // TODO: We could cache g(x) and ẑ, but would that faster?
288  // It saves 1 evaluation of g per ALM iteration, but requires
289  // many extra stores in the inner loops of PANOC.
290  // TODO: move the computation of ẑ and g(x) to ALM?
291  if (stop_status == SolverStatus::Converged ||
292  stop_status == SolverStatus::Interrupted ||
293  always_overwrite_results) {
294  calc_err_z(x̂ₖ, /* in ⟹ out */ err_z);
295  x = std::move(x̂ₖ);
296  y = std::move(ŷₖ);
297  }
298  s.iterations = k;
299  s.ε = εₖ;
300  s.elapsed_time = duration_cast<microseconds>(time_elapsed);
301  s.status = stop_status;
302  return s;
303  }
304 
305  // Standard gradient descent step
306  gₖ = xₖ - γₖ * grad_ψₖ;
307  rₖ = gₖ - yₖ;
308 
309  // Solve Anderson acceleration least squares problem and update history
310  minimize_update_anderson(qr, G, rₖ, rₖ₋₁, gₖ, γ_LS, yₖ);
311 
312  // Project accelerated step onto feasible set
313  xₖ = project(yₖ, problem.C);
314 
315  // Calculate the objective at the projected accelerated point
316  real_t ψₖ₊₁ = calc_ψ_ŷ(xₖ, /* in ⟹ out */ ŷₖ);
317  real_t old_ψ = ψₖ;
318 
319  // Check sufficient decrease condition for Anderson iterate
320  bool sufficient_decrease;
321  if (0) // From paper
322  sufficient_decrease = ψₖ₊₁ <= ψₖ - 0.5 * γₖ * grad_ψₖ.squaredNorm();
323  else // Since we compute ψ(x̂ₖ) we might as well pick the best one
324  sufficient_decrease = ψₖ₊₁ <= ψx̂ₖ;
325 
326  if (sufficient_decrease) {
327  // Accept Anderson step
328  // yₖ and xₖ are already overwritten by yₑₓₜ and Π(yₑₓₜ)
329  ψₖ = ψₖ₊₁;
330  calc_grad_ψ_from_ŷ(xₖ, ŷₖ, /* in ⟹ out */ grad_ψₖ);
331  }
332  // If not satisfied, take normal projected gradient step
333  else {
334  yₖ.swap(gₖ);
335  xₖ.swap(x̂ₖ);
336  ψₖ = ψx̂ₖ;
337  grad_ψₖ.swap(grad_ψx̂ₖ);
338  }
339  rₖ.swap(rₖ₋₁);
340  s.accelerated_steps_accepted += sufficient_decrease;
341 
342  // Check if we made any progress, prevents us from exceeding the maximum
343  // number of iterations doing nothing if the step size gets too small
344  // TODO: is this a valid test?
345  no_progress = (ψₖ == old_ψ) ? no_progress + 1 : 0;
346  }
347  throw std::logic_error("[AAPGA] loop error");
348 }
349 
350 template <class InnerSolverStats>
351 struct InnerStatsAccumulator;
352 
353 template <>
355  std::chrono::microseconds elapsed_time;
356  unsigned iterations = 0;
357  unsigned accelerated_steps_accepted = 0;
358 };
359 
362  const GAAPGASolver::Stats &s) {
363  acc.elapsed_time += s.elapsed_time;
364  acc.iterations += s.iterations;
366  return acc;
367 }
368 
369 } // namespace pa
pa::detail::print_progress
void print_progress(unsigned k, real_t ψₖ, crvec grad_ψₖ, real_t pₖᵀpₖ, real_t γₖ, real_t εₖ)
Definition: standalone/panoc.hpp:139
pa::GAAPGAParams::limitedqr_mem
unsigned limitedqr_mem
Length of the history to keep in the limited-memory QR algorithm.
Definition: guarded-aa-pga.hpp:23
pa::AtomicStopSignal
Definition: atomic_stop_signal.hpp:7
pa::detail::calc_x̂
void calc_x̂(const ProblemT &prob, real_t γ, crvec x, crvec grad_ψ, rvec x̂, rvec p)
Definition: panoc-helpers.hpp:271
pa::GAAPGAProgressInfo::p
crvec p
Definition: guarded-aa-pga.hpp:51
pa::LimitedMemoryQR
Incremental QR factorization using modified Gram-Schmidt with reorthogonalization.
Definition: limited-memory-qr.hpp:14
pa::GAAPGAProgressInfo::k
unsigned k
Definition: guarded-aa-pga.hpp:49
pa::GAAPGAParams::L_min
real_t L_min
Minimum Lipschitz constant estimate.
Definition: guarded-aa-pga.hpp:29
pa::SolverStatus::Unknown
@ Unknown
Initial value.
pa::rvec
Eigen::Ref< vec > rvec
Default type for mutable references to vectors.
Definition: vec.hpp:16
pa::InnerStatsAccumulator< GAAPGASolver::Stats >::accelerated_steps_accepted
unsigned accelerated_steps_accepted
Definition: guarded-aa-pga.hpp:357
pa::GAAPGAProgressInfo::norm_sq_p
real_t norm_sq_p
Definition: guarded-aa-pga.hpp:52
pa::InnerStatsAccumulator< GAAPGASolver::Stats >::iterations
unsigned iterations
Definition: guarded-aa-pga.hpp:356
pa::GAAPGAProgressInfo::grad_ψ_hat
crvec grad_ψ_hat
Definition: guarded-aa-pga.hpp:57
panocpy.test.y
y
Definition: test.py:76
pa::GAAPGASolver::Stats::elapsed_time
std::chrono::microseconds elapsed_time
Definition: guarded-aa-pga.hpp:81
atomic_stop_signal.hpp
panocpy.test.err_z
err_z
Definition: test.py:76
pa::SolverStatus
SolverStatus
Exit status of a numerical solver such as ALM or PANOC.
Definition: solverstatus.hpp:7
panocpy.test.ε
int ε
Definition: test.py:71
pa::GAAPGAProgressInfo::x
crvec x
Definition: guarded-aa-pga.hpp:50
pa::GAAPGASolver::Stats
Definition: guarded-aa-pga.hpp:78
pa::vec
realvec vec
Default type for vectors.
Definition: vec.hpp:14
pa::GAAPGASolver::Stats::iterations
unsigned iterations
Definition: guarded-aa-pga.hpp:82
pa::GAAPGAProgressInfo::ψ
real_t ψ
Definition: guarded-aa-pga.hpp:54
pa::LipschitzEstimateParams::L₀
real_t L₀
Initial estimate of the Lipschitz constant of ∇ψ(x)
Definition: lipschitz.hpp:9
pa::GAAPGASolver::progress_cb
std::function< void(const ProgressInfo &)> progress_cb
Definition: guarded-aa-pga.hpp:111
pa::GAAPGAProgressInfo::problem
const Problem & problem
Definition: guarded-aa-pga.hpp:63
pa::project
auto project(const Vec &v, const Box &box)
Project a vector onto a box.
Definition: box.hpp:15
pa::minimize_update_anderson
void minimize_update_anderson(LimitedMemoryQR &qr, rmat G, crvec rₖ, crvec rₖ₋₁, crvec gₖ, rvec γ_LS, rvec xₖ_aa)
Solve one step of Anderson acceleration to find a fixed point of a function g(x):
Definition: anderson-helpers.hpp:30
pa::GAAPGAParams::print_interval
unsigned print_interval
When to print progress.
Definition: guarded-aa-pga.hpp:37
pa::GAAPGAParams::quadratic_upperbound_tolerance_factor
real_t quadratic_upperbound_tolerance_factor
Definition: guarded-aa-pga.hpp:39
pa::operator+=
InnerStatsAccumulator< PANOCStats > & operator+=(InnerStatsAccumulator< PANOCStats > &acc, const PANOCStats &s)
Definition: inner/decl/panoc.hpp:217
pa::GAAPGASolver::operator()
Stats operator()(const Problem &problem, crvec Σ, real_t ε, bool always_overwrite_results, rvec x, rvec λ, rvec err_z)
Definition: guarded-aa-pga.hpp:118
pa::GAAPGASolver::stop_signal
AtomicStopSignal stop_signal
Definition: guarded-aa-pga.hpp:110
pa::GAAPGAProgressInfo::x_hat
crvec x_hat
Definition: guarded-aa-pga.hpp:53
main.problem
problem
Definition: main.py:16
pa::GAAPGAProgressInfo::Σ
crvec Σ
Definition: guarded-aa-pga.hpp:61
pa::GAAPGAProgressInfo::params
const GAAPGAParams & params
Definition: guarded-aa-pga.hpp:64
pa::GAAPGASolver::set_progress_callback
GAAPGASolver & set_progress_callback(std::function< void(const ProgressInfo &)> cb)
Definition: guarded-aa-pga.hpp:97
pa::GAAPGAParams::L_max
real_t L_max
Maximum Lipschitz constant estimate.
Definition: guarded-aa-pga.hpp:31
pa
Definition: alm.hpp:10
pa::detail::calc_ψ_grad_ψ
real_t calc_ψ_grad_ψ(const Problem &p, crvec x, crvec y, crvec Σ, rvec grad_ψ, rvec work_n, rvec work_m)
Calculate both ψ(x) and its gradient ∇ψ(x).
Definition: panoc-helpers.hpp:113
panocpy.test.x
x
Definition: test.py:40
pa::GAAPGAProgressInfo::L
real_t L
Definition: guarded-aa-pga.hpp:58
pa::PANOCStopCrit
PANOCStopCrit
Definition: panoc-stop-crit.hpp:8
panoc-stop-crit.hpp
pa::detail::check_all_stop_conditions
SolverStatus check_all_stop_conditions(const ParamsT &params, DurationT time_elapsed, unsigned iteration, const AtomicStopSignal &stop_signal, real_t ε, real_t εₖ, unsigned no_progress)
Check all stop conditions (required tolerance reached, out of time, maximum number of iterations exce...
Definition: panoc-helpers.hpp:469
pa::detail::calc_ψ_ŷ
real_t calc_ψ_ŷ(const Problem &p, crvec x, crvec y, crvec Σ, rvec ŷ)
Calculate both ψ(x) and the vector ŷ that can later be used to compute ∇ψ.
Definition: panoc-helpers.hpp:16
pa::inf
constexpr real_t inf
Definition: vec.hpp:26
pa::GAAPGAProgressInfo::γ
real_t γ
Definition: guarded-aa-pga.hpp:59
panoc-helpers.hpp
pa::detail::calc_err_z
void calc_err_z(const Problem &p, crvec x̂, crvec y, crvec Σ, rvec err_z)
Calculate the error between ẑ and g(x).
Definition: panoc-helpers.hpp:212
pa::GAAPGAParams::max_time
std::chrono::microseconds max_time
Maximum duration.
Definition: guarded-aa-pga.hpp:27
lipschitz.hpp
pa::detail::calc_error_stop_crit
real_t calc_error_stop_crit(PANOCStopCrit crit, crvec pₖ, real_t γ, crvec xₖ, crvec grad_̂ψₖ, crvec grad_ψₖ, const Box &C)
Definition: panoc-helpers.hpp:284
pa::GAAPGAProgressInfo::ε
real_t ε
Definition: guarded-aa-pga.hpp:60
pa::InnerStatsAccumulator< GAAPGASolver::Stats >
Definition: guarded-aa-pga.hpp:354
pa::detail::descent_lemma
real_t descent_lemma(const Problem &problem, real_t rounding_tolerance, real_t L_max, crvec xₖ, real_t ψₖ, crvec grad_ψₖ, crvec y, crvec Σ, rvec x̂ₖ, rvec pₖ, rvec ŷx̂ₖ, real_t &ψx̂ₖ, real_t &norm_sq_pₖ, real_t &grad_ψₖᵀpₖ, real_t &Lₖ, real_t &γₖ)
Increase the estimate of the Lipschitz constant of the objective gradient and decrease the step size ...
Definition: panoc-helpers.hpp:327
pa::crvec
Eigen::Ref< const vec > crvec
Default type for immutable references to vectors.
Definition: vec.hpp:18
pa::GAAPGAProgressInfo::ψ_hat
real_t ψ_hat
Definition: guarded-aa-pga.hpp:56
anderson-helpers.hpp
pa::GAAPGAParams
Definition: guarded-aa-pga.hpp:19
pa::LipschitzEstimateParams
Definition: lipschitz.hpp:7
pa::GAAPGAParams::Lipschitz
LipschitzEstimateParams Lipschitz
Parameters related to the Lipschitz constant estimate and step size.
Definition: guarded-aa-pga.hpp:21
pa::LipschitzEstimateParams::δ
real_t δ
Minimum step size for initial finite difference Lipschitz estimate.
Definition: lipschitz.hpp:13
pa::GAAPGAProgressInfo::grad_ψ
crvec grad_ψ
Definition: guarded-aa-pga.hpp:55
pa::LimitedMemoryQR::reset
void reset()
Reset all indices, clearing the Q and R matrices.
Definition: limited-memory-qr.hpp:211
pa::GAAPGASolver::stop
void stop()
Definition: guarded-aa-pga.hpp:104
pa::GAAPGASolver
Guarded Anderson Accelerated Proximal Gradient Algorithm.
Definition: guarded-aa-pga.hpp:72
pa::GAAPGASolver::Stats::accelerated_steps_accepted
unsigned accelerated_steps_accepted
Definition: guarded-aa-pga.hpp:83
pa::GAAPGASolver::get_name
std::string get_name() const
Definition: guarded-aa-pga.hpp:102
panocpy.test.Σ
int Σ
Definition: test.py:70
pa::GAAPGASolver::get_params
const Params & get_params() const
Definition: guarded-aa-pga.hpp:106
panocpy.test.m
int m
Definition: test.py:39
pa::GAAPGAParams::stop_crit
PANOCStopCrit stop_crit
What stopping criterion to use.
Definition: guarded-aa-pga.hpp:33
pa::LimitedMemoryQR::ring_tail
size_t ring_tail() const
Get the tail index of the circular buffer (points to one past the most recent element).
Definition: limited-memory-qr.hpp:233
pa::mat
realmat mat
Default type for matrices.
Definition: vec.hpp:20
pa::detail::initial_lipschitz_estimate
real_t initial_lipschitz_estimate(const Problem &problem, crvec xₖ, crvec y, crvec Σ, real_t ε, real_t δ, real_t L_min, real_t L_max, real_t &ψ, rvec grad_ψ, rvec work_n1, rvec work_n2, rvec work_n3, rvec work_m)
Estimate the Lipschitz constant of the gradient using finite differences.
Definition: panoc-helpers.hpp:574
pa::GAAPGASolver::params
Params params
Definition: guarded-aa-pga.hpp:109
pa::GAAPGAParams::max_no_progress
unsigned max_no_progress
Maximum number of iterations without any progress before giving up.
Definition: guarded-aa-pga.hpp:43
pa::GAAPGASolver::Stats::ε
real_t ε
Definition: guarded-aa-pga.hpp:80
pa::GAAPGAProgressInfo::y
crvec y
Definition: guarded-aa-pga.hpp:62
pa::detail::calc_grad_ψ_from_ŷ
void calc_grad_ψ_from_ŷ(const Problem &p, crvec x, crvec ŷ, rvec grad_ψ, rvec work_n)
Calculate ∇ψ(x) using ŷ.
Definition: panoc-helpers.hpp:81
pa::GAAPGAProgressInfo
Definition: guarded-aa-pga.hpp:48
panocpy.test.λ
λ
Definition: test.py:41
panocpy.test.p
p
Definition: test.py:57
pa::InnerStatsAccumulator
Definition: panoc-fwd.hpp:10
pa::GAAPGASolver::GAAPGASolver
GAAPGASolver(const Params &params)
Definition: guarded-aa-pga.hpp:76
pa::LipschitzEstimateParams::Lγ_factor
real_t Lγ_factor
Factor that relates step size γ and Lipschitz constant.
Definition: lipschitz.hpp:15
panocpy.test.n
int n
Definition: test.py:38
pa::LimitedMemoryQR::scale_R
void scale_R(real_t scal)
Multiply the matrix R by a scalar.
Definition: limited-memory-qr.hpp:200
pa::InnerStatsAccumulator< GAAPGASolver::Stats >::elapsed_time
std::chrono::microseconds elapsed_time
Definition: guarded-aa-pga.hpp:355
pa::real_t
double real_t
Default floating point type.
Definition: vec.hpp:8
solverstatus.hpp
pa::AtomicStopSignal::stop
void stop()
Definition: atomic_stop_signal.hpp:15
pa::GAAPGAParams::max_iter
unsigned max_iter
Maximum number of inner iterations.
Definition: guarded-aa-pga.hpp:25
pa::GAAPGAParams::full_flush_on_γ_change
bool full_flush_on_γ_change
Definition: guarded-aa-pga.hpp:45
pa::Problem
Problem description for minimization problems.
Definition: include/panoc-alm/util/problem.hpp:24
pa::GAAPGASolver::Stats::status
SolverStatus status
Definition: guarded-aa-pga.hpp:79