bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
iterative_algorithm_result.h
Go to the documentation of this file.
1#ifndef ITERATIVE_ALGORITHM_RESULT_H
2#define ITERATIVE_ALGORITHM_RESULT_H
3
5#include <chrono>
6#include <ostream>
7#include <vector>
8
9namespace bitrl
10{
11namespace utils
12{
13
19{
20
25
30
35
39 bool converged = false;
40
44 std::chrono::duration<real_t> total_time;
45
49 std::vector<real_t> residuals;
50
55
60 std::chrono::duration<real_t> time);
61
65 std::ostream &print(std::ostream &out) const;
66};
67
68inline std::ostream &operator<<(std::ostream &out, const IterativeAlgorithmResult &result)
69{
70 return result.print(out);
71}
72
73} // namespace utils
74} // namespace bitrl
75#endif // ITERATIVE_ALGORITHM_RESULT_H
Definition bitrl_concepts.h:22
std::ostream & operator<<(std::ostream &out, const IterativeAlgorithmResult &result)
Definition iterative_algorithm_result.h:68
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
The IterativeAlgorithmResult struct. Helper struct to assemble the result of an iterative algorithm.
Definition iterative_algorithm_result.h:19
std::chrono::duration< real_t > total_time
total_time
Definition iterative_algorithm_result.h:44
real_t tolerance
tolerance
Definition iterative_algorithm_result.h:24
uint_t num_iterations
num_iterations
Definition iterative_algorithm_result.h:34
bool converged
converged
Definition iterative_algorithm_result.h:39
IterativeAlgorithmResult()=default
IterativeAlgorithmResult.
std::ostream & print(std::ostream &out) const
print
real_t residual
residual
Definition iterative_algorithm_result.h:29
std::vector< real_t > residuals
residuals
Definition iterative_algorithm_result.h:49
IterativeAlgorithmResult(real_t tol, real_t res, uint_t nitrs, std::chrono::duration< real_t > time)
IterativeAlgorithmResult.