aligator  0.14.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
 
Loading...
Searching...
No Matches
linesearch-base.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <fmt/format.h>
7#include <ostream>
8
9namespace aligator {
12
15template <typename T> class Linesearch {
16public:
17 struct Options {
19 : armijo_c1(1e-4)
20 , wolfe_c2(0.9)
21 , dphi_thresh(1e-13)
22 , alpha_min(1e-6)
23 , max_num_steps(20)
25 , contraction_min(0.5)
26 , contraction_max(0.8) {}
31 std::size_t max_num_steps;
35 friend std::ostream &operator<<(std::ostream &oss, const Options &self) {
36 oss << "{";
37 oss << fmt::format("armijo_c1 = {:.3e}", self.armijo_c1);
38 oss << ", "
39 << fmt::format("contraction_min = {:.3e}", self.contraction_min);
40 oss << ", "
41 << fmt::format("contraction_max = {:.3e}", self.contraction_max);
42 oss << "}";
43 return oss;
44 }
45 };
46 explicit Linesearch(const Linesearch::Options &options);
48
51 T phi;
53 bool valid;
55 : alpha(0.)
56 , phi(0.)
57 , dphi(0.)
58 , valid(false) {}
60 : alpha(a)
61 , phi(v)
62 , dphi(0.)
63 , valid(true) {}
64 FunctionSample(T a, T v, T g)
65 : alpha(a)
66 , phi(v)
67 , dphi(g)
68 , valid(true) {}
69 };
70
71 void setOptions(const Linesearch::Options &options) { options_ = options; }
72
73 void reset() {}
74
76};
77
78template <typename T>
81
82template <typename T> Linesearch<T>::~Linesearch() = default;
83
84} // namespace aligator
void setOptions(const Linesearch::Options &options)
Linesearch(const Linesearch::Options &options)
Main package namespace.
friend std::ostream & operator<<(std::ostream &oss, const Options &self)