bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
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
4#include "bitrl/bitrl_types.h"
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
OutT resolve(const std::string &name, const std::map< std::string, std::any > &input)
Definition std_map_utils.h:25
std::ostream & operator<<(std::ostream &out, const IterativeAlgorithmResult &result)
Definition iterative_algorithm_result.h:68
Definition bitrl_consts.h:14
double real_t
real_t
Definition bitrl_types.h:23
std::size_t uint_t
uint_t
Definition bitrl_types.h:43
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
Definition iterative_algorithm_result.cpp:14
real_t residual
residual
Definition iterative_algorithm_result.h:29
std::vector< real_t > residuals
residuals
Definition iterative_algorithm_result.h:49