aligator  0.15.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
results.hpp
Go to the documentation of this file.
1
3#pragma once
4
6#include <fmt/ostream.h>
7
8namespace aligator {
9
11template <typename _Scalar> struct ResultsTpl final : ResultsBaseTpl<_Scalar> {
12 using Scalar = _Scalar;
15 using Base::conv;
16 using Base::gains_;
17 using Base::num_iters;
18 using Base::us;
19 using Base::xs;
20
22 std::vector<VectorXs> lams;
24 std::vector<VectorXs> vs;
26 std::size_t al_iter = 0;
27
28 explicit ResultsTpl()
29 : Base() {}
30
31 ResultsTpl(const ResultsTpl &) = default;
32 ResultsTpl &operator=(const ResultsTpl &) = default;
33
34 ResultsTpl(ResultsTpl &&) = default;
36
39 explicit ResultsTpl(const TrajOptProblemTpl<Scalar> &problem);
40
42 const ConstVectorRef &x0);
43};
44
45template <typename Scalar>
46std::ostream &operator<<(std::ostream &oss, const ResultsTpl<Scalar> &self) {
47 return oss << fmt::format("{}", self);
48}
49
50} // namespace aligator
51
52template <typename Scalar> struct fmt::formatter<aligator::ResultsTpl<Scalar>> {
53 constexpr auto parse(format_parse_context &ctx) const
54 -> decltype(ctx.begin()) {
55 return ctx.end();
56 }
57
58 auto format(const aligator::ResultsTpl<Scalar> &self,
59 format_context &ctx) const -> decltype(ctx.out()) {
60 auto s = self.printBase();
61 return fmt::format_to(ctx.out(), "Results {{{}\n}}", s);
62 }
63};
64
65#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
66#include "./results.txx"
67#endif
Main package namespace.
std::ostream & operator<<(std::ostream &oss, const ExplicitDynamicsDataTpl< S > &self)
std::vector< MatrixXs > gains_
Results holder struct.
Definition results.hpp:11
ResultsTpl(ResultsTpl &&)=default
ResultsTpl(const ResultsTpl &)=default
ResultsTpl(const TrajOptProblemTpl< Scalar > &problem)
Create the results struct from a problem (TrajOptProblemTpl) instance.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
std::vector< VectorXs > lams
Definition results.hpp:22
void cycleAppend(const TrajOptProblemTpl< Scalar > &problem, const ConstVectorRef &x0)
ResultsTpl & operator=(ResultsTpl &&)=default
ResultsTpl & operator=(const ResultsTpl &)=default
std::vector< VectorXs > vs
Definition results.hpp:24
ResultsBaseTpl< Scalar > Base
Definition results.hpp:14
Trajectory optimization problem.