\doxysection{ilu.\+hpp}
\hypertarget{factorization_2ilu_8hpp_source}{}\label{factorization_2ilu_8hpp_source}\index{ginkgo/core/factorization/ilu.hpp@{ginkgo/core/factorization/ilu.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\_FACTORIZATION\_ILU\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_FACTORIZATION\_ILU\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/composition.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/config.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/registry.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/factorization/incomplete\_factorization.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/csr.hpp>}}
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00026\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1factorization}{factorization}}\ \{}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00043\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ \doxymbox{\hyperlink{namespacegko_a89637c833af7ae805802226d97cebebf}{gko::default\_precision}},}
\DoxyCodeLine{00044\ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typename}\ IndexType\ =\ \doxymbox{\hyperlink{namespacegko_a16bd14c10900eb804d784908d8aab5ab}{gko::int32}}>}
\DoxyCodeLine{00045\ \textcolor{keyword}{class\ }Ilu\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}}<ValueType>\ \{}
\DoxyCodeLine{00046\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_AND\_INDEX\_TYPE;}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00049\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keyword}{using\ }matrix\_type\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{matrix::Csr<ValueType,\ IndexType>}};}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \ \ \ \ std::shared\_ptr<const\ matrix\_type>\ get\_l\_factor()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00054\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00055\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Can\ be\ \`{}static\_cast`\ since\ the\ type\ is\ guaranteed\ in\ this\ class}}
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::static\_pointer\_cast<const\ matrix\_type>(}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{classgko_1_1Composition_aec22562876d3f5346ae78c96a436d525}{get\_operators}}()[0]);}
\DoxyCodeLine{00058\ \ \ \ \ \}}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00060\ \ \ \ \ std::shared\_ptr<const\ matrix\_type>\ get\_u\_factor()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00061\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Can\ be\ \`{}static\_cast`\ since\ the\ type\ is\ guaranteed\ in\ this\ class}}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::static\_pointer\_cast<const\ matrix\_type>(}
\DoxyCodeLine{00064\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{classgko_1_1Composition_aec22562876d3f5346ae78c96a436d525}{get\_operators}}()[1]);}
\DoxyCodeLine{00065\ \ \ \ \ \}}
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{comment}{//\ Remove\ the\ possibility\ of\ calling\ \`{}create`,\ which\ was\ enabled\ by}}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{comment}{//\ \`{}Composition`}}
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}...\ Args>}
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Composition<ValueType>>\ create(Args\&\&...\ args)\ =}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \textcolor{keyword}{delete};}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ilu_1_1Factory}{Factory}})}
\DoxyCodeLine{00074\ \ \ \ \ \{}
\DoxyCodeLine{00079\ \ \ \ \ \ \ \ \ std::shared\_ptr<typename\ matrix\_type::strategy\_type>}
\DoxyCodeLine{00080\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_a78cb05198d399f30b435626048c23415}{l\_strategy}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ std::shared\_ptr<typename\ matrix\_type::strategy\_type>}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_ae39206eef0cd32835df5b636e1a60236}{u\_strategy}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_a12cbd76c5a9cce1814fd5c2dc918323f}{skip\_sorting}},\ \textcolor{keyword}{false});}
\DoxyCodeLine{00100\ }
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1factorization_a42430a5d93539c24303273804684ef67}{incomplete\_algorithm}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_accc8821162d5eab103579d606ca8ff32}{algorithm}},\ incomplete\_algorithm::sparselib);}
\DoxyCodeLine{00110\ \ \ \ \ \};}
\DoxyCodeLine{00111\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(Ilu,\ parameters,\ Factory);}
\DoxyCodeLine{00112\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00113\ }
\DoxyCodeLine{00127\ \ \ \ \ \textcolor{keyword}{static}\ \doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type}{parameters\_type}}\ \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ilu_aeea753f77225312a42c2f27660b4470d}{parse}}(}
\DoxyCodeLine{00128\ \ \ \ \ \ \ \ \ \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{00129\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::type\_descriptor}}\&\ td\_for\_child\ =}
\DoxyCodeLine{00130\ \ \ \ \ \ \ \ \ \ \ \ \ config::make\_type\_descriptor<ValueType,\ IndexType>());}
\DoxyCodeLine{00131\ }
\DoxyCodeLine{00132\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00133\ \ \ \ \ Ilu(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ilu_1_1Factory}{Factory}}*\ factory,\ std::shared\_ptr<const\ gko::LinOp>\ system\_matrix)}
\DoxyCodeLine{00134\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}}<ValueType>\{factory-\/>get\_executor()\},}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00136\ \ \ \ \ \{}
\DoxyCodeLine{00137\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_a78cb05198d399f30b435626048c23415}{l\_strategy}}\ ==\ \textcolor{keyword}{nullptr})\ \{}
\DoxyCodeLine{00138\ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_a78cb05198d399f30b435626048c23415}{l\_strategy}}\ =}
\DoxyCodeLine{00139\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<typename\ matrix\_type::classical>();}
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00141\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_ae39206eef0cd32835df5b636e1a60236}{u\_strategy}}\ ==\ \textcolor{keyword}{nullptr})\ \{}
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ilu_1_1parameters__type_ae39206eef0cd32835df5b636e1a60236}{u\_strategy}}\ =}
\DoxyCodeLine{00143\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<typename\ matrix\_type::classical>();}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \ \ generate\_l\_u(system\_matrix,\ parameters\_.skip\_sorting)-\/>move\_to(\textcolor{keyword}{this});}
\DoxyCodeLine{00146\ \ \ \ \ \}}
\DoxyCodeLine{00147\ }
\DoxyCodeLine{00163\ \ \ \ \ std::unique\_ptr<Composition<ValueType>>\ generate\_l\_u(}
\DoxyCodeLine{00164\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::shared\_ptr<const\ LinOp>\&\ system\_matrix,}
\DoxyCodeLine{00165\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ skip\_sorting)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00166\ \};}
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00168\ }
\DoxyCodeLine{00169\ \}\ \ \textcolor{comment}{//\ namespace\ factorization}}
\DoxyCodeLine{00170\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00171\ }
\DoxyCodeLine{00172\ }
\DoxyCodeLine{00173\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_FACTORIZATION\_ILU\_HPP\_}}

\end{DoxyCode}
