proxsuite-nlp  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
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 proxsuite {
10namespace nlp {
13
16template <typename T> class Linesearch {
17public:
18 struct Options {
27 std::size_t max_num_steps;
31 friend std::ostream &operator<<(std::ostream &oss, const Options &self) {
32 oss << "{";
33 oss << fmt::format("armijo_c1 = {:.3e}", self.armijo_c1);
34 oss << ", "
35 << fmt::format("contraction_min = {:.3e}", self.contraction_min);
36 oss << ", "
37 << fmt::format("contraction_max = {:.3e}", self.contraction_max);
38 oss << "}";
39 return oss;
40 }
41 };
42 explicit Linesearch(const Linesearch::Options &options);
44
47 T phi;
49 bool valid;
50 FunctionSample() : alpha(0.), phi(0.), dphi(0.), valid(false) {}
51 FunctionSample(T a, T v) : alpha(a), phi(v), dphi(0.), valid(true) {}
52 FunctionSample(T a, T v, T g) : alpha(a), phi(v), dphi(g), valid(true) {}
53 };
54
55 void setOptions(const Linesearch::Options &options) { options_ = options; }
56
57 void reset() {}
58
60};
61
62template <typename T>
64 : options_(options) {}
65
66template <typename T> Linesearch<T>::~Linesearch() = default;
67
68} // namespace nlp
69} // namespace proxsuite
70
71#ifdef PROXSUITE_NLP_ENABLE_TEMPLATE_INSTANTIATION
72#include "proxsuite-nlp/linesearch.txx"
73#endif
Base linesearch class. Design pattern inspired by Google Ceres-Solver.
Linesearch(const Linesearch::Options &options)
void setOptions(const Linesearch::Options &options)
Linesearch::Options options_
Main package namespace.
Definition bcl-params.hpp:5
friend std::ostream & operator<<(std::ostream &oss, const Options &self)