\doxysection{ic.\+hpp}
\hypertarget{preconditioner_2ic_8hpp_source}{}\label{preconditioner_2ic_8hpp_source}\index{ginkgo/core/preconditioner/ic.hpp@{ginkgo/core/preconditioner/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\_PRECONDITIONER\_IC\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_PRECONDITIONER\_IC\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <type\_traits>}}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/abstract\_factory.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/composition.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/exception.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/exception\_helpers.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/precision\_dispatch.hpp>}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/type\_traits.hpp>}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/config.hpp>}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/registry.hpp>}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#include\ <ginkgo/core/factorization/par\_ic.hpp>}}
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/dense.hpp>}}
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#include\ <ginkgo/core/solver/solver\_traits.hpp>}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ <ginkgo/core/solver/triangular.hpp>}}
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/combined.hpp>}}
\DoxyCodeLine{00026\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/iteration.hpp>}}
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/residual\_norm.hpp>}}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00031\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1preconditioner}{preconditioner}}\ \{}
\DoxyCodeLine{00032\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00033\ }
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00035\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Type>}
\DoxyCodeLine{00036\ \textcolor{keyword}{constexpr}\ \textcolor{keywordtype}{bool}\ support\_ic\_parse\ =}
\DoxyCodeLine{00037\ \ \ \ \ std::is\_same\_v<typename\ Type::l\_solver\_type,\ LinOp>;}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00040\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Ic,\ std::enable\_if\_t<!support\_ic\_parse<Ic>>*\ =\ \textcolor{keywordtype}{nullptr}>}
\DoxyCodeLine{00041\ \textcolor{keyword}{typename}\ Ic::parameters\_type\ ic\_parse(}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keyword}{const}\ config::pnode\&\ config,\ \textcolor{keyword}{const}\ config::registry\&\ context,}
\DoxyCodeLine{00043\ \ \ \ \ \textcolor{keyword}{const}\ config::type\_descriptor\&\ td\_for\_child)}
\DoxyCodeLine{00044\ \{}
\DoxyCodeLine{00045\ \ \ \ \ GKO\_INVALID\_STATE(}
\DoxyCodeLine{00046\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}preconditioner::Ic\ only\ supports\ limited\ type\ for\ parse."{}});}
\DoxyCodeLine{00047\ \}}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Ic,\ std::enable\_if\_t<support\_ic\_parse<Ic>>*\ =\ \textcolor{keywordtype}{nullptr}>}
\DoxyCodeLine{00050\ \textcolor{keyword}{typename}\ Ic::parameters\_type\ ic\_parse(}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keyword}{const}\ config::pnode\&\ config,\ \textcolor{keyword}{const}\ config::registry\&\ context,}
\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keyword}{const}\ config::type\_descriptor\&\ td\_for\_child);}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00057\ }
\DoxyCodeLine{00107\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ LSolverTypeOrValueType\ =\ solver::LowerTrs<>,}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typename}\ IndexType\ =\ \textcolor{keywordtype}{int}32>}
\DoxyCodeLine{00109\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<Ic<LSolverTypeOrValueType,\ IndexType>>,}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1Transposable}{Transposable}}\ \{}
\DoxyCodeLine{00111\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}>;}
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}},\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}>;}
\DoxyCodeLine{00113\ }
\DoxyCodeLine{00114\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00115\ \ \ \ \ \textcolor{keyword}{using\ }l\_solver\_type\ =}
\DoxyCodeLine{00116\ \ \ \ \ \ \ \ \ std::conditional\_t<gko::detail::is\_ginkgo\_linop<LSolverTypeOrValueType>,}
\DoxyCodeLine{00117\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LSolverTypeOrValueType,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}>;}
\DoxyCodeLine{00118\ \ \ \ \ \textcolor{keyword}{static\_assert}(std::is\_same<gko::detail::transposed\_type<}
\DoxyCodeLine{00119\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::detail::transposed\_type<l\_solver\_type>>,}
\DoxyCodeLine{00120\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_type>::value,}
\DoxyCodeLine{00121\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}l\_solver\_type::transposed\_type\ must\ be\ symmetric"{}});}
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ gko::detail::get\_value\_type<LSolverTypeOrValueType>;}
\DoxyCodeLine{00123\ \ \ \ \ \textcolor{keyword}{using\ }lh\_solver\_type\ =\ gko::detail::transposed\_type<l\_solver\_type>;}
\DoxyCodeLine{00124\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00125\ \ \ \ \ \textcolor{keyword}{using\ }transposed\_type\ =\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic<LSolverTypeOrValueType,\ IndexType>}};}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00127\ \ \ \ \ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_1_1Factory}{Factory}};}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00129\ \ \ \ \ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type}{parameters\_type}}}
\DoxyCodeLine{00130\ \ \ \ \ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1enable__parameters__type}{enable\_parameters\_type}}<parameters\_type,\ Factory>\ \{}
\DoxyCodeLine{00134\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ gko::detail::factory\_type<l\_solver\_type>>}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type_aa53b1237a4c57a104724a358f1f65527}{l\_solver\_factory}}\{\};}
\DoxyCodeLine{00136\ }
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOpFactory>\ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type_a9e5a198e4eac6721faa4b84c4b7f1db1}{factorization\_factory}}\{\};}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ GKO\_DEPRECATED(\textcolor{stringliteral}{"{}use\ with\_l\_solver\ instead"{}})}
\DoxyCodeLine{00143\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type}{parameters\_type}}\&\ with\_l\_solver\_factory(}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1deferred__factory__parameter}{deferred\_factory\_parameter}}<}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const\ \doxymbox{\hyperlink{namespacegko}{gko}}::detail::factory\_type<l\_solver\_type>>}
\DoxyCodeLine{00146\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver}{solver}})}
\DoxyCodeLine{00147\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00148\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type_a27fb2f5820de064959fbf2eefe201549}{with\_l\_solver}}(std::move(\doxymbox{\hyperlink{namespacegko_1_1solver}{solver}}));}
\DoxyCodeLine{00149\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00150\ }
\DoxyCodeLine{00156\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type}{parameters\_type}}\&\ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type_a27fb2f5820de064959fbf2eefe201549}{with\_l\_solver}}(}
\DoxyCodeLine{00157\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1deferred__factory__parameter}{deferred\_factory\_parameter}}<}
\DoxyCodeLine{00158\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ gko::detail::factory\_type<l\_solver\_type>>}
\DoxyCodeLine{00159\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver}{solver}})}
\DoxyCodeLine{00160\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00161\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>l\_solver\_generator\ =\ std::move(\doxymbox{\hyperlink{namespacegko_1_1solver}{solver}});}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>deferred\_factories[\textcolor{stringliteral}{"{}l\_solver"{}}]\ =\ [](\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ exec,}
\DoxyCodeLine{00163\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\&\ params)\ \{}
\DoxyCodeLine{00164\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!params.l\_solver\_generator.is\_empty())\ \{}
\DoxyCodeLine{00165\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ params.l\_solver\_factory\ =}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ params.l\_solver\_generator.on(exec);}
\DoxyCodeLine{00167\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00168\ \ \ \ \ \ \ \ \ \ \ \ \ \};}
\DoxyCodeLine{00169\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00170\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00171\ }
\DoxyCodeLine{00172\ \ \ \ \ \ \ \ \ GKO\_DEPRECATED(\textcolor{stringliteral}{"{}use\ with\_factorization\ instead"{}})}
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Ic_1_1parameters__type}{parameters\_type}}\&\ with\_factorization\_factory(}
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1deferred__factory__parameter}{deferred\_factory\_parameter}}<const\ \doxymbox{\hyperlink{classgko_1_1LinOpFactory}{LinOpFactory}}>\ \doxymbox{\hyperlink{namespacegko_1_1factorization}{factorization}})}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ with\_factorization(std::move(\doxymbox{\hyperlink{namespacegko_1_1factorization}{factorization}}));}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ parameters\_type\&\ with\_factorization(}
\DoxyCodeLine{00180\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1deferred__factory__parameter}{deferred\_factory\_parameter<const\ LinOpFactory>}}\ \doxymbox{\hyperlink{namespacegko_1_1factorization}{factorization}})}
\DoxyCodeLine{00181\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00182\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>factorization\_generator\ =\ std::move(\doxymbox{\hyperlink{namespacegko_1_1factorization}{factorization}});}
\DoxyCodeLine{00183\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>deferred\_factories[\textcolor{stringliteral}{"{}factorization"{}}]\ =\ [](\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ exec,}
\DoxyCodeLine{00184\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\&\ params)\ \{}
\DoxyCodeLine{00185\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!params.factorization\_generator.is\_empty())\ \{}
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ params.factorization\_factory\ =}
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ params.factorization\_generator.on(exec);}
\DoxyCodeLine{00188\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00189\ \ \ \ \ \ \ \ \ \ \ \ \ \};}
\DoxyCodeLine{00190\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00191\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00192\ }
\DoxyCodeLine{00193\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00194\ \ \ \ \ \ \ \ \ deferred\_factory\_parameter<}
\DoxyCodeLine{00195\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ gko::detail::factory\_type<l\_solver\_type>>}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_generator;}
\DoxyCodeLine{00197\ }
\DoxyCodeLine{00198\ \ \ \ \ \ \ \ \ deferred\_factory\_parameter<const\ LinOpFactory>\ factorization\_generator;}
\DoxyCodeLine{00199\ \ \ \ \ \};}
\DoxyCodeLine{00200\ }
\DoxyCodeLine{00201\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}},\ parameters,\ Factory);}
\DoxyCodeLine{00202\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00203\ }
\DoxyCodeLine{00222\ \ \ \ \ \textcolor{keyword}{static}\ parameters\_type\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a280d45df2d4caafb80b2401d65c22ff6}{parse}}(}
\DoxyCodeLine{00223\ \ \ \ \ \ \ \ \ \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{00224\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::type\_descriptor}}\&\ td\_for\_child\ =}
\DoxyCodeLine{00225\ \ \ \ \ \ \ \ \ \ \ \ \ config::make\_type\_descriptor<value\_type,\ index\_type>())}
\DoxyCodeLine{00226\ \ \ \ \ \{}
\DoxyCodeLine{00227\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ parse\ is\ not\ templated,\ so\ we\ can\ only\ use\ SFINAE\ later}}
\DoxyCodeLine{00228\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ detail::ic\_parse<Ic>(config,\ context,\ td\_for\_child);}
\DoxyCodeLine{00229\ \ \ \ \ \}}
\DoxyCodeLine{00230\ }
\DoxyCodeLine{00236\ \ \ \ \ std::shared\_ptr<const\ l\_solver\_type>\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_af429c11fb22226cacce21544f4fc3b7f}{get\_l\_solver}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00237\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00238\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ l\_solver\_;}
\DoxyCodeLine{00239\ \ \ \ \ \}}
\DoxyCodeLine{00240\ }
\DoxyCodeLine{00246\ \ \ \ \ std::shared\_ptr<const\ lh\_solver\_type>\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a81601c95747d96f83e1f71a9523df822}{get\_lh\_solver}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00247\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00248\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ lh\_solver\_;}
\DoxyCodeLine{00249\ \ \ \ \ \}}
\DoxyCodeLine{00250\ }
\DoxyCodeLine{00251\ \ \ \ \ std::unique\_ptr<LinOp>\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a50377c364b6b4b472cd5a58d94b0aacc}{transpose}}()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00252\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00253\ \ \ \ \ \ \ \ \ std::unique\_ptr<transposed\_type>\ transposed\{}
\DoxyCodeLine{00254\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{new}\ transposed\_type\{this-\/>get\_executor()\}\};}
\DoxyCodeLine{00255\ \ \ \ \ \ \ \ \ transposed-\/>set\_size(\doxymbox{\hyperlink{namespacegko_aacad7f87b38d3f26674ed034d442a1a0}{gko::transpose}}(this-\/>get\_size()));}
\DoxyCodeLine{00256\ \ \ \ \ \ \ \ \ transposed-\/>l\_solver\_\ =}
\DoxyCodeLine{00257\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{share}}(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as}}<gko::detail::transposed\_type<lh\_solver\_type>>(}
\DoxyCodeLine{00258\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<Transposable>}}(this-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a81601c95747d96f83e1f71a9523df822}{get\_lh\_solver}}())-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a50377c364b6b4b472cd5a58d94b0aacc}{transpose}}()));}
\DoxyCodeLine{00259\ \ \ \ \ \ \ \ \ transposed-\/>lh\_solver\_\ =}
\DoxyCodeLine{00260\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{share}}(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as}}<gko::detail::transposed\_type<l\_solver\_type>>(}
\DoxyCodeLine{00261\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<Transposable>}}(this-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_af429c11fb22226cacce21544f4fc3b7f}{get\_l\_solver}}())-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a50377c364b6b4b472cd5a58d94b0aacc}{transpose}}()));}
\DoxyCodeLine{00262\ }
\DoxyCodeLine{00263\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::move(transposed);}
\DoxyCodeLine{00264\ \ \ \ \ \}}
\DoxyCodeLine{00265\ }
\DoxyCodeLine{00266\ \ \ \ \ std::unique\_ptr<LinOp>\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a871b1f3209b309c88af7d61fdae865a5}{conj\_transpose}}()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00267\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00268\ \ \ \ \ \ \ \ \ std::unique\_ptr<transposed\_type>\ transposed\{}
\DoxyCodeLine{00269\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{new}\ transposed\_type\{this-\/>get\_executor()\}\};}
\DoxyCodeLine{00270\ \ \ \ \ \ \ \ \ transposed-\/>set\_size(\doxymbox{\hyperlink{namespacegko_aacad7f87b38d3f26674ed034d442a1a0}{gko::transpose}}(this-\/>get\_size()));}
\DoxyCodeLine{00271\ \ \ \ \ \ \ \ \ transposed-\/>l\_solver\_\ =}
\DoxyCodeLine{00272\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{share}}(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as}}<gko::detail::transposed\_type<lh\_solver\_type>>(}
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<Transposable>}}(this-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a81601c95747d96f83e1f71a9523df822}{get\_lh\_solver}}())-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a871b1f3209b309c88af7d61fdae865a5}{conj\_transpose}}()));}
\DoxyCodeLine{00274\ \ \ \ \ \ \ \ \ transposed-\/>lh\_solver\_\ =}
\DoxyCodeLine{00275\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae99fdd8bfa5ac694adcb7297d432967e}{share}}(\doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as}}<gko::detail::transposed\_type<l\_solver\_type>>(}
\DoxyCodeLine{00276\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<Transposable>}}(this-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_af429c11fb22226cacce21544f4fc3b7f}{get\_l\_solver}}())-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a871b1f3209b309c88af7d61fdae865a5}{conj\_transpose}}()));}
\DoxyCodeLine{00277\ }
\DoxyCodeLine{00278\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::move(transposed);}
\DoxyCodeLine{00279\ \ \ \ \ \}}
\DoxyCodeLine{00280\ }
\DoxyCodeLine{00286\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\&\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a2bde451992151de66f7d6c15818914cb}{operator=}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\&\ other)}
\DoxyCodeLine{00287\ \ \ \ \ \{}
\DoxyCodeLine{00288\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00289\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp<Ic>::operator=}}(other);}
\DoxyCodeLine{00290\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ this-\/>get\_executor();}
\DoxyCodeLine{00291\ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_\ =\ other.l\_solver\_;}
\DoxyCodeLine{00292\ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_\ =\ other.lh\_solver\_;}
\DoxyCodeLine{00293\ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_\ =\ other.parameters\_;}
\DoxyCodeLine{00294\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (other.get\_executor()\ !=\ exec)\ \{}
\DoxyCodeLine{00295\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(exec,\ l\_solver\_);}
\DoxyCodeLine{00296\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(exec,\ lh\_solver\_);}
\DoxyCodeLine{00297\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00298\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00299\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00300\ \ \ \ \ \}}
\DoxyCodeLine{00301\ }
\DoxyCodeLine{00308\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\&\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a375dcf8ab16c15bbb4d4a1d79d9524a1}{operator=}}(\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\&\&\ other)}
\DoxyCodeLine{00309\ \ \ \ \ \{}
\DoxyCodeLine{00310\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00311\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp<Ic>::operator=}}(other);}
\DoxyCodeLine{00312\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ this-\/>get\_executor();}
\DoxyCodeLine{00313\ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_\ =\ std::move(other.l\_solver\_);}
\DoxyCodeLine{00314\ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_\ =\ std::move(other.lh\_solver\_);}
\DoxyCodeLine{00315\ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_\ =\ std::exchange(other.parameters\_,\ parameters\_type\{\});}
\DoxyCodeLine{00316\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (other.get\_executor()\ !=\ exec)\ \{}
\DoxyCodeLine{00317\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(exec,\ l\_solver\_);}
\DoxyCodeLine{00318\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(exec,\ lh\_solver\_);}
\DoxyCodeLine{00319\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00320\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00321\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00322\ \ \ \ \ \}}
\DoxyCodeLine{00323\ }
\DoxyCodeLine{00328\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\&\ other)\ :\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\{other.get\_executor()\}\ \{\ *\textcolor{keyword}{this}\ =\ other;\ \}}
\DoxyCodeLine{00329\ }
\DoxyCodeLine{00335\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a829838c89844bf6eb96a01ec17249be9}{Ic}}(\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\&\&\ other)\ :\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}\{other.get\_executor()\}\ \{\ *\textcolor{keyword}{this}\ =\ std::move(other);\ \}}
\DoxyCodeLine{00336\ }
\DoxyCodeLine{00337\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00338\ \ \ \ \ \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{00339\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00340\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ take\ care\ of\ real-\/to-\/complex\ apply}}
\DoxyCodeLine{00341\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a98c5a37c89e32c0f2b567f8e73870e3a}{precision\_dispatch\_real\_complex<value\_type>}}(}
\DoxyCodeLine{00342\ \ \ \ \ \ \ \ \ \ \ \ \ [\&](\textcolor{keyword}{auto}\ dense\_b,\ \textcolor{keyword}{auto}\ dense\_x)\ \{}
\DoxyCodeLine{00343\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>set\_cache\_to(dense\_b);}
\DoxyCodeLine{00344\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_-\/>apply(dense\_b,\ cache\_.intermediate);}
\DoxyCodeLine{00345\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (lh\_solver\_-\/>apply\_uses\_initial\_guess())\ \{}
\DoxyCodeLine{00346\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dense\_x-\/>copy\_from(cache\_.intermediate);}
\DoxyCodeLine{00347\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00348\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_-\/>apply(cache\_.intermediate,\ dense\_x);}
\DoxyCodeLine{00349\ \ \ \ \ \ \ \ \ \ \ \ \ \},}
\DoxyCodeLine{00350\ \ \ \ \ \ \ \ \ \ \ \ \ b,\ x);}
\DoxyCodeLine{00351\ \ \ \ \ \}}
\DoxyCodeLine{00352\ }
\DoxyCodeLine{00353\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ LinOp*\ alpha,\ \textcolor{keyword}{const}\ LinOp*\ b,\ \textcolor{keyword}{const}\ LinOp*\ beta,}
\DoxyCodeLine{00354\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LinOp*\ x)\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00355\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00356\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a98c5a37c89e32c0f2b567f8e73870e3a}{precision\_dispatch\_real\_complex<value\_type>}}(}
\DoxyCodeLine{00357\ \ \ \ \ \ \ \ \ \ \ \ \ [\&](\textcolor{keyword}{auto}\ dense\_alpha,\ \textcolor{keyword}{auto}\ dense\_b,\ \textcolor{keyword}{auto}\ dense\_beta,\ \textcolor{keyword}{auto}\ dense\_x)\ \{}
\DoxyCodeLine{00358\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>set\_cache\_to(dense\_b);}
\DoxyCodeLine{00359\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_-\/>apply(dense\_b,\ cache\_.intermediate);}
\DoxyCodeLine{00360\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_-\/>apply(dense\_alpha,\ cache\_.intermediate,\ dense\_beta,}
\DoxyCodeLine{00361\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dense\_x);}
\DoxyCodeLine{00362\ \ \ \ \ \ \ \ \ \ \ \ \ \},}
\DoxyCodeLine{00363\ \ \ \ \ \ \ \ \ \ \ \ \ alpha,\ b,\ beta,\ x);}
\DoxyCodeLine{00364\ \ \ \ \ \}}
\DoxyCodeLine{00365\ }
\DoxyCodeLine{00366\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}(std::shared\_ptr<const\ Executor>\ exec)}
\DoxyCodeLine{00367\ \ \ \ \ \ \ \ \ :\ EnableLinOp<\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}>(std::move(exec))}
\DoxyCodeLine{00368\ \ \ \ \ \{\}}
\DoxyCodeLine{00369\ }
\DoxyCodeLine{00370\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_1_1Factory}{Factory}}*\ factory,\ std::shared\_ptr<const\ LinOp>\ lin\_op)}
\DoxyCodeLine{00371\ \ \ \ \ \ \ \ \ :\ EnableLinOp<\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_ac5aed93da8c97cfeff5364070fabec67}{Ic}}>(\doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>get\_executor(),\ lin\_op-\/>get\_size()),}
\DoxyCodeLine{00372\ \ \ \ \ \ \ \ \ \ \ parameters\_\{\doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>get\_parameters()\}}
\DoxyCodeLine{00373\ \ \ \ \ \{}
\DoxyCodeLine{00374\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ comp\ =}
\DoxyCodeLine{00375\ \ \ \ \ \ \ \ \ \ \ \ \ std::dynamic\_pointer\_cast<const\ Composition<value\_type>>(lin\_op);}
\DoxyCodeLine{00376\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ l\_factor;}
\DoxyCodeLine{00377\ }
\DoxyCodeLine{00378\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ build\ factorization\ if\ we\ weren't\ passed\ a\ composition}}
\DoxyCodeLine{00379\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!comp)\ \{}
\DoxyCodeLine{00380\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ lin\_op-\/>get\_executor();}
\DoxyCodeLine{00381\ }
\DoxyCodeLine{00382\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!parameters\_.factorization\_factory)\ \{}
\DoxyCodeLine{00383\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_.factorization\_factory\ =}
\DoxyCodeLine{00384\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factorization::ParIc<value\_type,\ index\_type>::build()}
\DoxyCodeLine{00385\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_both\_factors(\textcolor{keyword}{false})}
\DoxyCodeLine{00386\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{00387\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00388\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ fact\ =\ std::shared\_ptr<const\ LinOp>(}
\DoxyCodeLine{00389\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_.factorization\_factory-\/>generate(lin\_op));}
\DoxyCodeLine{00390\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ ensure\ that\ the\ result\ is\ a\ composition}}
\DoxyCodeLine{00391\ \ \ \ \ \ \ \ \ \ \ \ \ comp\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{gko::as<const\ Composition<value\_type>}}>(fact);}
\DoxyCodeLine{00392\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00393\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ comp\ must\ contain\ one\ or\ two\ factors}}
\DoxyCodeLine{00394\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (comp-\/>get\_operators().size()\ >\ 2\ ||\ comp-\/>get\_operators().empty())\ \{}
\DoxyCodeLine{00395\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_NOT\_SUPPORTED(comp);}
\DoxyCodeLine{00396\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00397\ \ \ \ \ \ \ \ \ l\_factor\ =\ comp-\/>get\_operators()[0];}
\DoxyCodeLine{00398\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_IS\_SQUARE\_MATRIX(l\_factor);}
\DoxyCodeLine{00399\ }
\DoxyCodeLine{00400\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ this-\/>get\_executor();}
\DoxyCodeLine{00401\ }
\DoxyCodeLine{00402\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ no\ factories\ are\ provided,\ generate\ default\ ones}}
\DoxyCodeLine{00403\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!parameters\_.l\_solver\_factory)\ \{}
\DoxyCodeLine{00404\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ when\ l\_solver\_type\ is\ LinOp,\ use\ LowerTrs\ as\ the\ default\ one}}
\DoxyCodeLine{00405\ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_\ =\ generate\_default\_solver<std::conditional\_t<}
\DoxyCodeLine{00406\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::is\_same\_v<l\_solver\_type,\ LinOp>,}
\DoxyCodeLine{00407\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ solver::LowerTrs<value\_type,\ index\_type>,\ l\_solver\_type>>(}
\DoxyCodeLine{00408\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ exec,\ l\_factor);}
\DoxyCodeLine{00409\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ If\ comp\ contains\ both\ factors:\ We\ only\ check\ the\ dimension\ from}}
\DoxyCodeLine{00410\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ the\ second\ factor.\ However,\ we\ still\ use\ the\ l\_solver\string^H\ not}}
\DoxyCodeLine{00411\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ generate\ the\ solver\ on\ L\string^H\ to\ preserve\ the\ Hermitian\ property\ of}}
\DoxyCodeLine{00412\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ this\ preconditioner.\ LSolver(L)\string^H\ is\ not\ always\ LSolver\string^H(L\string^H).}}
\DoxyCodeLine{00413\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (comp-\/>get\_operators().size()\ ==\ 2)\ \{}
\DoxyCodeLine{00414\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ lh\_factor\ =\ comp-\/>get\_operators()[1];}
\DoxyCodeLine{00415\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_DIMENSIONS(l\_factor,\ lh\_factor);}
\DoxyCodeLine{00416\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00417\ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<lh\_solver\_type>}}(}
\DoxyCodeLine{00418\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<Transposable>}}(l\_solver\_)-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a871b1f3209b309c88af7d61fdae865a5}{conj\_transpose}}());}
\DoxyCodeLine{00419\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00420\ \ \ \ \ \ \ \ \ \ \ \ \ l\_solver\_\ =\ parameters\_.l\_solver\_factory-\/>generate(l\_factor);}
\DoxyCodeLine{00421\ \ \ \ \ \ \ \ \ \ \ \ \ lh\_solver\_\ =\ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<lh\_solver\_type>}}(}
\DoxyCodeLine{00422\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<Transposable>}}(l\_solver\_)-\/>\doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic_a871b1f3209b309c88af7d61fdae865a5}{conj\_transpose}}());}
\DoxyCodeLine{00423\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00424\ \ \ \ \ \}}
\DoxyCodeLine{00425\ }
\DoxyCodeLine{00433\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_cache\_to(\textcolor{keyword}{const}\ LinOp*\ b)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00434\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00435\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (cache\_.intermediate\ ==\ \textcolor{keyword}{nullptr})\ \{}
\DoxyCodeLine{00436\ \ \ \ \ \ \ \ \ \ \ \ \ cache\_.intermediate\ =}
\DoxyCodeLine{00437\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense_ae198b3130d8966418047baa8dabe466c}{matrix::Dense<value\_type>::create}}(this-\/>get\_executor());}
\DoxyCodeLine{00438\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00439\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Use\ b\ as\ the\ initial\ guess\ for\ the\ first\ triangular\ solve}}
\DoxyCodeLine{00440\ \ \ \ \ \ \ \ \ cache\_.intermediate-\/>copy\_from(b);}
\DoxyCodeLine{00441\ \ \ \ \ \}}
\DoxyCodeLine{00442\ }
\DoxyCodeLine{00450\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ SolverType>}
\DoxyCodeLine{00451\ \ \ \ \ \textcolor{keyword}{static}\ std::enable\_if\_t<solver::has\_with\_criteria<SolverType>::value\ \&\&}
\DoxyCodeLine{00452\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ !std::is\_same\_v<SolverType,\ LinOp>,}
\DoxyCodeLine{00453\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::unique\_ptr<SolverType>>}
\DoxyCodeLine{00454\ \ \ \ \ generate\_default\_solver(\textcolor{keyword}{const}\ std::shared\_ptr<const\ Executor>\&\ exec,}
\DoxyCodeLine{00455\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::shared\_ptr<const\ LinOp>\&\ mtx)}
\DoxyCodeLine{00456\ \ \ \ \ \{}
\DoxyCodeLine{00457\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{gko::remove\_complex<value\_type>}}\ default\_reduce\_residual\{1e-\/4\};}
\DoxyCodeLine{00458\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ default\_max\_iters\{}
\DoxyCodeLine{00459\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\textcolor{keyword}{>}(mtx-\/>get\_size()[0])\};}
\DoxyCodeLine{00460\ }
\DoxyCodeLine{00461\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ SolverType::build()}
\DoxyCodeLine{00462\ \ \ \ \ \ \ \ \ \ \ \ \ .with\_criteria(}
\DoxyCodeLine{00463\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::stop::Iteration::build().with\_max\_iters(default\_max\_iters),}
\DoxyCodeLine{00464\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::stop::ResidualNorm<value\_type>::build()}
\DoxyCodeLine{00465\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .with\_reduction\_factor(default\_reduce\_residual))}
\DoxyCodeLine{00466\ \ \ \ \ \ \ \ \ \ \ \ \ .on(exec)}
\DoxyCodeLine{00467\ \ \ \ \ \ \ \ \ \ \ \ \ -\/>generate(mtx);}
\DoxyCodeLine{00468\ \ \ \ \ \}}
\DoxyCodeLine{00469\ }
\DoxyCodeLine{00473\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ SolverType>}
\DoxyCodeLine{00474\ \ \ \ \ \textcolor{keyword}{static}\ std::enable\_if\_t<!solver::has\_with\_criteria<SolverType>::value\ \&\&}
\DoxyCodeLine{00475\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ !std::is\_same\_v<SolverType,\ LinOp>,}
\DoxyCodeLine{00476\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::unique\_ptr<SolverType>>}
\DoxyCodeLine{00477\ \ \ \ \ generate\_default\_solver(\textcolor{keyword}{const}\ std::shared\_ptr<const\ Executor>\&\ exec,}
\DoxyCodeLine{00478\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::shared\_ptr<const\ LinOp>\&\ mtx)}
\DoxyCodeLine{00479\ \ \ \ \ \{}
\DoxyCodeLine{00480\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ SolverType::build().on(exec)-\/>generate(mtx);}
\DoxyCodeLine{00481\ \ \ \ \ \}}
\DoxyCodeLine{00482\ }
\DoxyCodeLine{00483\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00484\ \ \ \ \ std::shared\_ptr<const\ l\_solver\_type>\ l\_solver\_\{\};}
\DoxyCodeLine{00485\ \ \ \ \ std::shared\_ptr<const\ lh\_solver\_type>\ lh\_solver\_\{\};}
\DoxyCodeLine{00496\ \ \ \ \ \textcolor{keyword}{mutable}\ \textcolor{keyword}{struct\ }cache\_struct\ \{}
\DoxyCodeLine{00497\ \ \ \ \ \ \ \ \ cache\_struct()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00498\ \ \ \ \ \ \ \ \ \string~cache\_struct()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00499\ \ \ \ \ \ \ \ \ cache\_struct(\textcolor{keyword}{const}\ cache\_struct\&)\ \{\}}
\DoxyCodeLine{00500\ \ \ \ \ \ \ \ \ cache\_struct(cache\_struct\&\&)\ \{\}}
\DoxyCodeLine{00501\ \ \ \ \ \ \ \ \ cache\_struct\&\ operator=(\textcolor{keyword}{const}\ cache\_struct\&)\ \{\ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};\ \}}
\DoxyCodeLine{00502\ \ \ \ \ \ \ \ \ cache\_struct\&\ operator=(cache\_struct\&\&)\ \{\ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};\ \}}
\DoxyCodeLine{00503\ \ \ \ \ \ \ \ \ std::unique\_ptr<LinOp>\ intermediate\{\};}
\DoxyCodeLine{00504\ \ \ \ \ \}\ cache\_;}
\DoxyCodeLine{00505\ \};}
\DoxyCodeLine{00506\ }
\DoxyCodeLine{00507\ }
\DoxyCodeLine{00508\ \}\ \ \textcolor{comment}{//\ namespace\ preconditioner}}
\DoxyCodeLine{00509\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00510\ }
\DoxyCodeLine{00511\ }
\DoxyCodeLine{00512\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_PRECONDITIONER\_IC\_HPP\_}}

\end{DoxyCode}
