16template <Config Conf = DefaultConfig>
25 std::chrono::nanoseconds
max_time = std::chrono::minutes(5);
68 real_t(1
e2) * std::numeric_limits<real_t>::epsilon();
74 real_t(1
e2) * std::numeric_limits<real_t>::epsilon();
81template <Config Conf = DefaultConfig>
113template <Config Conf = DefaultConfig>
147template <Config Conf>
175 if (problem.get_m() != 0)
176 throw std::invalid_argument(
"Missing arguments y, Σ, e");
177 mvec y{
nullptr, 0}, Σ{
nullptr, 0}, e{
nullptr, 0};
203 std::ostream *
os = &std::cout;
206template <Config Conf>
211 std::chrono::nanoseconds elapsed_time{};
213 std::chrono::nanoseconds time_prox{};
215 std::chrono::nanoseconds time_forward{};
217 std::chrono::nanoseconds time_backward{};
219 std::chrono::nanoseconds time_jacobians{};
221 std::chrono::nanoseconds time_hessians{};
223 std::chrono::nanoseconds time_indices{};
225 std::chrono::nanoseconds time_lqr_factor{};
227 std::chrono::nanoseconds time_lqr_solve{};
229 std::chrono::nanoseconds time_lbfgs_indices{};
231 std::chrono::nanoseconds time_lbfgs_apply{};
233 std::chrono::nanoseconds time_lbfgs_update{};
235 std::chrono::nanoseconds time_progress_callback{};
237 unsigned iterations = 0;
239 unsigned linesearch_failures = 0;
241 unsigned linesearch_backtracks = 0;
243 unsigned stepsize_backtracks = 0;
245 unsigned lbfgs_failures = 0;
248 unsigned lbfgs_rejected = 0;
251 unsigned τ_1_accepted = 0;
254 unsigned count_τ = 0;
269template <Config Conf>
std::string get_name() const
std::function< void(const ProgressInfo &)> progress_cb
InnerSolveOptions< config_t > SolveOptions
Stats operator()(const P &problem, const SolveOptions &opts, rvec u, rvec y, crvec μ, rvec e)
AtomicStopSignal stop_signal
PANOCOCPSolver(const Params ¶ms)
alpaqa::TypeErasedControlProblem< config_t > Problem
const Params & get_params() const
Stats operator()(const Problem &problem, const SolveOptions &opts, rvec u, rvec y, crvec μ, rvec err_z)
Stats operator()(const P &problem, const SolveOptions &opts, rvec u)
PANOCOCPStats< config_t > Stats
PANOCOCPSolver & set_progress_callback(std::function< void(const ProgressInfo &)> cb)
Specify a callable that is invoked with some intermediate results on each iteration of the algorithm.
Nonlinear optimal control problem with finite horizon .
#define USING_ALPAQA_CONFIG(Conf)
#define ALPAQA_IF_QUADF(...)
#define ALPAQA_IF_LONGD(...)
#define ALPAQA_IF_FLOAT(...)
#define ALPAQA_EXPORT_EXTERN_TEMPLATE(...)
real_t linesearch_tolerance_factor
Tolerance factor used in the line search.
LipschitzEstimateParams< config_t > Lipschitz
Parameters related to the Lipschitz constant estimate and step size.
bool disable_acceleration
Don't compute accelerated steps, fall back to forward-backward splitting.
unsigned max_no_progress
Maximum number of iterations without any progress before giving up.
bool reset_lbfgs_on_gn_step
Flush the L-BFGS buffer when a Gauss-Newton step is accepted.
real_t L_max
Maximum Lipschitz constant estimate.
real_t min_linesearch_coefficient
Minimum weight factor between Newton step and projected gradient step, line search parameter.
std::chrono::nanoseconds max_time
Maximum duration.
real_t quadratic_upperbound_tolerance_factor
Tolerance factor used in the quadratic upper bound condition that determines the step size.
real_t linesearch_strictness_factor
Parameter β used in the line search (see Algorithm 2 in ).
bool lqr_factor_cholesky
Use a Cholesky factorization for the Riccati recursion.
unsigned print_interval
When to print progress.
unsigned L_max_inc
Maximum number of times to double the Lipschitz constant estimate per iteration.
LBFGSParams< config_t > lbfgs_params
L-BFGS parameters (e.g. memory).
int print_precision
The precision of the floating point values printed by the solver.
real_t L_min
Minimum Lipschitz constant estimate.
bool gn_sticky
Keep trying to apply a Gauss-Newton step as long as they keep getting accepted with step size one.
unsigned gn_interval
How often to use a Gauss-Newton step. Zero to disable GN entirely.
unsigned max_iter
Maximum number of inner PANOC iterations.
PANOCStopCrit stop_crit
What stopping criterion to use.
Parameters for the LBFGS class.
Parameters for the estimation of the Lipschitz constant of the gradient of the smooth term of the cos...
Tuning parameters for the PANOC algorithm.
unsigned stepsize_backtracks
std::chrono::nanoseconds time_jacobians
@ ApproxKKT
Find an ε-approximate KKT point in the ∞-norm:
std::chrono::nanoseconds time_hessians
std::chrono::nanoseconds time_lbfgs_apply
InnerStatsAccumulator< PANOCOCPStats< Conf > > & operator+=(InnerStatsAccumulator< PANOCOCPStats< Conf > > &acc, const PANOCOCPStats< Conf > &s)
std::chrono::nanoseconds time_lbfgs_indices
SolverStatus
Exit status of a numerical solver such as ALM or PANOC.
std::chrono::nanoseconds time_progress_callback
std::chrono::nanoseconds time_indices
std::chrono::nanoseconds elapsed_time
std::chrono::nanoseconds time_backward
typename Conf::real_t real_t
std::chrono::nanoseconds time_lqr_factor
unsigned linesearch_backtracks
typename Conf::length_t length_t
typename Conf::crvec crvec
std::chrono::nanoseconds time_prox
std::chrono::nanoseconds time_forward
unsigned linesearch_failures
std::chrono::nanoseconds time_lbfgs_update
std::chrono::nanoseconds time_lqr_solve
const TypeErasedControlProblem< config_t > * problem
const PANOCOCPParams< config_t > * params