\doxysection{gauss\+\_\+seidel.\+hpp}
\hypertarget{gauss__seidel_8hpp_source}{}\label{gauss__seidel_8hpp_source}\index{ginkgo/core/preconditioner/gauss\_seidel.hpp@{ginkgo/core/preconditioner/gauss\_seidel.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\_PRECONDITIONER\_GAUSS\_SEIDEL\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_PRECONDITIONER\_GAUSS\_SEIDEL\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/abstract\_factory.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/composition.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/polymorphic\_object.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/config.hpp>}}
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1preconditioner}{preconditioner}}\ \{}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00032\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision,\ \textcolor{keyword}{typename}\ IndexType\ =\ \textcolor{keywordtype}{int}32>}
\DoxyCodeLine{00033\ \textcolor{keyword}{class\ }GaussSeidel}
\DoxyCodeLine{00034\ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<GaussSeidel<ValueType,\ IndexType>,}
\DoxyCodeLine{00035\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LinOpFactory>,}
\DoxyCodeLine{00036\ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{EnablePolymorphicAssignment}}<GaussSeidel<ValueType,\ IndexType>>\ \{}
\DoxyCodeLine{00037\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<GaussSeidel,\ \doxymbox{\hyperlink{classgko_1_1LinOpFactory}{LinOpFactory}}>;}
\DoxyCodeLine{00038\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_AND\_INDEX\_TYPE;}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00040\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1preconditioner_1_1GaussSeidel_1_1parameters__type}{parameters\_type}};}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1enable__parameters__type}{enable\_parameters\_type}}<\doxymbox{\hyperlink{structgko_1_1preconditioner_1_1GaussSeidel_1_1parameters__type}{parameters\_type}},\ GaussSeidel>;}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keyword}{using\ }composition\_type\ =\ \doxymbox{\hyperlink{classgko_1_1Composition}{Composition<ValueType>}};}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ \ \ \ \ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1preconditioner_1_1GaussSeidel_1_1parameters__type}{parameters\_type}}}
\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1enable__parameters__type}{enable\_parameters\_type}}<parameters\_type,\ GaussSeidel>\ \{}
\DoxyCodeLine{00050\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ skip\ sorting\ of\ input\ matrix}}
\DoxyCodeLine{00051\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(skip\_sorting,\ \textcolor{keyword}{false});}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ determines\ if\ Gauss-\/Seidel\ or\ symmetric\ Gauss-\/Seidel\ should\ be\ used}}
\DoxyCodeLine{00054\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(symmetric,\ \textcolor{keyword}{false});}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ factory\ for\ the\ lower\ triangular\ factor\ solver,\ defaults\ to\ LowerTrs}}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOpFactory>\ GKO\_DEFERRED\_FACTORY\_PARAMETER(}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver);}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ factory\ for\ the\ upper\ triangular\ factor\ solver,\ unused\ if\ symmetric}}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ is\ false,\ defaults\ to\ UpperTrs}}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOpFactory>\ GKO\_DEFERRED\_FACTORY\_PARAMETER(}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \ \ \ \ u\_solver);}
\DoxyCodeLine{00064\ \ \ \ \ \};}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1GaussSeidel_1_1parameters__type}{parameters\_type}}\&\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1GaussSeidel_a1d7ac304c8c0c029bbfa2684a6490132}{get\_parameters}}()\ \{\ \textcolor{keywordflow}{return}\ parameters\_;\ \}}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1GaussSeidel_1_1parameters__type}{parameters\_type}}\&\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1GaussSeidel_aabb629559c90294e74275d9863ad2d74}{get\_parameters}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ parameters\_;\ \}}
\DoxyCodeLine{00077\ }
\DoxyCodeLine{00085\ \ \ \ \ std::unique\_ptr<composition\_type>\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1GaussSeidel_a94cf0b5a3f0189081d106dd73877541e}{generate}}(}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00089\ \ \ \ \ \textcolor{keyword}{static}\ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1GaussSeidel_1_1parameters__type}{parameters\_type}}\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1GaussSeidel_a7dbce0fc2e2e9a1eaca030a9f368b739}{build}}()\ \{\ \textcolor{keywordflow}{return}\ \{\};\ \}}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \ \ \ \ \textcolor{keyword}{static}\ parameters\_type\ parse(}
\DoxyCodeLine{00092\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode}{config::pnode}}\&\ config,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1registry}{config::registry}}\&\ context,}
\DoxyCodeLine{00093\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::type\_descriptor}}\&\ td\_for\_child\ =}
\DoxyCodeLine{00094\ \ \ \ \ \ \ \ \ \ \ \ \ config::make\_type\_descriptor<ValueType,\ IndexType>());}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00096\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00097\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1GaussSeidel}{GaussSeidel}}(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ parameters\_type\&\ params\ =\ \{\})}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<GaussSeidel,\ \doxymbox{\hyperlink{classgko_1_1LinOpFactory}{LinOpFactory}}>(exec),}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \ \ parameters\_(params)}
\DoxyCodeLine{00101\ \ \ \ \ \{\}}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ \ \ \ \ std::unique\_ptr<LinOp>\ generate\_impl(}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00105\ }
\DoxyCodeLine{00106\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00107\ \ \ \ \ parameters\_type\ parameters\_;}
\DoxyCodeLine{00108\ \};}
\DoxyCodeLine{00109\ }
\DoxyCodeLine{00110\ }
\DoxyCodeLine{00111\ \}\ \ \textcolor{comment}{//\ namespace\ preconditioner}}
\DoxyCodeLine{00112\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00113\ }
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00115\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_PRECONDITIONER\_GAUSS\_SEIDEL\_HPP\_}}

\end{DoxyCode}
