\doxysection{stopping\+\_\+status.\+hpp}
\hypertarget{stopping__status_8hpp_source}{}\label{stopping__status_8hpp_source}\index{ginkgo/core/stop/stopping\_status.hpp@{ginkgo/core/stop/stopping\_status.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2024\ 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\_STOPPING\_STATUS\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_STOP\_STOPPING\_STATUS\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/array.hpp>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00021\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\ \{}
\DoxyCodeLine{00022\ \ \ \ \ \textcolor{keyword}{friend}\ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_a45c932e7bd73353ad26ad3991780e60e}{operator==}}(}
\DoxyCodeLine{00023\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ x,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ y)\ \textcolor{keyword}{noexcept};}
\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keyword}{friend}\ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_ad201df1712533eab86e762772ac7170b}{operator!=}}(}
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ x,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ y)\ \textcolor{keyword}{noexcept};}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00032\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_af374c7164dcf3adb27a15a669714abcc}{has\_stopped}}()\ const\ noexcept}
\DoxyCodeLine{00033\ \ \ \ \ \{}
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_ae3c4d0e7a01f4e1892a09f418ea0907d}{get\_id}}();}
\DoxyCodeLine{00035\ \ \ \ \ \}}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00041\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_a825e74142fdaf17e9570d06db0b378db}{has\_converged}}()\ const\ noexcept}
\DoxyCodeLine{00042\ \ \ \ \ \{}
\DoxyCodeLine{00043\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ data\_\ \&\ converged\_mask\_;}
\DoxyCodeLine{00044\ \ \ \ \ \}}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00051\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_a7c8b094d37449098ca4ddb1f4bbf10bd}{is\_finalized}}()\ const\ noexcept}
\DoxyCodeLine{00052\ \ \ \ \ \{}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ data\_\ \&\ finalized\_mask\_;}
\DoxyCodeLine{00054\ \ \ \ \ \}}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00060\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_ae3c4d0e7a01f4e1892a09f418ea0907d}{get\_id}}()\ const\ noexcept}
\DoxyCodeLine{00061\ \ \ \ \ \{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ data\_\ \&\ id\_mask\_;}
\DoxyCodeLine{00063\ \ \ \ \ \}}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00068\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_afb227192722d1c20d11ae15719e1f930}{reset}}()\ noexcept\ \{\ data\_\ =\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\{0\};\ \}}
\DoxyCodeLine{00069\ }
\DoxyCodeLine{00077\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_ab13d4f214328c9574fdef6168c671de0}{stop}}(\doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ \textcolor{keywordtype}{id},}
\DoxyCodeLine{00078\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ set\_finalized\ =\ \textcolor{keyword}{true})\ noexcept}
\DoxyCodeLine{00079\ \ \ \ \ \{}
\DoxyCodeLine{00080\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!this-\/>\doxymbox{\hyperlink{classgko_1_1stopping__status_af374c7164dcf3adb27a15a669714abcc}{has\_stopped}}())\ \{}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ \ \ \ \ data\_\ |=\ (\textcolor{keywordtype}{id}\ \&\ id\_mask\_);}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (set\_finalized)\ \{}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ data\_\ |=\ finalized\_mask\_;}
\DoxyCodeLine{00084\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00086\ \ \ \ \ \}}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00094\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_a611bf8c81a8e3b22bab8f19ff68e8a12}{converge}}(\doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ \textcolor{keywordtype}{id},}
\DoxyCodeLine{00095\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ set\_finalized\ =\ \textcolor{keyword}{true})\ noexcept}
\DoxyCodeLine{00096\ \ \ \ \ \{}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!this-\/>\doxymbox{\hyperlink{classgko_1_1stopping__status_af374c7164dcf3adb27a15a669714abcc}{has\_stopped}}())\ \{}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \ \ \ \ data\_\ |=\ converged\_mask\_\ |\ (\textcolor{keywordtype}{id}\ \&\ id\_mask\_);}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (set\_finalized)\ \{}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ data\_\ |=\ finalized\_mask\_;}
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00103\ \ \ \ \ \}}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00109\ \ \ \ \ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_a56d82a88a20cc1954981e75a66e996bc}{finalize}}()\ noexcept}
\DoxyCodeLine{00110\ \ \ \ \ \{}
\DoxyCodeLine{00111\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (this-\/>\doxymbox{\hyperlink{classgko_1_1stopping__status_af374c7164dcf3adb27a15a669714abcc}{has\_stopped}}())\ \{}
\DoxyCodeLine{00112\ \ \ \ \ \ \ \ \ \ \ \ \ data\_\ |=\ finalized\_mask\_;}
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00114\ \ \ \ \ \}}
\DoxyCodeLine{00115\ }
\DoxyCodeLine{00116\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00117\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ converged\_mask\_\ =\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\{1\}\ <<\ 7;}
\DoxyCodeLine{00118\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ finalized\_mask\_\ =\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\{1\}\ <<\ 6;}
\DoxyCodeLine{00119\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ id\_mask\_\ =\ (\doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\{1\}\ <<\ 6)\ -\/\ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\{1\};}
\DoxyCodeLine{00120\ }
\DoxyCodeLine{00121\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a06d96f1ecdca6b86399173969771c3fb}{uint8}}\ data\_;}
\DoxyCodeLine{00122\ \};}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00134\ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_a45c932e7bd73353ad26ad3991780e60e}{operator==}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ x,}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ y)\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00136\ \{}
\DoxyCodeLine{00137\ \ \ \ \ \textcolor{keywordflow}{return}\ x.data\_\ ==\ y.data\_;}
\DoxyCodeLine{00138\ \}}
\DoxyCodeLine{00139\ }
\DoxyCodeLine{00140\ }
\DoxyCodeLine{00149\ GKO\_ATTRIBUTES\ GKO\_INLINE\ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1stopping__status_ad201df1712533eab86e762772ac7170b}{operator!=}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ x,}
\DoxyCodeLine{00150\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1stopping__status}{stopping\_status}}\&\ y)\ \textcolor{keyword}{noexcept}}
\DoxyCodeLine{00151\ \{}
\DoxyCodeLine{00152\ \ \ \ \ \textcolor{keywordflow}{return}\ x.data\_\ !=\ y.data\_;}
\DoxyCodeLine{00153\ \}}
\DoxyCodeLine{00154\ }
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00157\ }
\DoxyCodeLine{00158\ }
\DoxyCodeLine{00159\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_STOP\_STOPPING\_STATUS\_HPP\_}}

\end{DoxyCode}
