Ginkgo Generated from branch based on main. Ginkgo version 1.11.0
A numerical linear algebra library targeting many-core architectures
Loading...
Searching...
No Matches
gko::stop::Criterion::Updater Class Reference

The Updater class serves for convenient argument passing to the Criterion's check function. More...

#include <ginkgo/core/stop/criterion.hpp>

Collaboration diagram for gko::stop::Criterion::Updater:
[legend]

Public Member Functions

 Updater (const Updater &)=delete
 Prevent copying and moving the object This is to enforce the use of argument passing and calling check at the same time.
 Updater (Updater &&)=delete
Updater & operator= (const Updater &)=delete
Updater & operator= (Updater &&)=delete
bool check (uint8 stopping_id, bool set_finalized, array< stopping_status > *stop_status, bool *one_changed) const
 Calls the parent Criterion object's check method.
const Updater & num_iterations (size_type const &value) const
const Updater & ignore_residual_check (bool const &value) const
const Updater & residual (ptr_param< const LinOp > value) const
const Updater & residual_norm (ptr_param< const LinOp > value) const
const Updater & implicit_sq_residual_norm (ptr_param< const LinOp > value) const
const Updater & solution (ptr_param< const LinOp > value) const

Public Attributes

size_type num_iterations_ {}
bool ignore_residual_check_ {}
const LinOp * residual_ {}
const LinOp * residual_norm_ {}
const LinOp * implicit_sq_residual_norm_ {}
const LinOp * solution_ {}

Friends

class Criterion

Detailed Description

The Updater class serves for convenient argument passing to the Criterion's check function.

The pattern used is a Builder, except Updater builds a function's arguments before calling the function itself, and does not build an object. This allows calling a Criterion's check in the form of: stop_criterion->update() .num_iterations(num_iterations) .ignore_residual_check(ignore_residual_check) .residual_norm(residual_norm) .implicit_sq_residual_norm(implicit_sq_residual_norm) .residual(residual) .solution(solution) .check(converged);

If there is a need for a new form of data to pass to the Criterion, it should be added here.

Constructor & Destructor Documentation

◆ Updater()

gko::stop::Criterion::Updater::Updater ( const Updater & )
delete

Prevent copying and moving the object This is to enforce the use of argument passing and calling check at the same time.

References Updater().

Referenced by Updater().

Member Function Documentation

◆ check()

bool gko::stop::Criterion::Updater::check ( uint8 stopping_id,
bool set_finalized,
array< stopping_status > * stop_status,
bool * one_changed ) const
inline

Calls the parent Criterion object's check method.


The documentation for this class was generated from the following file: