\chapter{The preconditioner-\/export program }
\hypertarget{preconditioner_export}{}\label{preconditioner_export}\index{The preconditioner-\/export program@{The preconditioner-\/export program}}
The preconditioner export example.

This example depends on simple-\/solver.

 \label{three_pt_stencil_solver_Intro}%
\Hypertarget{three_pt_stencil_solver_Intro}%
 \label{three_pt_stencil_solver_Introduction}%
\Hypertarget{three_pt_stencil_solver_Introduction}%
\doxysection*{Introduction}

\label{three_pt_stencil_solver_Abouttheexample}%
\Hypertarget{three_pt_stencil_solver_Abouttheexample}%
\doxysubsubsection*{About the example }

This example shows how to explicitly generate and store preconditioners for a given matrix. It can also be used to inspect and debug the preconditioner generation. \label{three_pt_stencil_solver_CommProg}%
\Hypertarget{three_pt_stencil_solver_CommProg}%
 \doxysection*{The commented program}


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{void}\ output(\doxymbox{\hyperlink{classgko_1_1ptr__param}{gko::ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1WritableToMatrixData}{gko::WritableToMatrixData<double,\ int>}}>\ mtx,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ std::string\ name)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ std::ofstream\ stream\{name\};}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Writing\ "{}}\ <<\ name\ <<\ std::endl;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{namespacegko_af82d8f7795fefcf5f38a38895e316c02}{gko::write}}(stream,\ mtx,\ \doxymbox{\hyperlink{namespacegko_ae749a5ea11a93c1bcc9158d9a6e9fb68af5d7aa3ba4929cc12dc51a92c59fabd3}{gko::layout\_type::coordinate}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Function>}
\DoxyCodeLine{\textcolor{keyword}{auto}\ try\_generate(Function\ fun)\ -\/>\ \textcolor{keyword}{decltype}(fun())}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{decltype}(fun())\ result;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{try}\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ result\ =\ fun();}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{catch}\ (\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1Error}{gko::Error}}\&\ err)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Error:\ "{}}\ <<\ err.\doxymbox{\hyperlink{classgko_1_1Error_aec78ba67d5d7bf123d20afbe086977d0}{what}}()\ <<\ \textcolor{charliteral}{'\(\backslash\)n'};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::exit(-\/1);}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ main(\textcolor{keywordtype}{int}\ argc,\ \textcolor{keywordtype}{char}*\ argv[])}
\DoxyCodeLine{\{}

\end{DoxyCode}


print usage message


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (argc\ <\ 2\ ||\ executors.find(argv[1])\ ==\ executors.end())\ \{}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Usage:\ executable"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ <<\ \textcolor{stringliteral}{"{}\ <reference|omp|cuda|hip|dpcpp>\ [<matrix-\/file>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<jacobi|ilu|parilu|parilut|ilu-\/isai|parilu-\/isai|parilut-\/"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}isai]\ [<preconditioner\ args>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Jacobi\ parameters:\ [<max-\/block-\/size>]\ [<accuracy>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<storage-\/optimization:auto|0|1|2>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ParILU\ parameters:\ [<iteration-\/count>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ std::cerr}
\DoxyCodeLine{\ \ \ \ \ \ \ \ <<\ \textcolor{stringliteral}{"{}ParILUT\ parameters:\ [<iteration-\/count>]\ [<fill-\/in-\/limit>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ILU-\/ISAI\ parameters:\ [<sparsity-\/power>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ParILU-\/ISAI\ parameters:\ [<iteration-\/count>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<sparsity-\/power>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ParILUT-\/ISAI\ parameters:\ [<iteration-\/count>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<fill-\/in-\/limit>]\ [<sparsity-\/power>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{\}}

\end{DoxyCode}


generate executor based on first argument


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{auto}\ exec\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ executors.at(argv[1])();\ \});}

\end{DoxyCode}


set matrix and preconditioner name with default values


\begin{DoxyCode}{0}
\DoxyCodeLine{std::string\ matrix\ =\ argc\ <\ 3\ ?\ \textcolor{stringliteral}{"{}data/A.mtx"{}}\ :\ argv[2];}
\DoxyCodeLine{std::string\ precond\ =\ argc\ <\ 4\ ?\ \textcolor{stringliteral}{"{}jacobi"{}}\ :\ argv[3];}

\end{DoxyCode}


load matrix file into Csr format


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{auto}\ mtx\ =\ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(try\_generate([\&]\ \{}
\DoxyCodeLine{\ \ \ \ std::ifstream\ mtx\_stream\{matrix\};}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (!mtx\_stream)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ GKO\_STREAM\_ERROR(\textcolor{stringliteral}{"{}Unable\ to\ open\ matrix\ file"{}});}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Reading\ "{}}\ <<\ matrix\ <<\ std::endl;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_abc58509ecdcb48399e12f9a081ed7545}{gko::read<gko::matrix::Csr<>}}>(mtx\_stream,\ exec);}
\DoxyCodeLine{\}));}

\end{DoxyCode}


concatenate remaining arguments for filename


\begin{DoxyCode}{0}
\DoxyCodeLine{std::string\ output\_suffix;}
\DoxyCodeLine{\textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 4;\ i\ <\ argc;\ ++i)\ \{}
\DoxyCodeLine{\ \ \ \ output\_suffix\ =\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/"{}}\ +\ argv[i];}
\DoxyCodeLine{\}}

\end{DoxyCode}


handle different preconditioners


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}jacobi"{}})\ \{}

\end{DoxyCode}


jacobi:\+ max\+\_\+block\+\_\+size, accuracy, storage\+\_\+optimization


\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ factory\_parameter\ =\ gko::preconditioner::Jacobi<>::build();}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ factory\_parameter.with\_max\_block\_size(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a7cf056fa904140b50658e0637fba428c}{gko::uint32}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ factory\_parameter.with\_accuracy(std::stod(argv[5]));}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 7)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ factory\_parameter.with\_storage\_optimization(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ std::string\{argv[6]\}\ ==\ \textcolor{stringliteral}{"{}auto"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ?\ \doxymbox{\hyperlink{classgko_1_1precision__reduction_ac4109c61fadb24db7a1888c51ac483e9}{gko::precision\_reduction::autodetect}}()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{namespacegko}{gko}}::precision\_reduction(0,\ \doxymbox{\hyperlink{namespacestd}{std}}::stoi(argv[6])));}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =\ factory\_parameter.on(exec);}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ jacobi\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ output(jacobi,\ matrix\ +\ \textcolor{stringliteral}{"{}.jacobi"{}}\ +\ output\_suffix);}
\DoxyCodeLine{\}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}ilu"{}})\ \{}

\end{DoxyCode}


ilu:\+ no parameters


\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ ilu\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as<gko::Composition<>}}>(try\_generate([\&]\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ gko::factorization::Ilu<>::build().on(exec)-\/>generate(mtx);}
\DoxyCodeLine{\ \ \ \ \}));}
\DoxyCodeLine{\ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[0]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/l"{}});}
\DoxyCodeLine{\ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[1]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/u"{}});}
\DoxyCodeLine{\}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilu"{}})\ \{}

\end{DoxyCode}


parilu:\+ iterations


\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ factory\_parameter\ =\ gko::factorization::ParIlu<>::build();}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ factory\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =\ factory\_parameter.on(exec);}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ ilu\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as<gko::Composition<>}}>(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \}));}
\DoxyCodeLine{\ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[0]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[1]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilut"{}})\ \{}

\end{DoxyCode}


parilut:\+ iterations, fill-\/in limit


\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ factory\_parameter\ =\ gko::factorization::ParIlut<>::build();}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ factory\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ factory\_parameter.with\_fill\_in\_limit(std::stod(argv[5]));}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =\ factory\_parameter.on(exec);}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ ilut\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as<gko::Composition<>}}>(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \}));}
\DoxyCodeLine{\ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilut-\/>get\_operators()[0]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilut-\/>get\_operators()[1]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}ilu-\/isai"{}})\ \{}

\end{DoxyCode}


ilu-\/isai:\+ sparsity power


\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ fact\_factory\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(gko::factorization::Ilu<>::build().on(exec));}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ sparsity\_power\ =\ 1;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ sparsity\_power\ =\ std::stoi(argv[4]);}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ilu}{gko::preconditioner::Ilu<gko::preconditioner::LowerIsai<>}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::preconditioner::UpperIsai<>>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .with\_factorization(fact\_factory)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .with\_l\_solver(gko::preconditioner::LowerIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .with\_u\_solver(gko::preconditioner::UpperIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ ilu\_isai\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ output(ilu\_isai-\/>get\_l\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ output(ilu\_isai-\/>get\_u\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilu-\/isai"{}})\ \{}

\end{DoxyCode}


parilu-\/isai:\+ iterations, sparsity power


\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ fact\_parameter\ =\ gko::factorization::ParIlu<>::build();}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ sparsity\_power\ =\ 1;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fact\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ sparsity\_power\ =\ std::stoi(argv[5]);}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ fact\_factory\ =\ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(fact\_parameter.on(exec));}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ilu}{gko::preconditioner::Ilu<gko::preconditioner::LowerIsai<>}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::preconditioner::UpperIsai<>>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .with\_factorization(fact\_factory)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .with\_l\_solver(gko::preconditioner::LowerIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .with\_u\_solver(gko::preconditioner::UpperIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ ilu\_isai\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ output(ilu\_isai-\/>get\_l\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ output(ilu\_isai-\/>get\_u\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilut-\/isai"{}})\ \{}

\end{DoxyCode}


parilut-\/isai:\+ iterations, fill-\/in limit, sparsity power


\begin{DoxyCode}{0}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\_parameter\ =\ gko::factorization::ParIlut<>::build();}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ sparsity\_power\ =\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ fact\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ fact\_parameter.with\_fill\_in\_limit(std::stod(argv[5]));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 7)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ sparsity\_power\ =\ std::stoi(argv[6]);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\_factory\ =\ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(fact\_parameter.on(exec));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ilu}{gko::preconditioner::Ilu<gko::preconditioner::LowerIsai<>}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::preconditioner::UpperIsai<>>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_factorization(fact\_factory)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_l\_solver(gko::preconditioner::LowerIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_u\_solver(gko::preconditioner::UpperIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ ilu\_isai\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_l\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_u\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\}}

\end{DoxyCode}
 \label{three_pt_stencil_solver_Results}%
\Hypertarget{three_pt_stencil_solver_Results}%
\doxysection*{Results}

This is the expected output:\+


\begin{DoxyCode}{0}
\DoxyCodeLine{Usage:\ ./preconditioner-\/export\ <reference|omp|cuda|hip|dpcpp>\ [<matrix-\/file>]\ [<jacobi|ilu|parilu|parilut|ilu-\/isai|parilu-\/isai|parilut-\/isai]\ [<preconditioner\ args>]}
\DoxyCodeLine{Jacobi\ parameters:\ [<\doxymbox{\hyperlink{namespacegko_af1812df45c6ec07780d579a12b64c753}{max}}-\/block-\/size>]\ [<accuracy>]\ [<storage-\/optimization:\textcolor{keyword}{auto}|0|1|2>]}
\DoxyCodeLine{ParILU\ parameters:\ [<iteration-\/count>]}
\DoxyCodeLine{ParILUT\ parameters:\ [<iteration-\/count>]\ [<fill-\/in-\/limit>]}
\DoxyCodeLine{ILU-\/ISAI\ parameters:\ [<sparsity-\/power>]}
\DoxyCodeLine{ParILU-\/ISAI\ parameters:\ [<iteration-\/count>]\ [<sparsity-\/power>]}
\DoxyCodeLine{ParILUT-\/ISAI\ parameters:\ [<iteration-\/count>]\ [<fill-\/in-\/limit>]\ [<sparsity-\/power>]}

\end{DoxyCode}


When specifying an executor:\+


\begin{DoxyCode}{0}
\DoxyCodeLine{Reading\ data/A.mtx}
\DoxyCodeLine{Writing\ data/A.mtx.jacobi}

\end{DoxyCode}


\label{three_pt_stencil_solver_Commentsaboutprogramminganddebugging}%
\Hypertarget{three_pt_stencil_solver_Commentsaboutprogramminganddebugging}%
\doxysubsubsection*{Comments about programming and debugging }

\label{three_pt_stencil_solver_PlainProg}%
\Hypertarget{three_pt_stencil_solver_PlainProg}%
 \doxysection*{The plain program}


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <fstream>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <functional>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <iostream>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <map>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <ginkgo/ginkgo.hpp>}}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{const}\ std::map<std::string,\ std::function<std::shared\_ptr<gko::Executor>()>>}
\DoxyCodeLine{\ \ \ \ executors\{\{\textcolor{stringliteral}{"{}reference"{}},\ []\ \{\ \textcolor{keywordflow}{return}\ gko::ReferenceExecutor::create();\ \}\},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\textcolor{stringliteral}{"{}omp"{}},\ []\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1OmpExecutor_af977cb680e0427ca4eb71eb7b1266211}{gko::OmpExecutor::create}}();\ \}\},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\textcolor{stringliteral}{"{}cuda"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ []\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1CudaExecutor_a075a1957241de65c0cad59f9534430a2}{gko::CudaExecutor::create}}(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0,\ gko::ReferenceExecutor::create());}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\textcolor{stringliteral}{"{}hip"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ []\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1HipExecutor_a8afc5210bf8dd8aedfceab4b73f0047b}{gko::HipExecutor::create}}(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0,\ gko::ReferenceExecutor::create());}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\textcolor{stringliteral}{"{}dpcpp"{}},\ []\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1DpcppExecutor_af69a356ee07f641010df5d2e9e518bb0}{gko::DpcppExecutor::create}}(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0,\ gko::ReferenceExecutor::create());}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\}\};}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void}\ output(\doxymbox{\hyperlink{classgko_1_1ptr__param}{gko::ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1WritableToMatrixData}{gko::WritableToMatrixData<double,\ int>}}>\ mtx,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ std::string\ name)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ std::ofstream\ stream\{name\};}
\DoxyCodeLine{\ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Writing\ "{}}\ <<\ name\ <<\ std::endl;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{namespacegko_af82d8f7795fefcf5f38a38895e316c02}{gko::write}}(stream,\ mtx,\ \doxymbox{\hyperlink{namespacegko_ae749a5ea11a93c1bcc9158d9a6e9fb68af5d7aa3ba4929cc12dc51a92c59fabd3}{gko::layout\_type::coordinate}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Function>}
\DoxyCodeLine{\textcolor{keyword}{auto}\ try\_generate(Function\ fun)\ -\/>\ \textcolor{keyword}{decltype}(fun())}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{decltype}(fun())\ result;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{try}\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ result\ =\ fun();}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{catch}\ (\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1Error}{gko::Error}}\&\ err)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Error:\ "{}}\ <<\ err.\doxymbox{\hyperlink{classgko_1_1Error_aec78ba67d5d7bf123d20afbe086977d0}{what}}()\ <<\ \textcolor{charliteral}{'\(\backslash\)n'};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::exit(-\/1);}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ main(\textcolor{keywordtype}{int}\ argc,\ \textcolor{keywordtype}{char}*\ argv[])}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (argc\ <\ 2\ ||\ executors.find(argv[1])\ ==\ executors.end())\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Usage:\ executable"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <<\ \textcolor{stringliteral}{"{}\ <reference|omp|cuda|hip|dpcpp>\ [<matrix-\/file>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<jacobi|ilu|parilu|parilut|ilu-\/isai|parilu-\/isai|parilut-\/"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}isai]\ [<preconditioner\ args>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Jacobi\ parameters:\ [<max-\/block-\/size>]\ [<accuracy>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<storage-\/optimization:auto|0|1|2>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ParILU\ parameters:\ [<iteration-\/count>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ <<\ \textcolor{stringliteral}{"{}ParILUT\ parameters:\ [<iteration-\/count>]\ [<fill-\/in-\/limit>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ILU-\/ISAI\ parameters:\ [<sparsity-\/power>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ParILU-\/ISAI\ parameters:\ [<iteration-\/count>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<sparsity-\/power>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}ParILUT-\/ISAI\ parameters:\ [<iteration-\/count>]\ "{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}[<fill-\/in-\/limit>]\ [<sparsity-\/power>]\(\backslash\)n"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ executors.at(argv[1])();\ \});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ std::string\ matrix\ =\ argc\ <\ 3\ ?\ \textcolor{stringliteral}{"{}data/A.mtx"{}}\ :\ argv[2];}
\DoxyCodeLine{\ \ \ \ std::string\ precond\ =\ argc\ <\ 4\ ?\ \textcolor{stringliteral}{"{}jacobi"{}}\ :\ argv[3];}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ mtx\ =\ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(try\_generate([\&]\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::ifstream\ mtx\_stream\{matrix\};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!mtx\_stream)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ GKO\_STREAM\_ERROR(\textcolor{stringliteral}{"{}Unable\ to\ open\ matrix\ file"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Reading\ "{}}\ <<\ matrix\ <<\ std::endl;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_abc58509ecdcb48399e12f9a081ed7545}{gko::read<gko::matrix::Csr<>}}>(mtx\_stream,\ exec);}
\DoxyCodeLine{\ \ \ \ \}));}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ std::string\ output\_suffix;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 4;\ i\ <\ argc;\ ++i)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output\_suffix\ =\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/"{}}\ +\ argv[i];}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}jacobi"{}})\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ factory\_parameter\ =\ gko::preconditioner::Jacobi<>::build();}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ factory\_parameter.with\_max\_block\_size(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a7cf056fa904140b50658e0637fba428c}{gko::uint32}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ factory\_parameter.with\_accuracy(std::stod(argv[5]));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 7)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ factory\_parameter.with\_storage\_optimization(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::string\{argv[6]\}\ ==\ \textcolor{stringliteral}{"{}auto"{}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ?\ \doxymbox{\hyperlink{classgko_1_1precision__reduction_ac4109c61fadb24db7a1888c51ac483e9}{gko::precision\_reduction::autodetect}}()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{namespacegko}{gko}}::precision\_reduction(0,\ \doxymbox{\hyperlink{namespacestd}{std}}::stoi(argv[6])));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =\ factory\_parameter.on(exec);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ jacobi\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(jacobi,\ matrix\ +\ \textcolor{stringliteral}{"{}.jacobi"{}}\ +\ output\_suffix);}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}ilu"{}})\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ ilu\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as<gko::Composition<>}}>(try\_generate([\&]\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ gko::factorization::Ilu<>::build().on(exec)-\/>generate(mtx);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[0]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/l"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[1]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/u"{}});}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilu"{}})\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ factory\_parameter\ =\ gko::factorization::ParIlu<>::build();}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ factory\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =\ factory\_parameter.on(exec);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ ilu\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as<gko::Composition<>}}>(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \}));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[0]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilu-\/>get\_operators()[1]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilut"{}})\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ factory\_parameter\ =\ gko::factorization::ParIlut<>::build();}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ factory\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ factory\_parameter.with\_fill\_in\_limit(std::stod(argv[5]));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =\ factory\_parameter.on(exec);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ ilut\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as<gko::Composition<>}}>(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \}));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilut-\/>get\_operators()[0]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as}}<\doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::matrix::Csr<>}}>(ilut-\/>get\_operators()[1]),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}ilu-\/isai"{}})\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\_factory\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(gko::factorization::Ilu<>::build().on(exec));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ sparsity\_power\ =\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ sparsity\_power\ =\ std::stoi(argv[4]);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ilu}{gko::preconditioner::Ilu<gko::preconditioner::LowerIsai<>}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::preconditioner::UpperIsai<>>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_factorization(fact\_factory)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_l\_solver(gko::preconditioner::LowerIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_u\_solver(gko::preconditioner::UpperIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ ilu\_isai\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_l\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_u\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.ilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilu-\/isai"{}})\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\_parameter\ =\ gko::factorization::ParIlu<>::build();}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ sparsity\_power\ =\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ fact\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ sparsity\_power\ =\ std::stoi(argv[5]);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\_factory\ =\ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(fact\_parameter.on(exec));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ilu}{gko::preconditioner::Ilu<gko::preconditioner::LowerIsai<>}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::preconditioner::UpperIsai<>>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_factorization(fact\_factory)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_l\_solver(gko::preconditioner::LowerIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_u\_solver(gko::preconditioner::UpperIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ ilu\_isai\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_l\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_u\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilu-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (precond\ ==\ \textcolor{stringliteral}{"{}parilut-\/isai"{}})\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\_parameter\ =\ gko::factorization::ParIlut<>::build();}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ sparsity\_power\ =\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 5)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ fact\_parameter.with\_iterations(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\textcolor{keyword}{>}(std::stoi(argv[4])));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 6)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ fact\_parameter.with\_fill\_in\_limit(std::stod(argv[5]));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (argc\ >=\ 7)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ sparsity\_power\ =\ std::stoi(argv[6]);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\_factory\ =\ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{gko::share}}(fact\_parameter.on(exec));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}\ =}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ilu}{gko::preconditioner::Ilu<gko::preconditioner::LowerIsai<>}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::preconditioner::UpperIsai<>>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_factorization(fact\_factory)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_l\_solver(gko::preconditioner::LowerIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_u\_solver(gko::preconditioner::UpperIsai<>::build()}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_sparsity\_power(sparsity\_power))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ ilu\_isai\ =\ try\_generate([\&]\ \{\ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>generate(mtx);\ \});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_l\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/l"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ output(ilu\_isai-\/>get\_u\_solver()-\/>get\_approximate\_inverse(),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ matrix\ +\ \textcolor{stringliteral}{"{}.parilut-\/isai"{}}\ +\ output\_suffix\ +\ \textcolor{stringliteral}{"{}-\/u"{}});}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 