\doxysection{fixed\+\_\+coarsening.\+hpp}
\hypertarget{fixed__coarsening_8hpp_source}{}\label{fixed__coarsening_8hpp_source}\index{ginkgo/core/multigrid/fixed\_coarsening.hpp@{ginkgo/core/multigrid/fixed\_coarsening.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\_MULTIGRID\_FIXED\_COARSENING\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_MULTIGRID\_FIXED\_COARSENING\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/composition.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/exception\_helpers.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/csr.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/dense.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/multigrid/multigrid\_level.hpp>}}
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00021\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1multigrid}{multigrid}}\ \{}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00041\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision,\ \textcolor{keyword}{typename}\ IndexType\ =\ \textcolor{keywordtype}{int}32>}
\DoxyCodeLine{00042\ \textcolor{keyword}{class\ }FixedCoarsening}
\DoxyCodeLine{00043\ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<FixedCoarsening<ValueType,\ IndexType>>,}
\DoxyCodeLine{00044\ \ \ \ \ \ \ \textcolor{keyword}{public}\ EnableMultigridLevel<ValueType>\ \{}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<FixedCoarsening>;}
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<FixedCoarsening,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}>;}
\DoxyCodeLine{00047\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_AND\_INDEX\_TYPE;}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00058\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1FixedCoarsening_a7316baba83470a770156fa2109a8ff47}{get\_system\_matrix}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00059\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ system\_matrix\_;}
\DoxyCodeLine{00061\ \ \ \ \ \}}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1FixedCoarsening_1_1Factory}{Factory}})}
\DoxyCodeLine{00065\ \ \ \ \ \{}
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<IndexType>}}\ \doxymbox{\hyperlink{group__LinOp_gaa292314d27ec1fb7ad54debaa3606ea8}{GKO\_FACTORY\_PARAMETER\_VECTOR}}(\doxymbox{\hyperlink{structgko_1_1multigrid_1_1FixedCoarsening_1_1parameters__type_a234d3b5e05d5368255c632eb924dcd89}{coarse\_rows}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1multigrid_1_1FixedCoarsening_1_1parameters__type_a264325cddb4790bf9864be625ee4fc1b}{skip\_sorting}},\ \textcolor{keyword}{false});}
\DoxyCodeLine{00083\ \ \ \ \ \};}
\DoxyCodeLine{00084\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(FixedCoarsening,\ parameters,\ Factory);}
\DoxyCodeLine{00085\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00087\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x)\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00089\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00090\ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{classgko_1_1UseComposition_a81d7f1c982c43df853ed9b9074e45409}{get\_composition}}()-\/>apply(b,\ x);}
\DoxyCodeLine{00091\ \ \ \ \ \}}
\DoxyCodeLine{00092\ }
\DoxyCodeLine{00093\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ alpha,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ beta,}
\DoxyCodeLine{00094\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x)\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00095\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00096\ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{classgko_1_1UseComposition_a81d7f1c982c43df853ed9b9074e45409}{get\_composition}}()-\/>apply(alpha,\ b,\ beta,\ x);}
\DoxyCodeLine{00097\ \ \ \ \ \}}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00099\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1FixedCoarsening}{FixedCoarsening}}(std::shared\_ptr<const\ Executor>\ exec)}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<\doxymbox{\hyperlink{classgko_1_1multigrid_1_1FixedCoarsening}{FixedCoarsening}}>(\doxymbox{\hyperlink{namespacestd}{std}}::move(exec))}
\DoxyCodeLine{00101\ \ \ \ \ \{\}}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ \ \ \ \ \textcolor{keyword}{explicit}\ FixedCoarsening(\textcolor{keyword}{const}\ Factory*\ factory,}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix)}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<FixedCoarsening>(factory-\/>get\_executor(),}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ system\_matrix-\/>get\_size()),}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \ \ EnableMultigridLevel<ValueType>(system\_matrix),}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\},}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \ \ system\_matrix\_\{system\_matrix\}}
\DoxyCodeLine{00110\ \ \ \ \ \{}
\DoxyCodeLine{00111\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (system\_matrix\_-\/>get\_size()[0]\ !=\ 0)\ \{}
\DoxyCodeLine{00112\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ generate\ on\ the\ existing\ matrix}}
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>generate();}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00115\ \ \ \ \ \}}
\DoxyCodeLine{00116\ }
\DoxyCodeLine{00117\ \ \ \ \ \textcolor{keywordtype}{void}\ generate();}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00119\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00120\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix\_\{\};}
\DoxyCodeLine{00121\ \};}
\DoxyCodeLine{00122\ }
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00124\ \}\ \ \textcolor{comment}{//\ namespace\ multigrid}}
\DoxyCodeLine{00125\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00127\ }
\DoxyCodeLine{00128\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_MULTIGRID\_FIXED\_COARSENING\_HPP\_}}

\end{DoxyCode}
