aligator  0.10.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 : 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
29
30 ResultsTpl(const ResultsTpl &) = delete;
31 ResultsTpl &operator=(const ResultsTpl &) = delete;
32
33 ResultsTpl(ResultsTpl &&) = default;
35
38 explicit ResultsTpl(const TrajOptProblemTpl<Scalar> &problem);
39
41 const ConstVectorRef &x0);
42};
43
44template <typename Scalar>
45std::ostream &operator<<(std::ostream &oss, const ResultsTpl<Scalar> &self) {
46 oss << "Results {";
47 self.printBase(oss);
48 return oss << fmt::format("\n al_iters: {:d},", self.al_iter) << "\n}";
49}
50
51} // namespace aligator
52
53template <typename Scalar>
54struct fmt::formatter<aligator::ResultsTpl<Scalar>> : fmt::ostream_formatter {};
55
56#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
57#include "./results.txx"
58#endif
Main package namespace.
std::ostream & operator<<(std::ostream &oss, const ExplicitDynamicsDataTpl< S > &self)
std::vector< VectorXs > xs
States.
std::vector< VectorXs > us
Controls.
std::vector< MatrixXs > gains_
Riccati gains.
void printBase(std::ostream &oss) const
Results holder struct.
Definition results.hpp:11
ResultsTpl(ResultsTpl &&)=default
ResultsTpl(const ResultsTpl &)=delete
std::size_t al_iter
Proximal/AL iteration count.
Definition results.hpp:26
ResultsTpl(const TrajOptProblemTpl< Scalar > &problem)
Create the results struct from a problem (TrajOptProblemTpl) instance.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
std::vector< VectorXs > lams
Problem co-states.
Definition results.hpp:22
void cycleAppend(const TrajOptProblemTpl< Scalar > &problem, const ConstVectorRef &x0)
ResultsTpl & operator=(ResultsTpl &&)=default
std::vector< VectorXs > vs
Path constraint multipliers.
Definition results.hpp:24
ResultsTpl & operator=(const ResultsTpl &)=delete
Trajectory optimization problem.
Definition fwd.hpp:104