\doxysection{residual\+\_\+norm.\+hpp}
\hypertarget{residual__norm_8hpp_source}{}\label{residual__norm_8hpp_source}\index{ginkgo/core/stop/residual\_norm.hpp@{ginkgo/core/stop/residual\_norm.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2025\ The\ Ginkgo\ authors}}
\DoxyCodeLine{00002\ \textcolor{comment}{//}}
\DoxyCodeLine{00003\ \textcolor{comment}{//\ SPDX-\/License-\/Identifier:\ BSD-\/3-\/Clause}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifndef\ GKO\_PUBLIC\_CORE\_STOP\_RESIDUAL\_NORM\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_STOP\_RESIDUAL\_NORM\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <limits>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/array.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/math.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/utils.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/dense.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/criterion.hpp>}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00020\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1stop}{stop}}\ \{}
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00037\ \textcolor{keyword}{enum\ class}\ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}\ \{\ absolute,\ initial\_resnorm,\ rhs\_norm\ \};}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00049\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00050\ \textcolor{keyword}{class\ }ResidualNormBase}
\DoxyCodeLine{00051\ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<ResidualNormBase<ValueType>,\ Criterion>\ \{}
\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<ResidualNormBase<ValueType>,}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1stop_1_1Criterion}{Criterion}}>;}
\DoxyCodeLine{00054\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_TYPE;}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00057\ \ \ \ \ \textcolor{keyword}{using\ }absolute\_type\ =\ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}};}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keyword}{using\ }ComplexVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<to\_complex<ValueType>}}>;}
\DoxyCodeLine{00059\ \ \ \ \ \textcolor{keyword}{using\ }NormVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<absolute\_type>}};}
\DoxyCodeLine{00060\ \ \ \ \ \textcolor{keyword}{using\ }Vector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<ValueType>}};}
\DoxyCodeLine{00061\ \ \ \ \ \textcolor{keywordtype}{bool}\ check\_impl(\doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ stoppingId,\ \textcolor{keywordtype}{bool}\ setFinalized,}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<stopping\_status>}}*\ stop\_status,\ \textcolor{keywordtype}{bool}*\ one\_changed,}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stop_1_1Criterion_1_1Updater}{Criterion::Updater}}\&\ updater)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{keyword}{explicit}\ ResidualNormBase(std::shared\_ptr<const\ gko::Executor>\ exec)}
\DoxyCodeLine{00066\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject<ResidualNormBase,\ Criterion>}}(exec),}
\DoxyCodeLine{00067\ \ \ \ \ \ \ \ \ \ \ device\_storage\_\{exec,\ 2\}}
\DoxyCodeLine{00068\ \ \ \ \ \{\}}
\DoxyCodeLine{00069\ }
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keyword}{explicit}\ ResidualNormBase(std::shared\_ptr<const\ gko::Executor>\ exec,}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1CriterionArgs}{CriterionArgs}}\&\ args,}
\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ absolute\_type\ reduction\_factor,\ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}\ baseline);}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00074\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ reduction\_factor\_\{\};}
\DoxyCodeLine{00075\ \ \ \ \ std::unique\_ptr<NormVector>\ starting\_tau\_\{\};}
\DoxyCodeLine{00076\ \ \ \ \ std::unique\_ptr<NormVector>\ u\_dense\_tau\_\{\};}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{comment}{/*\ Contains\ device\ side:\ all\_converged\ and\ one\_changed\ booleans\ */}}
\DoxyCodeLine{00078\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<bool>}}\ device\_storage\_;}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00081\ \ \ \ \ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}\ baseline\_\{mode::rhs\_norm\};}
\DoxyCodeLine{00082\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix\_\{\};}
\DoxyCodeLine{00083\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ b\_\{\};}
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{comment}{/*\ one/neg\_one\ for\ residual\ computation\ */}}
\DoxyCodeLine{00085\ \ \ \ \ std::shared\_ptr<const\ Vector>\ one\_\{\};}
\DoxyCodeLine{00086\ \ \ \ \ std::shared\_ptr<const\ Vector>\ neg\_one\_\{\};}
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{comment}{//\ workspace\ for\ reduction}}
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keyword}{mutable}\ \doxymbox{\hyperlink{classgko_1_1array}{gko::array<char>}}\ reduction\_tmp\_;}
\DoxyCodeLine{00089\ \};}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ }
\DoxyCodeLine{00112\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00113\ \textcolor{keyword}{class\ }ResidualNorm\ :\ \textcolor{keyword}{public}\ ResidualNormBase<ValueType>\ \{}
\DoxyCodeLine{00114\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00115\ \ \ \ \ \textcolor{keyword}{using\ }ComplexVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<to\_complex<ValueType>}}>;}
\DoxyCodeLine{00116\ \ \ \ \ \textcolor{keyword}{using\ }NormVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<remove\_complex<ValueType>}}>;}
\DoxyCodeLine{00117\ \ \ \ \ \textcolor{keyword}{using\ }Vector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<ValueType>}};}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00119\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1stop_1_1ResidualNorm_1_1Factory}{Factory}})}
\DoxyCodeLine{00120\ \ \ \ \ \{}
\DoxyCodeLine{00124\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1ResidualNorm_1_1parameters__type_a4b21f43cb4c33dd4b41e0e687bab5089}{reduction\_factor}}\{}
\DoxyCodeLine{00125\ \ \ \ \ \ \ \ \ \ \ \ \ 5\ *\ std\ ::numeric\_limits<remove\_complex<ValueType>>::epsilon()\};}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00127\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1stop_1_1ResidualNorm_1_1parameters__type}{parameters\_type}}\&\ with\_reduction\_factor(\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ value)}
\DoxyCodeLine{00128\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00129\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>reduction\_factor\ =\ value;}
\DoxyCodeLine{00130\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00131\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00132\ }
\DoxyCodeLine{00137\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1stop_1_1ResidualNorm_1_1parameters__type_a845b588b794200edea462bccb10bf2e4}{baseline}},\ mode::rhs\_norm);}
\DoxyCodeLine{00138\ \ \ \ \ \};}
\DoxyCodeLine{00139\ \ \ \ \ GKO\_ENABLE\_CRITERION\_FACTORY(ResidualNorm<ValueType>,\ parameters,\ Factory);}
\DoxyCodeLine{00140\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00142\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00143\ \ \ \ \ \textcolor{keyword}{explicit}\ ResidualNorm(std::shared\_ptr<const\ gko::Executor>\ exec)}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(exec)}
\DoxyCodeLine{00145\ \ \ \ \ \{\}}
\DoxyCodeLine{00146\ }
\DoxyCodeLine{00147\ \ \ \ \ \textcolor{keyword}{explicit}\ ResidualNorm(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stop_1_1ResidualNorm_1_1Factory}{Factory}}*\ factory,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1CriterionArgs}{CriterionArgs}}\&\ args)}
\DoxyCodeLine{00148\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(}
\DoxyCodeLine{00149\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_executor(),\ args,}
\DoxyCodeLine{00150\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_parameters().reduction\_factor,}
\DoxyCodeLine{00151\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_parameters().baseline),}
\DoxyCodeLine{00152\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00153\ \ \ \ \ \{\}}
\DoxyCodeLine{00154\ \};}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00174\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00175\ \textcolor{keyword}{class\ }ImplicitResidualNorm\ :\ \textcolor{keyword}{public}\ ResidualNormBase<ValueType>\ \{}
\DoxyCodeLine{00176\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00177\ \ \ \ \ \textcolor{keyword}{using\ }ComplexVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<to\_complex<ValueType>}}>;}
\DoxyCodeLine{00178\ \ \ \ \ \textcolor{keyword}{using\ }NormVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<remove\_complex<ValueType>}}>;}
\DoxyCodeLine{00179\ \ \ \ \ \textcolor{keyword}{using\ }Vector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<ValueType>}};}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00181\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1stop_1_1ImplicitResidualNorm_1_1Factory}{Factory}})}
\DoxyCodeLine{00182\ \ \ \ \ \{}
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1ImplicitResidualNorm_1_1parameters__type_a1350c90c9339b9ad86cde9247163a599}{reduction\_factor}}\{}
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ \ \ \ \ 5\ *\ std\ ::numeric\_limits<remove\_complex<ValueType>>::epsilon()\};}
\DoxyCodeLine{00188\ }
\DoxyCodeLine{00189\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1stop_1_1ImplicitResidualNorm_1_1parameters__type}{parameters\_type}}\&\ with\_reduction\_factor(\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ value)}
\DoxyCodeLine{00190\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00191\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>reduction\_factor\ =\ value;}
\DoxyCodeLine{00192\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00193\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00194\ }
\DoxyCodeLine{00199\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1stop_1_1ImplicitResidualNorm_1_1parameters__type_a6461458a3f3de03615d338b9122981c7}{baseline}},\ mode::rhs\_norm);}
\DoxyCodeLine{00200\ \ \ \ \ \};}
\DoxyCodeLine{00201\ \ \ \ \ GKO\_ENABLE\_CRITERION\_FACTORY(ImplicitResidualNorm<ValueType>,\ parameters,}
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Factory);}
\DoxyCodeLine{00203\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00204\ }
\DoxyCodeLine{00205\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00206\ \ \ \ \ \textcolor{comment}{//\ check\_impl\ needs\ to\ be\ overwritten\ again\ since\ we\ focus\ on\ the\ implicit}}
\DoxyCodeLine{00207\ \ \ \ \ \textcolor{comment}{//\ residual\ here}}
\DoxyCodeLine{00208\ \ \ \ \ \textcolor{keywordtype}{bool}\ check\_impl(\doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ stoppingId,\ \textcolor{keywordtype}{bool}\ setFinalized,}
\DoxyCodeLine{00209\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<stopping\_status>}}*\ stop\_status,\ \textcolor{keywordtype}{bool}*\ one\_changed,}
\DoxyCodeLine{00210\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stop_1_1Criterion_1_1Updater}{Criterion::Updater}}\&\ updater)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00211\ }
\DoxyCodeLine{00212\ \ \ \ \ \textcolor{keyword}{explicit}\ ImplicitResidualNorm(std::shared\_ptr<const\ gko::Executor>\ exec)}
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(exec)}
\DoxyCodeLine{00214\ \ \ \ \ \{\}}
\DoxyCodeLine{00215\ }
\DoxyCodeLine{00216\ \ \ \ \ \textcolor{keyword}{explicit}\ ImplicitResidualNorm(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stop_1_1ImplicitResidualNorm_1_1Factory}{Factory}}*\ factory,}
\DoxyCodeLine{00217\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1CriterionArgs}{CriterionArgs}}\&\ args)}
\DoxyCodeLine{00218\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(}
\DoxyCodeLine{00219\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_executor(),\ args,}
\DoxyCodeLine{00220\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_parameters().reduction\_factor,}
\DoxyCodeLine{00221\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_parameters().baseline),}
\DoxyCodeLine{00222\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00223\ \ \ \ \ \{\}}
\DoxyCodeLine{00224\ \};}
\DoxyCodeLine{00225\ }
\DoxyCodeLine{00226\ }
\DoxyCodeLine{00227\ \textcolor{comment}{//\ The\ following\ classes\ are\ deprecated,\ but\ they\ internally\ reference}}
\DoxyCodeLine{00228\ \textcolor{comment}{//\ themselves.\ To\ reduce\ unnecessary\ warnings,\ we\ disable\ deprecation\ warnings}}
\DoxyCodeLine{00229\ \textcolor{comment}{//\ for\ the\ definition\ of\ these\ classes.}}
\DoxyCodeLine{00230\ GKO\_BEGIN\_DISABLE\_DEPRECATION\_WARNINGS}
\DoxyCodeLine{00231\ }
\DoxyCodeLine{00232\ }
\DoxyCodeLine{00252\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00253\ \textcolor{keyword}{class\ }GKO\_DEPRECATED(}
\DoxyCodeLine{00254\ \ \ \ \ \textcolor{stringliteral}{"{}Please\ use\ the\ class\ ResidualNorm\ with\ the\ factory\ parameter\ baseline\ =\ "{}}}
\DoxyCodeLine{00255\ \ \ \ \ \textcolor{stringliteral}{"{}mode::initial\_resnorm"{}})\ ResidualNormReduction}
\DoxyCodeLine{00256\ \ \ \ \ :\ \textcolor{keyword}{public}\ ResidualNormBase<ValueType>\ \{}
\DoxyCodeLine{00257\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00258\ \ \ \ \ \textcolor{keyword}{using\ }ComplexVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<to\_complex<ValueType>}}>;}
\DoxyCodeLine{00259\ \ \ \ \ \textcolor{keyword}{using\ }NormVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<remove\_complex<ValueType>}}>;}
\DoxyCodeLine{00260\ \ \ \ \ \textcolor{keyword}{using\ }Vector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<ValueType>}};}
\DoxyCodeLine{00261\ }
\DoxyCodeLine{00262\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1stop_1_1ResidualNormReduction_1_1Factory}{Factory}})}
\DoxyCodeLine{00263\ \ \ \ \ \{}
\DoxyCodeLine{00267\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1ResidualNormReduction_1_1parameters__type_a488ffd39d7ea7fc9093a0e7604be2746}{reduction\_factor}}\{}
\DoxyCodeLine{00268\ \ \ \ \ \ \ \ \ \ \ \ \ 5\ *\ std\ ::numeric\_limits<remove\_complex<ValueType>>::epsilon()\};}
\DoxyCodeLine{00269\ }
\DoxyCodeLine{00270\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1stop_1_1ResidualNormReduction_1_1parameters__type}{parameters\_type}}\&\ with\_reduction\_factor(\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ value)}
\DoxyCodeLine{00271\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00272\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>reduction\_factor\ =\ value;}
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00274\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00275\ \ \ \ \ \};}
\DoxyCodeLine{00276\ \ \ \ \ GKO\_ENABLE\_CRITERION\_FACTORY(ResidualNormReduction<ValueType>,\ parameters,}
\DoxyCodeLine{00277\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Factory);}
\DoxyCodeLine{00278\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00279\ }
\DoxyCodeLine{00280\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00281\ \ \ \ \ \textcolor{keyword}{explicit}\ ResidualNormReduction(std::shared\_ptr<const\ gko::Executor>\ exec)}
\DoxyCodeLine{00282\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(exec)}
\DoxyCodeLine{00283\ \ \ \ \ \{\}}
\DoxyCodeLine{00284\ }
\DoxyCodeLine{00285\ \ \ \ \ \textcolor{keyword}{explicit}\ ResidualNormReduction(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stop_1_1ResidualNormReduction_1_1Factory}{Factory}}*\ factory,}
\DoxyCodeLine{00286\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1CriterionArgs}{CriterionArgs}}\&\ args)}
\DoxyCodeLine{00287\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(}
\DoxyCodeLine{00288\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_executor(),\ args,}
\DoxyCodeLine{00289\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_parameters().reduction\_factor,}
\DoxyCodeLine{00290\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}::initial\_resnorm),}
\DoxyCodeLine{00291\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00292\ \ \ \ \ \{\}}
\DoxyCodeLine{00293\ \};}
\DoxyCodeLine{00294\ }
\DoxyCodeLine{00295\ }
\DoxyCodeLine{00314\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00315\ \textcolor{keyword}{class\ }GKO\_DEPRECATED(}
\DoxyCodeLine{00316\ \ \ \ \ \textcolor{stringliteral}{"{}Please\ use\ the\ class\ ResidualNorm\ with\ the\ factory\ parameter\ baseline\ =\ "{}}}
\DoxyCodeLine{00317\ \ \ \ \ \textcolor{stringliteral}{"{}mode::rhs\_norm"{}})\ RelativeResidualNorm}
\DoxyCodeLine{00318\ \ \ \ \ :\ \textcolor{keyword}{public}\ ResidualNormBase<ValueType>\ \{}
\DoxyCodeLine{00319\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00320\ \ \ \ \ \textcolor{keyword}{using\ }ComplexVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<to\_complex<ValueType>}}>;}
\DoxyCodeLine{00321\ \ \ \ \ \textcolor{keyword}{using\ }NormVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<remove\_complex<ValueType>}}>;}
\DoxyCodeLine{00322\ \ \ \ \ \textcolor{keyword}{using\ }Vector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<ValueType>}};}
\DoxyCodeLine{00323\ }
\DoxyCodeLine{00324\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1stop_1_1RelativeResidualNorm_1_1Factory}{Factory}})}
\DoxyCodeLine{00325\ \ \ \ \ \{}
\DoxyCodeLine{00329\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1RelativeResidualNorm_1_1parameters__type_a5bc4bf49a0b2dca7de35d3ba618ecbc9}{tolerance}}\{}
\DoxyCodeLine{00330\ \ \ \ \ \ \ \ \ \ \ \ \ 5\ *\ std\ ::numeric\_limits<remove\_complex<ValueType>>::epsilon()\};}
\DoxyCodeLine{00331\ }
\DoxyCodeLine{00332\ }
\DoxyCodeLine{00333\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1stop_1_1RelativeResidualNorm_1_1parameters__type}{parameters\_type}}\&\ with\_tolerance(\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ value)}
\DoxyCodeLine{00334\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00335\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>tolerance\ =\ value;}
\DoxyCodeLine{00336\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00337\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00338\ \ \ \ \ \};}
\DoxyCodeLine{00339\ \ \ \ \ GKO\_ENABLE\_CRITERION\_FACTORY(RelativeResidualNorm<ValueType>,\ parameters,}
\DoxyCodeLine{00340\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Factory);}
\DoxyCodeLine{00341\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00342\ }
\DoxyCodeLine{00343\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00344\ \ \ \ \ \textcolor{keyword}{explicit}\ RelativeResidualNorm(std::shared\_ptr<const\ gko::Executor>\ exec)}
\DoxyCodeLine{00345\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(exec)}
\DoxyCodeLine{00346\ \ \ \ \ \{\}}
\DoxyCodeLine{00347\ }
\DoxyCodeLine{00348\ \ \ \ \ \textcolor{keyword}{explicit}\ RelativeResidualNorm(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stop_1_1RelativeResidualNorm_1_1Factory}{Factory}}*\ factory,}
\DoxyCodeLine{00349\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1CriterionArgs}{CriterionArgs}}\&\ args)}
\DoxyCodeLine{00350\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(factory-\/>get\_executor(),\ args,}
\DoxyCodeLine{00351\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_parameters().tolerance,}
\DoxyCodeLine{00352\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}::rhs\_norm),}
\DoxyCodeLine{00353\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00354\ \ \ \ \ \{\}}
\DoxyCodeLine{00355\ \};}
\DoxyCodeLine{00356\ }
\DoxyCodeLine{00357\ }
\DoxyCodeLine{00375\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00376\ \textcolor{keyword}{class\ }GKO\_DEPRECATED(}
\DoxyCodeLine{00377\ \ \ \ \ \textcolor{stringliteral}{"{}Please\ use\ the\ class\ ResidualNorm\ with\ the\ factory\ parameter\ baseline\ =\ "{}}}
\DoxyCodeLine{00378\ \ \ \ \ \textcolor{stringliteral}{"{}mode::absolute"{}})\ AbsoluteResidualNorm}
\DoxyCodeLine{00379\ \ \ \ \ :\ \textcolor{keyword}{public}\ ResidualNormBase<ValueType>\ \{}
\DoxyCodeLine{00380\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00381\ \ \ \ \ \textcolor{keyword}{using\ }NormVector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<remove\_complex<ValueType>}}>;}
\DoxyCodeLine{00382\ \ \ \ \ \textcolor{keyword}{using\ }Vector\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<ValueType>}};}
\DoxyCodeLine{00383\ }
\DoxyCodeLine{00384\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1stop_1_1AbsoluteResidualNorm_1_1Factory}{Factory}})}
\DoxyCodeLine{00385\ \ \ \ \ \{}
\DoxyCodeLine{00389\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1AbsoluteResidualNorm_1_1parameters__type_a0f8a19b8757e2246e60cd37ae3110f70}{tolerance}}\{}
\DoxyCodeLine{00390\ \ \ \ \ \ \ \ \ \ \ \ \ 5\ *\ std\ ::numeric\_limits<remove\_complex<ValueType>>::epsilon()\};}
\DoxyCodeLine{00391\ }
\DoxyCodeLine{00392\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1stop_1_1AbsoluteResidualNorm_1_1parameters__type}{parameters\_type}}\&\ with\_tolerance(\doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}}\ value)}
\DoxyCodeLine{00393\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00394\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>tolerance\ =\ value;}
\DoxyCodeLine{00395\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00396\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00397\ \ \ \ \ \};}
\DoxyCodeLine{00398\ \ \ \ \ GKO\_ENABLE\_CRITERION\_FACTORY(AbsoluteResidualNorm<ValueType>,\ parameters,}
\DoxyCodeLine{00399\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Factory);}
\DoxyCodeLine{00400\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00401\ }
\DoxyCodeLine{00402\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00403\ \ \ \ \ \textcolor{keyword}{explicit}\ AbsoluteResidualNorm(std::shared\_ptr<const\ gko::Executor>\ exec)}
\DoxyCodeLine{00404\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(exec)}
\DoxyCodeLine{00405\ \ \ \ \ \{\}}
\DoxyCodeLine{00406\ }
\DoxyCodeLine{00407\ \ \ \ \ \textcolor{keyword}{explicit}\ AbsoluteResidualNorm(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stop_1_1AbsoluteResidualNorm_1_1Factory}{Factory}}*\ factory,}
\DoxyCodeLine{00408\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1stop_1_1CriterionArgs}{CriterionArgs}}\&\ args)}
\DoxyCodeLine{00409\ \ \ \ \ \ \ \ \ :\ ResidualNormBase<ValueType>(factory-\/>get\_executor(),\ args,}
\DoxyCodeLine{00410\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factory-\/>get\_parameters().tolerance,}
\DoxyCodeLine{00411\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__stop_ga5fe97c4263e876f68b5d4a21f0e615b9}{mode}}::absolute),}
\DoxyCodeLine{00412\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00413\ \ \ \ \ \{\}}
\DoxyCodeLine{00414\ \};}
\DoxyCodeLine{00415\ }
\DoxyCodeLine{00416\ }
\DoxyCodeLine{00417\ GKO\_END\_DISABLE\_DEPRECATION\_WARNINGS}
\DoxyCodeLine{00418\ }
\DoxyCodeLine{00419\ }
\DoxyCodeLine{00420\ \}\ \ \textcolor{comment}{//\ namespace\ stop}}
\DoxyCodeLine{00421\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00422\ }
\DoxyCodeLine{00423\ }
\DoxyCodeLine{00424\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_STOP\_RESIDUAL\_NORM\_HPP\_}}

\end{DoxyCode}
