\doxysection{ic.\+hpp}
\hypertarget{factorization_2ic_8hpp_source}{}\label{factorization_2ic_8hpp_source}\index{ginkgo/core/factorization/ic.hpp@{ginkgo/core/factorization/ic.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\_IC\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_FACTORIZATION\_IC\_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\ }Ic\ :\ \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\_lt\_factor()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00061\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (this-\/>\doxymbox{\hyperlink{classgko_1_1Composition_aec22562876d3f5346ae78c96a436d525}{get\_operators}}().size()\ ==\ 2)\ \{}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Can\ be\ \`{}static\_cast`\ since\ the\ type\ is\ guaranteed\ in\ this\ class}}
\DoxyCodeLine{00064\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::static\_pointer\_cast<const\ matrix\_type>(}
\DoxyCodeLine{00065\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{classgko_1_1Composition_aec22562876d3f5346ae78c96a436d525}{get\_operators}}()[1]);}
\DoxyCodeLine{00066\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00067\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::static\_pointer\_cast<const\ matrix\_type>(}
\DoxyCodeLine{00068\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{share}}(get\_l\_factor()-\/>\doxymbox{\hyperlink{classgko_1_1Composition_ae9d4e8a318c21b265cdcd7ed33175e52}{conj\_transpose}}()));}
\DoxyCodeLine{00069\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00070\ \ \ \ \ \}}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{comment}{//\ Remove\ the\ possibility\ of\ calling\ \`{}create`,\ which\ was\ enabled\ by}}
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{comment}{//\ \`{}Composition`}}
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}...\ Args>}
\DoxyCodeLine{00075\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Composition<ValueType>>\ create(Args\&\&...\ args)\ =}
\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ \textcolor{keyword}{delete};}
\DoxyCodeLine{00077\ }
\DoxyCodeLine{00078\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\_CREATE\_FACTORY\_PARAMETERS}}(parameters,\ \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ic_1_1Factory}{Factory}})}
\DoxyCodeLine{00079\ \ \ \ \ \{}
\DoxyCodeLine{00084\ \ \ \ \ \ \ \ \ std::shared\_ptr<typename\ matrix\_type::strategy\_type>}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_a960c3ea111af566f3d565175e67adf6b}{l\_strategy}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_aa42db756a50ec8afafd7a7fd49561832}{skip\_sorting}},\ \textcolor{keyword}{false});}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_afb4c7814334072ab39c2e2b04925cdc4}{both\_factors}},\ \textcolor{keyword}{true});}
\DoxyCodeLine{00105\ }
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1factorization_a42430a5d93539c24303273804684ef67}{incomplete\_algorithm}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_a9c5dca5a13bdd9e8d4a72650ba27b931}{algorithm}},\ incomplete\_algorithm::sparselib);}
\DoxyCodeLine{00115\ \ \ \ \ \};}
\DoxyCodeLine{00116\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(Ic,\ parameters,\ Factory);}
\DoxyCodeLine{00117\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00132\ \ \ \ \ \textcolor{keyword}{static}\ \doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type}{parameters\_type}}\ \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ic_ae7272844c62b46a9571a1650ad8c72cc}{parse}}(}
\DoxyCodeLine{00133\ \ \ \ \ \ \ \ \ \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{00134\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::type\_descriptor}}\&\ td\_for\_child\ =}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ \ \ \ \ config::make\_type\_descriptor<ValueType,\ IndexType>());}
\DoxyCodeLine{00136\ }
\DoxyCodeLine{00137\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00138\ \ \ \ \ Ic(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ic_1_1Factory}{Factory}}*\ factory,\ std::shared\_ptr<const\ gko::LinOp>\ system\_matrix)}
\DoxyCodeLine{00139\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}}<ValueType>\{factory-\/>get\_executor()\},}
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00141\ \ \ \ \ \{}
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_a960c3ea111af566f3d565175e67adf6b}{l\_strategy}}\ ==\ \textcolor{keyword}{nullptr})\ \{}
\DoxyCodeLine{00143\ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_a960c3ea111af566f3d565175e67adf6b}{l\_strategy}}\ =}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<typename\ matrix\_type::classical>();}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00146\ \ \ \ \ \ \ \ \ generate(system\_matrix,\ parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_aa42db756a50ec8afafd7a7fd49561832}{skip\_sorting}},}
\DoxyCodeLine{00147\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_.\doxymbox{\hyperlink{structgko_1_1factorization_1_1Ic_1_1parameters__type_afb4c7814334072ab39c2e2b04925cdc4}{both\_factors}})}
\DoxyCodeLine{00148\ \ \ \ \ \ \ \ \ \ \ \ \ -\/>move\_to(\textcolor{keyword}{this});}
\DoxyCodeLine{00149\ \ \ \ \ \}}
\DoxyCodeLine{00150\ }
\DoxyCodeLine{00151\ \ \ \ \ std::unique\_ptr<Composition<ValueType>>\ generate(}
\DoxyCodeLine{00152\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::shared\_ptr<const\ LinOp>\&\ system\_matrix,\ \textcolor{keywordtype}{bool}\ skip\_sorting,}
\DoxyCodeLine{00153\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ both\_factors)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00154\ \};}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00157\ \}\ \ \textcolor{comment}{//\ namespace\ factorization}}
\DoxyCodeLine{00158\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00159\ }
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00161\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_FACTORIZATION\_IC\_HPP\_}}

\end{DoxyCode}
