\doxysection{reordering\+\_\+base.\+hpp}
\hypertarget{reordering__base_8hpp_source}{}\label{reordering__base_8hpp_source}\index{ginkgo/core/reorder/reordering\_base.hpp@{ginkgo/core/reorder/reordering\_base.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\_REORDER\_REORDERING\_BASE\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_REORDER\_REORDERING\_BASE\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/abstract\_factory.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/array.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/executor.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/polymorphic\_object.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/utils.hpp>}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00025\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1reorder}{reorder}}\ \{}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00033\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ IndexType\ =\ \textcolor{keywordtype}{int}32>}
\DoxyCodeLine{00034\ \textcolor{keyword}{class\ }ReorderingBase}
\DoxyCodeLine{00035\ \ \ \ \ :\ \textcolor{keyword}{public}\ EnableAbstractPolymorphicObject<ReorderingBase<IndexType>>\ \{}
\DoxyCodeLine{00036\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00037\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\&\ get\_permutation\_array()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00040\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ permutation\_array\_;}
\DoxyCodeLine{00042\ \ \ \ \ \}}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keyword}{explicit}\ ReorderingBase(std::shared\_ptr<const\ gko::Executor>\ exec)}
\DoxyCodeLine{00046\ \ \ \ \ \ \ \ \ :\ EnableAbstractPolymorphicObject<ReorderingBase>(exec),}
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ \ \ permutation\_array\_\{exec\}}
\DoxyCodeLine{00048\ \ \ \ \ \{\}}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_permutation\_array(\doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\&\ permutation\_array)}
\DoxyCodeLine{00051\ \ \ \ \ \{}
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ permutation\_array\_\ =\ permutation\_array;}
\DoxyCodeLine{00053\ \ \ \ \ \}}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00056\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ permutation\_array\_;}
\DoxyCodeLine{00057\ \};}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00065\ \textcolor{keyword}{struct\ }ReorderingBaseArgs\ \{}
\DoxyCodeLine{00066\ \ \ \ \ std::shared\_ptr<LinOp>\ system\_matrix;}
\DoxyCodeLine{00067\ }
\DoxyCodeLine{00068\ \ \ \ \ ReorderingBaseArgs(std::shared\_ptr<LinOp>\ system\_matrix)}
\DoxyCodeLine{00069\ \ \ \ \ \ \ \ \ :\ system\_matrix\{system\_matrix\}}
\DoxyCodeLine{00070\ \ \ \ \ \{\}}
\DoxyCodeLine{00071\ \};}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00077\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ IndexType\ =\ \textcolor{keywordtype}{int}32>}
\DoxyCodeLine{00078\ \textcolor{keyword}{using\ }\doxymbox{\hyperlink{namespacegko_1_1reorder_ac510eb7f0f0cdfe813b2469f719786f4}{ReorderingBaseFactory}}\ =}
\DoxyCodeLine{00079\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1AbstractFactory}{AbstractFactory<ReorderingBase<IndexType>}},\ \doxymbox{\hyperlink{structgko_1_1reorder_1_1ReorderingBaseArgs}{ReorderingBaseArgs}}>;}
\DoxyCodeLine{00080\ }
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00097\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ConcreteFactory,\ \textcolor{keyword}{typename}\ ConcreteReorderingBase,}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typename}\ ParametersType,\ \textcolor{keyword}{typename}\ IndexType\ =\ \doxymbox{\hyperlink{namespacegko_a16bd14c10900eb804d784908d8aab5ab}{int32}},}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typename}\ PolymorphicBase\ =\ \doxymbox{\hyperlink{namespacegko_1_1reorder_ac510eb7f0f0cdfe813b2469f719786f4}{ReorderingBaseFactory<IndexType>}}>}
\DoxyCodeLine{00100\ \textcolor{keyword}{using\ }\doxymbox{\hyperlink{namespacegko_1_1reorder_aae01ac35ef4f4280092a3e2c23fd7753}{EnableDefaultReorderingBaseFactory}}\ =}
\DoxyCodeLine{00101\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory}{EnableDefaultFactory}}<ConcreteFactory,\ ConcreteReorderingBase,}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ParametersType,\ PolymorphicBase>;}
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00123\ \textcolor{preprocessor}{\#define\ GKO\_ENABLE\_REORDERING\_BASE\_FACTORY(\_reordering\_base,\ \_parameters\_name,\ \(\backslash\)}}
\DoxyCodeLine{00124\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_factory\_name)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00125\ \textcolor{preprocessor}{public:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00126\ \textcolor{preprocessor}{\ \ \ \ const\ \_parameters\_name\#\#\_type\&\ get\_\#\#\_parameters\_name()\ const\ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00127\ \textcolor{preprocessor}{\ \ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00128\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ return\ \_parameters\_name\#\#\_;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00129\ \textcolor{preprocessor}{\ \ \ \ \}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00130\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00131\ \textcolor{preprocessor}{\ \ \ \ class\ \_factory\_name\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00132\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ :\ public\ ::gko::reorder::EnableDefaultReorderingBaseFactory<\ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00133\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \_factory\_name,\ \_reordering\_base,\ \_parameters\_name\#\#\_type,\ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00134\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ IndexType>\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00135\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ friend\ class\ ::gko::EnablePolymorphicObject<\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00136\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \_factory\_name,\ ::gko::reorder::ReorderingBaseFactory<IndexType>>;\ \ \(\backslash\)}}
\DoxyCodeLine{00137\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ friend\ class\ ::gko::enable\_parameters\_type<\_parameters\_name\#\#\_type,\ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00138\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_factory\_name>;\ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00139\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ explicit\ \_factory\_name(std::shared\_ptr<const\ ::gko::Executor>\ exec)\ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00140\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ :\ ::gko::reorder::EnableDefaultReorderingBaseFactory<\ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00141\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_factory\_name,\ \_reordering\_base,\ \_parameters\_name\#\#\_type,\ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00142\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ IndexType>(std::move(exec))\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00143\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \{\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00144\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ explicit\ \_factory\_name(std::shared\_ptr<const\ ::gko::Executor>\ exec,\ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00145\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const\ \_parameters\_name\#\#\_type\&\ parameters)\ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00146\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ :\ ::gko::reorder::EnableDefaultReorderingBaseFactory<\ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00147\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_factory\_name,\ \_reordering\_base,\ \_parameters\_name\#\#\_type,\ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00148\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ IndexType>(std::move(exec),\ parameters)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00149\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \{\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00150\ \textcolor{preprocessor}{\ \ \ \ \};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00151\ \textcolor{preprocessor}{\ \ \ \ friend\ ::gko::reorder::EnableDefaultReorderingBaseFactory<\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00152\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_factory\_name,\ \_reordering\_base,\ \_parameters\_name\#\#\_type,\ IndexType>;\ \ \(\backslash\)}}
\DoxyCodeLine{00153\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00154\ \textcolor{preprocessor}{private:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00155\ \textcolor{preprocessor}{\ \ \ \ \_parameters\_name\#\#\_type\ \_parameters\_name\#\#\_;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00156\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00157\ \textcolor{preprocessor}{public:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00158\ \textcolor{preprocessor}{\ \ \ \ static\_assert(true,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00159\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "{}This\ assert\ is\ used\ to\ counter\ the\ false\ positive\ extra\ "{}\ \ \ \(\backslash\)}}
\DoxyCodeLine{00160\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "{}semi-\/colon\ warnings"{})}}
\DoxyCodeLine{00161\ }
\DoxyCodeLine{00162\ }
\DoxyCodeLine{00163\ \}\ \ \textcolor{comment}{//\ namespace\ reorder}}
\DoxyCodeLine{00164\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00165\ }
\DoxyCodeLine{00166\ }
\DoxyCodeLine{00167\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_REORDER\_REORDERING\_BASE\_HPP\_}}

\end{DoxyCode}
