1#ifndef ITERATIVE_ALGORITHM_CONTROLLER_H
2#define ITERATIVE_ALGORITHM_CONTROLLER_H
142 uint_t current_iteration_idx_;
145 bool show_iterations_;
146 bool track_residuals_;
151 : max_iterations_(max_iterations), exit_tolerance_(
exit_tolerance), current_iteration_idx_(0),
153 track_residuals_(
false)
Controller for iterative algorithms.
Definition iterative_algorithm_controller.h:17
uint_t get_current_iteration() const
Returns the current iteration index.
Definition iterative_algorithm_controller.h:96
real_t get_residual() const
get_residual
Definition iterative_algorithm_controller.h:117
bool track_residuals() const
track_residuals
Definition iterative_algorithm_controller.h:63
IterativeAlgorithmController(uint_t maxIterations, real_t exitTolerance)
Constructor.
Definition iterative_algorithm_controller.h:149
real_t get_exit_tolerance() const
Returns the exit tolerance for the algorithm.
Definition iterative_algorithm_controller.h:101
uint_t get_num_threads() const
Get the number of threads used.
Definition iterative_algorithm_controller.h:111
uint_t get_max_iterations() const
Return the maximum number of iterations.
Definition iterative_algorithm_controller.h:106
~IterativeAlgorithmController()=default
Destructor.
IterativeAlgorithmController & operator=(const IterativeAlgorithmController &)=default
copy assignement
void set_tolerance(real_t tol)
set_tolerance
Definition iterative_algorithm_controller.h:69
void set_num_threads(uint_t nthreads)
Set the number of threads.
Definition iterative_algorithm_controller.h:85
void set_track_residuals_flag(bool flag)
set_track_residuals_flag
Definition iterative_algorithm_controller.h:80
IterativeAlgorithmResult get_state() const
Returns the state of the controller.
Definition iterative_algorithm_controller.cpp:8
IterativeAlgorithmController(const IterativeAlgorithmController &)=default
Copy constructor.
void reset()
reset
Definition iterative_algorithm_controller.cpp:45
void set_max_itrs(uint_t max_itrs)
set_max_itrs
Definition iterative_algorithm_controller.h:91
IterativeAlgorithmController(IterativeAlgorithmController &&)=default
Move copy constructor.
bool continue_iterations()
Returns true if the iterations of the algorithm should be continued.
Definition iterative_algorithm_controller.cpp:19
IterativeAlgorithmController & operator=(IterativeAlgorithmController &&)=default
move copy assignement
void update_residual(real_t res)
Update the residual.
Definition iterative_algorithm_controller.h:127
bool show_iterations() const
show iterations
Definition iterative_algorithm_controller.h:57
void set_show_iterations_flag(bool flag)
show iterations
Definition iterative_algorithm_controller.h:74
OutT resolve(const std::string &name, const std::map< std::string, std::any > &input)
Definition std_map_utils.h:25
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