gko::log::Convergence#
The simplest solver-facing logger. Records the iteration count at
which a solver converged (or stopped) and the residual norm at that
point. Attach to any iterative solver to read back these two numbers
after apply.
-
template<typename ValueType = default_precision>
class Convergence # Inherits from
public gko::log::Logger
Convergence is a Logger which logs data strictly from the
criterion_check_completedevent. The purpose of this logger is to give a simple access to standard data generated by the solver once it has stopped with minimal overhead.This logger also computes the residual norm from the residual when the residual norm was not available. This can add some slight overhead.
Public Functions
-
inline bool has_converged() const noexcept#
Returns true if the solver has converged.
- Returns:
the bool flag for convergence status
-
inline void reset_convergence_status()#
Resets the convergence status to false.
-
inline const size_type &get_num_iterations() const noexcept#
Returns the number of iterations
- Returns:
the number of iterations
Public Static Functions
- std::shared_ptr<const Executor>,
- const mask_type &enabled_events = Logger::criterion_events_mask | Logger::iteration_complete_mask,
Creates a convergence logger. This dynamically allocates the memory, constructs the object and returns an std::unique_ptr to this object.
- Parameters:
exec – the executor
enabled_events – the events enabled for this logger. By default all events.
- Returns:
an std::unique_ptr to the the constructed object
- static inline std::unique_ptr<Convergence> create(
- const mask_type &enabled_events = Logger::criterion_events_mask | Logger::iteration_complete_mask,
Creates a convergence logger. This dynamically allocates the memory, constructs the object and returns an std::unique_ptr to this object.
- Parameters:
enabled_events – the events enabled for this logger. By default all events.
- Returns:
an std::unique_ptr to the the constructed object