\doxysection{solver\+\_\+base.\+hpp}
\hypertarget{solver__base_8hpp_source}{}\label{solver__base_8hpp_source}\index{ginkgo/core/solver/solver\_base.hpp@{ginkgo/core/solver/solver\_base.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\_SOLVER\_SOLVER\_BASE\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_SOLVER\_SOLVER\_BASE\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <type\_traits>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <utility>}}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/math.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/log/logger.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/dense.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/identity.hpp>}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#include\ <ginkgo/core/solver/workspace.hpp>}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/combined.hpp>}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/criterion.hpp>}}
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ GKO\_BEGIN\_DISABLE\_DEPRECATION\_WARNINGS}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00027\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1solver}{solver}}\ \{}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00033\ \textcolor{keyword}{enum\ class}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ \{}
\DoxyCodeLine{00037\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a70dbe01ff95c7b953d3d737424c6feb5}{zero}},}
\DoxyCodeLine{00041\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa83ff9f9e3dd7561d3dd91204cf546b7e}{rhs}},}
\DoxyCodeLine{00045\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa1f5f6080965ed6d0a90e6b9ec599e441}{provided}}}
\DoxyCodeLine{00046\ \};}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1multigrid}{multigrid}}\ \{}
\DoxyCodeLine{00050\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \textcolor{keyword}{class\ }MultigridState;}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00057\ \}\ \ \textcolor{comment}{//\ namespace\ multigrid}}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00065\ \textcolor{keyword}{class\ }ApplyWithInitialGuess\ \{}
\DoxyCodeLine{00066\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }multigrid::detail::MultigridState;}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const}\ =\ 0;}
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<const\ LinOp>}}\ b,\ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<LinOp>}}\ x,}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00087\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00088\ \ \ \ \ \ \ \ \ apply\_with\_initial\_guess(b.get(),\ x.get(),\ guess);}
\DoxyCodeLine{00089\ \ \ \ \ \}}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00103\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ alpha,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ beta,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const}\ =\ 0;}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00108\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<const\ LinOp>}}\ alpha,}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<const\ LinOp>}}\ b,}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<const\ LinOp>}}\ beta,}
\DoxyCodeLine{00111\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<LinOp>}}\ x,}
\DoxyCodeLine{00112\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00113\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ apply\_with\_initial\_guess(alpha.get(),\ b.get(),\ beta.get(),\ x.get(),}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ guess);}
\DoxyCodeLine{00116\ \ \ \ \ \}}
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00123\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ get\_default\_initial\_guess()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ guess\_;\ \}}
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00131\ \ \ \ \ \textcolor{keyword}{explicit}\ ApplyWithInitialGuess(}
\DoxyCodeLine{00132\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess\ =\ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa1f5f6080965ed6d0a90e6b9ec599e441}{initial\_guess\_mode::provided}})}
\DoxyCodeLine{00133\ \ \ \ \ \ \ \ \ :\ guess\_(guess)}
\DoxyCodeLine{00134\ \ \ \ \ \{\}}
\DoxyCodeLine{00135\ }
\DoxyCodeLine{00141\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_default\_initial\_guess(\doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \{\ guess\_\ =\ guess;\ \}}
\DoxyCodeLine{00142\ }
\DoxyCodeLine{00143\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00144\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess\_;}
\DoxyCodeLine{00145\ \};}
\DoxyCodeLine{00146\ }
\DoxyCodeLine{00147\ }
\DoxyCodeLine{00160\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ DerivedType>}
\DoxyCodeLine{00161\ \textcolor{keyword}{class\ }EnableApplyWithInitialGuess\ :\ \textcolor{keyword}{public}\ ApplyWithInitialGuess\ \{}
\DoxyCodeLine{00162\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00163\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }multigrid::detail::MultigridState;}
\DoxyCodeLine{00164\ }
\DoxyCodeLine{00165\ \ \ \ \ \textcolor{keyword}{explicit}\ EnableApplyWithInitialGuess(}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess\ =\ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa1f5f6080965ed6d0a90e6b9ec599e441}{initial\_guess\_mode::provided}})}
\DoxyCodeLine{00167\ \ \ \ \ \ \ \ \ :\ ApplyWithInitialGuess(guess)}
\DoxyCodeLine{00168\ \ \ \ \ \{\}}
\DoxyCodeLine{00169\ }
\DoxyCodeLine{00174\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00176\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ self()-\/>template\ \doxymbox{\hyperlink{namespacegko_1_1log}{log<log::Logger::linop\_apply\_started>}}(self(),\ b,\ x);}
\DoxyCodeLine{00178\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ self()-\/>get\_executor();}
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_CONFORMANT(self(),\ b);}
\DoxyCodeLine{00180\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_ROWS(self(),\ x);}
\DoxyCodeLine{00181\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_COLS(b,\ x);}
\DoxyCodeLine{00182\ \ \ \ \ \ \ \ \ this-\/>apply\_with\_initial\_guess\_impl(\doxymbox{\hyperlink{namespacegko_adf2f8602dc9453752a787b40bbf13fcf}{make\_temporary\_clone}}(exec,\ b).get(),}
\DoxyCodeLine{00183\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_adf2f8602dc9453752a787b40bbf13fcf}{make\_temporary\_clone}}(exec,\ x).get(),}
\DoxyCodeLine{00184\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ guess);}
\DoxyCodeLine{00185\ \ \ \ \ \ \ \ \ self()-\/>template\ \doxymbox{\hyperlink{namespacegko_1_1log}{log<log::Logger::linop\_apply\_completed>}}(self(),\ b,\ x);}
\DoxyCodeLine{00186\ \ \ \ \ \}}
\DoxyCodeLine{00187\ }
\DoxyCodeLine{00192\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ alpha,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,}
\DoxyCodeLine{00193\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ beta,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00194\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00195\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ self()-\/>template\ \doxymbox{\hyperlink{namespacegko_1_1log}{log<log::Logger::linop\_advanced\_apply\_started>}}(}
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ \ \ \ \ self(),\ alpha,\ b,\ beta,\ x);}
\DoxyCodeLine{00198\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ self()-\/>get\_executor();}
\DoxyCodeLine{00199\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_CONFORMANT(self(),\ b);}
\DoxyCodeLine{00200\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_ROWS(self(),\ x);}
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_COLS(b,\ x);}
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_DIMENSIONS(alpha,\ \doxymbox{\hyperlink{structgko_1_1dim}{dim<2>}}(1,\ 1));}
\DoxyCodeLine{00203\ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_DIMENSIONS(beta,\ \doxymbox{\hyperlink{structgko_1_1dim}{dim<2>}}(1,\ 1));}
\DoxyCodeLine{00204\ \ \ \ \ \ \ \ \ this-\/>apply\_with\_initial\_guess\_impl(}
\DoxyCodeLine{00205\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_adf2f8602dc9453752a787b40bbf13fcf}{make\_temporary\_clone}}(exec,\ alpha).get(),}
\DoxyCodeLine{00206\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_adf2f8602dc9453752a787b40bbf13fcf}{make\_temporary\_clone}}(exec,\ b).get(),}
\DoxyCodeLine{00207\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_adf2f8602dc9453752a787b40bbf13fcf}{make\_temporary\_clone}}(exec,\ beta).get(),}
\DoxyCodeLine{00208\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_adf2f8602dc9453752a787b40bbf13fcf}{make\_temporary\_clone}}(exec,\ x).get(),\ guess);}
\DoxyCodeLine{00209\ \ \ \ \ \ \ \ \ self()-\/>template\ \doxymbox{\hyperlink{namespacegko_1_1log}{log<log::Logger::linop\_advanced\_apply\_completed>}}(}
\DoxyCodeLine{00210\ \ \ \ \ \ \ \ \ \ \ \ \ self(),\ alpha,\ b,\ beta,\ x);}
\DoxyCodeLine{00211\ \ \ \ \ \}}
\DoxyCodeLine{00212\ }
\DoxyCodeLine{00213\ \ \ \ \ \textcolor{comment}{//\ TODO:\ should\ we\ provide\ the\ default\ implementation?}}
\DoxyCodeLine{00218\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess\_impl(}
\DoxyCodeLine{00219\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,\ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const}\ =\ 0;}
\DoxyCodeLine{00220\ }
\DoxyCodeLine{00225\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess\_impl(}
\DoxyCodeLine{00226\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ alpha,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ beta,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00227\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const}\ =\ 0;}
\DoxyCodeLine{00228\ }
\DoxyCodeLine{00229\ \ \ \ \ GKO\_ENABLE\_SELF(DerivedType);}
\DoxyCodeLine{00230\ \};}
\DoxyCodeLine{00231\ }
\DoxyCodeLine{00232\ }
\DoxyCodeLine{00237\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Solver>}
\DoxyCodeLine{00238\ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1workspace__traits}{workspace\_traits}}\ \{}
\DoxyCodeLine{00239\ \ \ \ \ \textcolor{comment}{//\ number\ of\ vectors\ used\ by\ this\ workspace}}
\DoxyCodeLine{00240\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_vectors(\textcolor{keyword}{const}\ Solver\&)\ \{\ \textcolor{keywordflow}{return}\ 0;\ \}}
\DoxyCodeLine{00241\ \ \ \ \ \textcolor{comment}{//\ number\ of\ arrays\ used\ by\ this\ workspace}}
\DoxyCodeLine{00242\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_arrays(\textcolor{keyword}{const}\ Solver\&)\ \{\ \textcolor{keywordflow}{return}\ 0;\ \}}
\DoxyCodeLine{00243\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_vectors\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00244\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ op\_names(\textcolor{keyword}{const}\ Solver\&)\ \{\ \textcolor{keywordflow}{return}\ \{\};\ \}}
\DoxyCodeLine{00245\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_arrays\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00246\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ array\_names(\textcolor{keyword}{const}\ Solver\&)\ \{\ \textcolor{keywordflow}{return}\ \{\};\ \}}
\DoxyCodeLine{00247\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ scalar\ vectors\ (independent\ of\ problem\ size)}}
\DoxyCodeLine{00248\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ scalars(\textcolor{keyword}{const}\ Solver\&)\ \{\ \textcolor{keywordflow}{return}\ \{\};\ \}}
\DoxyCodeLine{00249\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ vectors\ (dependent\ on\ problem\ size)}}
\DoxyCodeLine{00250\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ vectors(\textcolor{keyword}{const}\ Solver\&)\ \{\ \textcolor{keywordflow}{return}\ \{\};\ \}}
\DoxyCodeLine{00251\ \};}
\DoxyCodeLine{00252\ }
\DoxyCodeLine{00253\ }
\DoxyCodeLine{00269\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ DerivedType>}
\DoxyCodeLine{00270\ \textcolor{keyword}{class\ }EnablePreconditionable\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1Preconditionable}{Preconditionable}}\ \{}
\DoxyCodeLine{00271\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00278\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_ad1f52e213256cd7c50811787dfcf4288}{set\_preconditioner}}(std::shared\_ptr<const\ LinOp>\ new\_precond)\textcolor{keyword}{\ override}}
\DoxyCodeLine{00279\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00280\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ self()-\/>get\_executor();}
\DoxyCodeLine{00281\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (new\_precond)\ \{}
\DoxyCodeLine{00282\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_DIMENSIONS(self(),\ new\_precond);}
\DoxyCodeLine{00283\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_ASSERT\_IS\_SQUARE\_MATRIX(new\_precond);}
\DoxyCodeLine{00284\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (new\_precond-\/>get\_executor()\ !=\ exec)\ \{}
\DoxyCodeLine{00285\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ new\_precond\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(exec,\ new\_precond);}
\DoxyCodeLine{00286\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00287\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00288\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1Preconditionable_a95db3e56eb17efbcde951c5ed144582d}{Preconditionable::set\_preconditioner}}(new\_precond);}
\DoxyCodeLine{00289\ \ \ \ \ \}}
\DoxyCodeLine{00290\ }
\DoxyCodeLine{00295\ \ \ \ \ EnablePreconditionable\&\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_ab89378218874fc1441a4a3d995b01a02}{operator=}}(\textcolor{keyword}{const}\ EnablePreconditionable\&\ other)}
\DoxyCodeLine{00296\ \ \ \ \ \{}
\DoxyCodeLine{00297\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00298\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_ad1f52e213256cd7c50811787dfcf4288}{set\_preconditioner}}(other.\doxymbox{\hyperlink{classgko_1_1Preconditionable_abde941e32b5fc5007a4afe0f6d3fdfbc}{get\_preconditioner}}());}
\DoxyCodeLine{00299\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00300\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00301\ \ \ \ \ \}}
\DoxyCodeLine{00302\ }
\DoxyCodeLine{00308\ \ \ \ \ EnablePreconditionable\&\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_aa677dd092a26e4b33d9a811460f53616}{operator=}}(EnablePreconditionable\&\&\ other)}
\DoxyCodeLine{00309\ \ \ \ \ \{}
\DoxyCodeLine{00310\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00311\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_ad1f52e213256cd7c50811787dfcf4288}{set\_preconditioner}}(other.get\_preconditioner());}
\DoxyCodeLine{00312\ \ \ \ \ \ \ \ \ \ \ \ \ other.set\_preconditioner(\textcolor{keyword}{nullptr});}
\DoxyCodeLine{00313\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00314\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00315\ \ \ \ \ \}}
\DoxyCodeLine{00316\ }
\DoxyCodeLine{00317\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable}{EnablePreconditionable}}()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00318\ }
\DoxyCodeLine{00319\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable}{EnablePreconditionable}}(std::shared\_ptr<const\ LinOp>\ \doxymbox{\hyperlink{namespacegko_1_1preconditioner}{preconditioner}})}
\DoxyCodeLine{00320\ \ \ \ \ \{}
\DoxyCodeLine{00321\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_ad1f52e213256cd7c50811787dfcf4288}{set\_preconditioner}}(std::move(\doxymbox{\hyperlink{namespacegko_1_1preconditioner}{preconditioner}}));}
\DoxyCodeLine{00322\ \ \ \ \ \}}
\DoxyCodeLine{00323\ }
\DoxyCodeLine{00327\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_a97b244d0fe8ea71e58c789542dc24641}{EnablePreconditionable}}(\textcolor{keyword}{const}\ EnablePreconditionable\&\ other)}
\DoxyCodeLine{00328\ \ \ \ \ \{}
\DoxyCodeLine{00329\ \ \ \ \ \ \ \ \ *\textcolor{keyword}{this}\ =\ other;}
\DoxyCodeLine{00330\ \ \ \ \ \}}
\DoxyCodeLine{00331\ }
\DoxyCodeLine{00336\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_aaa7bb12e91c97393fbe2aca090ed177f}{EnablePreconditionable}}(EnablePreconditionable\&\&\ other)}
\DoxyCodeLine{00337\ \ \ \ \ \{}
\DoxyCodeLine{00338\ \ \ \ \ \ \ \ \ *\textcolor{keyword}{this}\ =\ std::move(other);}
\DoxyCodeLine{00339\ \ \ \ \ \}}
\DoxyCodeLine{00340\ }
\DoxyCodeLine{00341\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00342\ \ \ \ \ DerivedType*\ self()\ \{\ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}DerivedType*\textcolor{keyword}{>}(\textcolor{keyword}{this});\ \}}
\DoxyCodeLine{00343\ }
\DoxyCodeLine{00344\ \ \ \ \ \textcolor{keyword}{const}\ DerivedType*\ self()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00345\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00346\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}\textcolor{keyword}{const\ }DerivedType*\textcolor{keyword}{>}(\textcolor{keyword}{this});}
\DoxyCodeLine{00347\ \ \ \ \ \}}
\DoxyCodeLine{00348\ \};}
\DoxyCodeLine{00349\ }
\DoxyCodeLine{00350\ }
\DoxyCodeLine{00351\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00352\ }
\DoxyCodeLine{00353\ }
\DoxyCodeLine{00362\ \textcolor{keyword}{class\ }SolverBaseLinOp\ \{}
\DoxyCodeLine{00363\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00364\ \ \ \ \ SolverBaseLinOp(std::shared\_ptr<const\ Executor>\ exec)}
\DoxyCodeLine{00365\ \ \ \ \ \ \ \ \ :\ workspace\_\{std::move(exec)\}}
\DoxyCodeLine{00366\ \ \ \ \ \{\}}
\DoxyCodeLine{00367\ }
\DoxyCodeLine{00368\ \ \ \ \ \textcolor{keyword}{virtual}\ \string~SolverBaseLinOp()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00369\ }
\DoxyCodeLine{00375\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ get\_system\_matrix()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00376\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00377\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ system\_matrix\_;}
\DoxyCodeLine{00378\ \ \ \ \ \}}
\DoxyCodeLine{00379\ }
\DoxyCodeLine{00380\ \ \ \ \ \textcolor{keyword}{const}\ LinOp*\ get\_workspace\_op(\textcolor{keywordtype}{int}\ vector\_id)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00381\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00382\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.get\_op(vector\_id);}
\DoxyCodeLine{00383\ \ \ \ \ \}}
\DoxyCodeLine{00384\ }
\DoxyCodeLine{00385\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{int}\ get\_num\_workspace\_ops()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ 0;\ \}}
\DoxyCodeLine{00386\ }
\DoxyCodeLine{00387\ \ \ \ \ \textcolor{keyword}{virtual}\ std::vector<std::string>\ get\_workspace\_op\_names()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00388\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00389\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \{\};}
\DoxyCodeLine{00390\ \ \ \ \ \}}
\DoxyCodeLine{00391\ }
\DoxyCodeLine{00396\ \ \ \ \ \textcolor{keyword}{virtual}\ std::vector<int>\ get\_workspace\_scalars()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ \{\};\ \}}
\DoxyCodeLine{00397\ }
\DoxyCodeLine{00402\ \ \ \ \ \textcolor{keyword}{virtual}\ std::vector<int>\ get\_workspace\_vectors()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ \{\};\ \}}
\DoxyCodeLine{00403\ }
\DoxyCodeLine{00404\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00405\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_system\_matrix\_base(std::shared\_ptr<const\ LinOp>\ system\_matrix)}
\DoxyCodeLine{00406\ \ \ \ \ \{}
\DoxyCodeLine{00407\ \ \ \ \ \ \ \ \ system\_matrix\_\ =\ std::move(system\_matrix);}
\DoxyCodeLine{00408\ \ \ \ \ \}}
\DoxyCodeLine{00409\ }
\DoxyCodeLine{00410\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_workspace\_size(\textcolor{keywordtype}{int}\ num\_operators,\ \textcolor{keywordtype}{int}\ num\_arrays)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00411\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00412\ \ \ \ \ \ \ \ \ workspace\_.set\_size(num\_operators,\ num\_arrays);}
\DoxyCodeLine{00413\ \ \ \ \ \}}
\DoxyCodeLine{00414\ }
\DoxyCodeLine{00415\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ LinOpType>}
\DoxyCodeLine{00416\ \ \ \ \ LinOpType*\ create\_workspace\_op(\textcolor{keywordtype}{int}\ vector\_id,\ gko::dim<2>\ size)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00417\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00418\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ create\_or\_get\_op<LinOpType>(}
\DoxyCodeLine{00419\ \ \ \ \ \ \ \ \ \ \ \ \ vector\_id,}
\DoxyCodeLine{00420\ \ \ \ \ \ \ \ \ \ \ \ \ [\&]\ \{}
\DoxyCodeLine{00421\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ LinOpType::create(this-\/>workspace\_.get\_executor(),\ size);}
\DoxyCodeLine{00422\ \ \ \ \ \ \ \ \ \ \ \ \ \},}
\DoxyCodeLine{00423\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typeid}(LinOpType),\ size,\ size[1]);}
\DoxyCodeLine{00424\ \ \ \ \ \}}
\DoxyCodeLine{00425\ }
\DoxyCodeLine{00426\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ LinOpType>}
\DoxyCodeLine{00427\ \ \ \ \ LinOpType*\ create\_workspace\_op\_with\_config\_of(\textcolor{keywordtype}{int}\ vector\_id,}
\DoxyCodeLine{00428\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ LinOpType*\ vec)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00429\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00430\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ create\_or\_get\_op<LinOpType>(}
\DoxyCodeLine{00431\ \ \ \ \ \ \ \ \ \ \ \ \ vector\_id,\ [\&]\ \{\ \textcolor{keywordflow}{return}\ LinOpType::create\_with\_config\_of(vec);\ \},}
\DoxyCodeLine{00432\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typeid}(*vec),\ vec-\/>get\_size(),\ vec-\/>get\_stride());}
\DoxyCodeLine{00433\ \ \ \ \ \}}
\DoxyCodeLine{00434\ }
\DoxyCodeLine{00435\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ LinOpType>}
\DoxyCodeLine{00436\ \ \ \ \ LinOpType*\ create\_workspace\_op\_with\_type\_of(\textcolor{keywordtype}{int}\ vector\_id,}
\DoxyCodeLine{00437\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ LinOpType*\ vec,}
\DoxyCodeLine{00438\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dim<2>\ size)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00439\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00440\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ create\_or\_get\_op<LinOpType>(}
\DoxyCodeLine{00441\ \ \ \ \ \ \ \ \ \ \ \ \ vector\_id,}
\DoxyCodeLine{00442\ \ \ \ \ \ \ \ \ \ \ \ \ [\&]\ \{}
\DoxyCodeLine{00443\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ LinOpType::create\_with\_type\_of(}
\DoxyCodeLine{00444\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ vec,\ workspace\_.get\_executor(),\ size,\ size[1]);}
\DoxyCodeLine{00445\ \ \ \ \ \ \ \ \ \ \ \ \ \},}
\DoxyCodeLine{00446\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typeid}(*vec),\ size,\ size[1]);}
\DoxyCodeLine{00447\ \ \ \ \ \}}
\DoxyCodeLine{00448\ }
\DoxyCodeLine{00449\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ LinOpType>}
\DoxyCodeLine{00450\ \ \ \ \ LinOpType*\ create\_workspace\_op\_with\_type\_of(\textcolor{keywordtype}{int}\ vector\_id,}
\DoxyCodeLine{00451\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ LinOpType*\ vec,}
\DoxyCodeLine{00452\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dim<2>\ global\_size,}
\DoxyCodeLine{00453\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dim<2>\ local\_size)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00454\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00455\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ create\_or\_get\_op<LinOpType>(}
\DoxyCodeLine{00456\ \ \ \ \ \ \ \ \ \ \ \ \ vector\_id,}
\DoxyCodeLine{00457\ \ \ \ \ \ \ \ \ \ \ \ \ [\&]\ \{}
\DoxyCodeLine{00458\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ LinOpType::create\_with\_type\_of(}
\DoxyCodeLine{00459\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ vec,\ workspace\_.get\_executor(),\ global\_size,\ local\_size,}
\DoxyCodeLine{00460\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ local\_size[1]);}
\DoxyCodeLine{00461\ \ \ \ \ \ \ \ \ \ \ \ \ \},}
\DoxyCodeLine{00462\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typeid}(*vec),\ global\_size,\ local\_size[1]);}
\DoxyCodeLine{00463\ \ \ \ \ \}}
\DoxyCodeLine{00464\ }
\DoxyCodeLine{00465\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00466\ \ \ \ \ matrix::Dense<ValueType>*\ create\_workspace\_scalar(\textcolor{keywordtype}{int}\ vector\_id,}
\DoxyCodeLine{00467\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ size)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00468\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00469\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ create\_or\_get\_op<matrix::Dense<ValueType>>(}
\DoxyCodeLine{00470\ \ \ \ \ \ \ \ \ \ \ \ \ vector\_id,}
\DoxyCodeLine{00471\ \ \ \ \ \ \ \ \ \ \ \ \ [\&]\ \{}
\DoxyCodeLine{00472\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense_ae198b3130d8966418047baa8dabe466c}{matrix::Dense<ValueType>::create}}(}
\DoxyCodeLine{00473\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ workspace\_.get\_executor(),\ dim<2>\{1,\ size\});}
\DoxyCodeLine{00474\ \ \ \ \ \ \ \ \ \ \ \ \ \},}
\DoxyCodeLine{00475\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typeid}(matrix::Dense<ValueType>),\ gko::dim<2>\{1,\ size\},\ size);}
\DoxyCodeLine{00476\ \ \ \ \ \}}
\DoxyCodeLine{00477\ }
\DoxyCodeLine{00478\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00479\ \ \ \ \ \textcolor{keyword}{const}\ matrix::Dense<ValueType>*\ create\_workspace\_fixed\_scalar(}
\DoxyCodeLine{00480\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ vector\_id,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ size,\ ValueType\ val)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00481\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00482\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ create\_or\_get\_op<matrix::Dense<ValueType>>(}
\DoxyCodeLine{00483\ \ \ \ \ \ \ \ \ \ \ \ \ vector\_id,}
\DoxyCodeLine{00484\ \ \ \ \ \ \ \ \ \ \ \ \ [\&]\ \{}
\DoxyCodeLine{00485\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ mat\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense_ae198b3130d8966418047baa8dabe466c}{matrix::Dense<ValueType>::create}}(}
\DoxyCodeLine{00486\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ workspace\_.get\_executor(),\ dim<2>\{1,\ size\});}
\DoxyCodeLine{00487\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mat-\/>fill(val);}
\DoxyCodeLine{00488\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mat;}
\DoxyCodeLine{00489\ \ \ \ \ \ \ \ \ \ \ \ \ \},}
\DoxyCodeLine{00490\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typeid}(matrix::Dense<ValueType>),\ gko::dim<2>\{1,\ size\},\ size);}
\DoxyCodeLine{00491\ \ \ \ \ \}}
\DoxyCodeLine{00492\ }
\DoxyCodeLine{00493\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00494\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae749a5ea11a93c1bcc9158d9a6e9fb68af1f713c9e000f5d3f280adbd124df4f5}{array<ValueType>}}\&\ create\_workspace\_array(\textcolor{keywordtype}{int}\ array\_id,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ size)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00495\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00496\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ create\_or\_get\_array<ValueType>(array\_id,}
\DoxyCodeLine{00497\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ size);}
\DoxyCodeLine{00498\ \ \ \ \ \}}
\DoxyCodeLine{00499\ }
\DoxyCodeLine{00500\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00501\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae749a5ea11a93c1bcc9158d9a6e9fb68af1f713c9e000f5d3f280adbd124df4f5}{array<ValueType>}}\&\ create\_workspace\_array(\textcolor{keywordtype}{int}\ array\_id)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00502\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00503\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ workspace\_.template\ init\_or\_get\_array<ValueType>(array\_id);}
\DoxyCodeLine{00504\ \ \ \ \ \}}
\DoxyCodeLine{00505\ }
\DoxyCodeLine{00506\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00507\ \ \ \ \ \textcolor{keyword}{mutable}\ detail::workspace\ workspace\_;}
\DoxyCodeLine{00508\ }
\DoxyCodeLine{00509\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix\_;}
\DoxyCodeLine{00510\ \};}
\DoxyCodeLine{00511\ }
\DoxyCodeLine{00512\ }
\DoxyCodeLine{00513\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00514\ }
\DoxyCodeLine{00515\ }
\DoxyCodeLine{00516\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MatrixType>}
\DoxyCodeLine{00517\ \textcolor{keyword}{class}}
\DoxyCodeLine{00518\ \ \ \ \ \textcolor{comment}{//\ clang-\/format\ off}}
\DoxyCodeLine{00519\ \ \ \ \ GKO\_DEPRECATED(\textcolor{stringliteral}{"{}This\ class\ will\ be\ replaced\ by\ the\ template-\/less\ detail::SolverBaseLinOp\ in\ a\ future\ release"{}})\ \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase}{SolverBase}}}
\DoxyCodeLine{00520\ \ \ \ \ \textcolor{comment}{//\ clang-\/format\ on}}
\DoxyCodeLine{00521\ \ \ \ \ :\ public\ detail::SolverBaseLinOp\ \{}
\DoxyCodeLine{00522\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00523\ \ \ \ \ \textcolor{keyword}{using\ }detail::SolverBaseLinOp::SolverBaseLinOp;}
\DoxyCodeLine{00524\ }
\DoxyCodeLine{00532\ \ \ \ \ std::shared\_ptr<const\ MatrixType>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase_a2270916c6cb8451c275c0bca44c5d09e}{get\_system\_matrix}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00533\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00534\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::dynamic\_pointer\_cast<const\ MatrixType>(}
\DoxyCodeLine{00535\ \ \ \ \ \ \ \ \ \ \ \ \ SolverBaseLinOp::get\_system\_matrix());}
\DoxyCodeLine{00536\ \ \ \ \ \}}
\DoxyCodeLine{00537\ }
\DoxyCodeLine{00538\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00539\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_system\_matrix\_base(std::shared\_ptr<const\ MatrixType>\ system\_matrix)}
\DoxyCodeLine{00540\ \ \ \ \ \{}
\DoxyCodeLine{00541\ \ \ \ \ \ \ \ \ SolverBaseLinOp::set\_system\_matrix\_base(std::move(system\_matrix));}
\DoxyCodeLine{00542\ \ \ \ \ \}}
\DoxyCodeLine{00543\ \};}
\DoxyCodeLine{00544\ }
\DoxyCodeLine{00545\ }
\DoxyCodeLine{00555\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ DerivedType,\ \textcolor{keyword}{typename}\ MatrixType\ =\ LinOp>}
\DoxyCodeLine{00556\ \textcolor{keyword}{class\ }EnableSolverBase\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase}{SolverBase}}<MatrixType>\ \{}
\DoxyCodeLine{00557\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00562\ \ \ \ \ EnableSolverBase\&\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase_af1f141045be3695da012c21077f116eb}{operator=}}(\textcolor{keyword}{const}\ EnableSolverBase\&\ other)}
\DoxyCodeLine{00563\ \ \ \ \ \{}
\DoxyCodeLine{00564\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00565\ \ \ \ \ \ \ \ \ \ \ \ \ set\_system\_matrix(other.\doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase_a2270916c6cb8451c275c0bca44c5d09e}{get\_system\_matrix}}());}
\DoxyCodeLine{00566\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00567\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00568\ \ \ \ \ \}}
\DoxyCodeLine{00569\ }
\DoxyCodeLine{00574\ \ \ \ \ EnableSolverBase\&\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase_abc80ef6c16a11f9e03a0d79924b0e53b}{operator=}}(EnableSolverBase\&\&\ other)}
\DoxyCodeLine{00575\ \ \ \ \ \{}
\DoxyCodeLine{00576\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00577\ \ \ \ \ \ \ \ \ \ \ \ \ set\_system\_matrix(other.get\_system\_matrix());}
\DoxyCodeLine{00578\ \ \ \ \ \ \ \ \ \ \ \ \ other.set\_system\_matrix(\textcolor{keyword}{nullptr});}
\DoxyCodeLine{00579\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00580\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00581\ \ \ \ \ \}}
\DoxyCodeLine{00582\ }
\DoxyCodeLine{00583\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase}{EnableSolverBase}}()\ :\ \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase}{SolverBase}}<MatrixType>\{self()-\/>get\_executor()\}\ \{\}}
\DoxyCodeLine{00584\ }
\DoxyCodeLine{00585\ \ \ \ \ EnableSolverBase(std::shared\_ptr<const\ MatrixType>\ system\_matrix)}
\DoxyCodeLine{00586\ \ \ \ \ \ \ \ \ :\ SolverBase<MatrixType>\{self()-\/>get\_executor()\}}
\DoxyCodeLine{00587\ \ \ \ \ \{}
\DoxyCodeLine{00588\ \ \ \ \ \ \ \ \ set\_system\_matrix(std::move(system\_matrix));}
\DoxyCodeLine{00589\ \ \ \ \ \}}
\DoxyCodeLine{00590\ }
\DoxyCodeLine{00594\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase_a84dbd5a7e4099feeefbfe4d93a99c316}{EnableSolverBase}}(\textcolor{keyword}{const}\ EnableSolverBase\&\ other)}
\DoxyCodeLine{00595\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase}{SolverBase}}<MatrixType>\{other.self()-\/>get\_executor()\}}
\DoxyCodeLine{00596\ \ \ \ \ \{}
\DoxyCodeLine{00597\ \ \ \ \ \ \ \ \ *\textcolor{keyword}{this}\ =\ other;}
\DoxyCodeLine{00598\ \ \ \ \ \}}
\DoxyCodeLine{00599\ }
\DoxyCodeLine{00604\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase_a15d3d4df7a5a03ccc3a464957b3000b6}{EnableSolverBase}}(EnableSolverBase\&\&\ other)}
\DoxyCodeLine{00605\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase}{SolverBase}}<MatrixType>\{other.self()-\/>get\_executor()\}}
\DoxyCodeLine{00606\ \ \ \ \ \{}
\DoxyCodeLine{00607\ \ \ \ \ \ \ \ \ *\textcolor{keyword}{this}\ =\ std::move(other);}
\DoxyCodeLine{00608\ \ \ \ \ \}}
\DoxyCodeLine{00609\ }
\DoxyCodeLine{00610\ \ \ \ \ \textcolor{keywordtype}{int}\ get\_num\_workspace\_ops()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00611\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00612\ \ \ \ \ \ \ \ \ \textcolor{keyword}{using\ }traits\ =\ workspace\_traits<DerivedType>;}
\DoxyCodeLine{00613\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ traits::num\_vectors(*self());}
\DoxyCodeLine{00614\ \ \ \ \ \}}
\DoxyCodeLine{00615\ }
\DoxyCodeLine{00616\ \ \ \ \ std::vector<std::string>\ get\_workspace\_op\_names()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00617\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00618\ \ \ \ \ \ \ \ \ \textcolor{keyword}{using\ }traits\ =\ workspace\_traits<DerivedType>;}
\DoxyCodeLine{00619\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ traits::op\_names(*self());}
\DoxyCodeLine{00620\ \ \ \ \ \}}
\DoxyCodeLine{00621\ }
\DoxyCodeLine{00626\ \ \ \ \ std::vector<int>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase_a4ae6fc4edbee9f7fcd55ae5c4e31f78d}{get\_workspace\_scalars}}()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00627\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00628\ \ \ \ \ \ \ \ \ \textcolor{keyword}{using\ }traits\ =\ \doxymbox{\hyperlink{structgko_1_1solver_1_1workspace__traits}{workspace\_traits<DerivedType>}};}
\DoxyCodeLine{00629\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ traits::scalars(*self());}
\DoxyCodeLine{00630\ \ \ \ \ \}}
\DoxyCodeLine{00631\ }
\DoxyCodeLine{00636\ \ \ \ \ std::vector<int>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase_a15ef897496baad291b58484f8e93d945}{get\_workspace\_vectors}}()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00637\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00638\ \ \ \ \ \ \ \ \ \textcolor{keyword}{using\ }traits\ =\ \doxymbox{\hyperlink{structgko_1_1solver_1_1workspace__traits}{workspace\_traits<DerivedType>}};}
\DoxyCodeLine{00639\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ traits::vectors(*self());}
\DoxyCodeLine{00640\ \ \ \ \ \}}
\DoxyCodeLine{00641\ }
\DoxyCodeLine{00642\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00643\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_system\_matrix(std::shared\_ptr<const\ MatrixType>\ new\_system\_matrix)}
\DoxyCodeLine{00644\ \ \ \ \ \{}
\DoxyCodeLine{00645\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ self()-\/>get\_executor();}
\DoxyCodeLine{00646\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (new\_system\_matrix)\ \{}
\DoxyCodeLine{00647\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_ASSERT\_EQUAL\_DIMENSIONS(self(),\ new\_system\_matrix);}
\DoxyCodeLine{00648\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_ASSERT\_IS\_SQUARE\_MATRIX(new\_system\_matrix);}
\DoxyCodeLine{00649\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (new\_system\_matrix-\/>get\_executor()\ !=\ exec)\ \{}
\DoxyCodeLine{00650\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ new\_system\_matrix\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(exec,\ new\_system\_matrix);}
\DoxyCodeLine{00651\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00652\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00653\ \ \ \ \ \ \ \ \ this-\/>set\_system\_matrix\_base(new\_system\_matrix);}
\DoxyCodeLine{00654\ \ \ \ \ \}}
\DoxyCodeLine{00655\ }
\DoxyCodeLine{00656\ \ \ \ \ \textcolor{keywordtype}{void}\ setup\_workspace()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00657\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00658\ \ \ \ \ \ \ \ \ \textcolor{keyword}{using\ }traits\ =\ workspace\_traits<DerivedType>;}
\DoxyCodeLine{00659\ \ \ \ \ \ \ \ \ this-\/>set\_workspace\_size(traits::num\_vectors(*self()),}
\DoxyCodeLine{00660\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ traits::num\_arrays(*self()));}
\DoxyCodeLine{00661\ \ \ \ \ \}}
\DoxyCodeLine{00662\ }
\DoxyCodeLine{00663\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00664\ \ \ \ \ DerivedType*\ self()\ \{\ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}DerivedType*\textcolor{keyword}{>}(\textcolor{keyword}{this});\ \}}
\DoxyCodeLine{00665\ }
\DoxyCodeLine{00666\ \ \ \ \ \textcolor{keyword}{const}\ DerivedType*\ self()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00667\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00668\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}\textcolor{keyword}{const\ }DerivedType*\textcolor{keyword}{>}(\textcolor{keyword}{this});}
\DoxyCodeLine{00669\ \ \ \ \ \}}
\DoxyCodeLine{00670\ \};}
\DoxyCodeLine{00671\ }
\DoxyCodeLine{00672\ }
\DoxyCodeLine{00679\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase}{IterativeBase}}\ \{}
\DoxyCodeLine{00680\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00686\ \ \ \ \ std::shared\_ptr<const\ stop::CriterionFactory>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase_a26beb5ec985d883c22b614a8240d981d}{get\_stop\_criterion\_factory}}()\textcolor{keyword}{}}
\DoxyCodeLine{00687\ \textcolor{keyword}{\ \ \ \ \ \ \ \ const}}
\DoxyCodeLine{00688\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00689\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ stop\_factory\_;}
\DoxyCodeLine{00690\ \ \ \ \ \}}
\DoxyCodeLine{00691\ }
\DoxyCodeLine{00697\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase_ab6a8b1418209a1db64c3d4270fe4549c}{set\_stop\_criterion\_factory}}(}
\DoxyCodeLine{00698\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ stop::CriterionFactory>\ new\_stop\_factory)}
\DoxyCodeLine{00699\ \ \ \ \ \{}
\DoxyCodeLine{00700\ \ \ \ \ \ \ \ \ stop\_factory\_\ =\ new\_stop\_factory;}
\DoxyCodeLine{00701\ \ \ \ \ \}}
\DoxyCodeLine{00702\ }
\DoxyCodeLine{00703\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00704\ \ \ \ \ std::shared\_ptr<const\ stop::CriterionFactory>\ stop\_factory\_;}
\DoxyCodeLine{00705\ \};}
\DoxyCodeLine{00706\ }
\DoxyCodeLine{00707\ }
\DoxyCodeLine{00717\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ DerivedType>}
\DoxyCodeLine{00718\ \textcolor{keyword}{class\ }EnableIterativeBase\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase}{IterativeBase}}\ \{}
\DoxyCodeLine{00719\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00724\ \ \ \ \ EnableIterativeBase\&\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_aeeaf3c167ee6295be331e3383502ebf3}{operator=}}(\textcolor{keyword}{const}\ EnableIterativeBase\&\ other)}
\DoxyCodeLine{00725\ \ \ \ \ \{}
\DoxyCodeLine{00726\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00727\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_a5e96a31681a2bc03fffb2d76e7a7da12}{set\_stop\_criterion\_factory}}(other.\doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase_a26beb5ec985d883c22b614a8240d981d}{get\_stop\_criterion\_factory}}());}
\DoxyCodeLine{00728\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00729\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00730\ \ \ \ \ \}}
\DoxyCodeLine{00731\ }
\DoxyCodeLine{00737\ \ \ \ \ EnableIterativeBase\&\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_a196071d7a56d7d20c2560d5060b78c4b}{operator=}}(EnableIterativeBase\&\&\ other)}
\DoxyCodeLine{00738\ \ \ \ \ \{}
\DoxyCodeLine{00739\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\&other\ !=\ \textcolor{keyword}{this})\ \{}
\DoxyCodeLine{00740\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_a5e96a31681a2bc03fffb2d76e7a7da12}{set\_stop\_criterion\_factory}}(other.get\_stop\_criterion\_factory());}
\DoxyCodeLine{00741\ \ \ \ \ \ \ \ \ \ \ \ \ other.set\_stop\_criterion\_factory(\textcolor{keyword}{nullptr});}
\DoxyCodeLine{00742\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00743\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00744\ \ \ \ \ \}}
\DoxyCodeLine{00745\ }
\DoxyCodeLine{00746\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase}{EnableIterativeBase}}()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00747\ }
\DoxyCodeLine{00748\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase}{EnableIterativeBase}}(}
\DoxyCodeLine{00749\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ stop::CriterionFactory>\ stop\_factory)}
\DoxyCodeLine{00750\ \ \ \ \ \{}
\DoxyCodeLine{00751\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_a5e96a31681a2bc03fffb2d76e7a7da12}{set\_stop\_criterion\_factory}}(std::move(stop\_factory));}
\DoxyCodeLine{00752\ \ \ \ \ \}}
\DoxyCodeLine{00753\ }
\DoxyCodeLine{00757\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_ade3ade47117405b03988e92178be5071}{EnableIterativeBase}}(\textcolor{keyword}{const}\ EnableIterativeBase\&\ other)\ \{\ *\textcolor{keyword}{this}\ =\ other;\ \}}
\DoxyCodeLine{00758\ }
\DoxyCodeLine{00763\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_a9e626f29623fe0c217e86b52d9e66010}{EnableIterativeBase}}(EnableIterativeBase\&\&\ other)}
\DoxyCodeLine{00764\ \ \ \ \ \{}
\DoxyCodeLine{00765\ \ \ \ \ \ \ \ \ *\textcolor{keyword}{this}\ =\ std::move(other);}
\DoxyCodeLine{00766\ \ \ \ \ \}}
\DoxyCodeLine{00767\ }
\DoxyCodeLine{00768\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_a5e96a31681a2bc03fffb2d76e7a7da12}{set\_stop\_criterion\_factory}}(}
\DoxyCodeLine{00769\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ stop::CriterionFactory>\ new\_stop\_factory)\textcolor{keyword}{\ override}}
\DoxyCodeLine{00770\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00771\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ self()-\/>get\_executor();}
\DoxyCodeLine{00772\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (new\_stop\_factory\ \&\&\ new\_stop\_factory-\/>get\_executor()\ !=\ exec)\ \{}
\DoxyCodeLine{00773\ \ \ \ \ \ \ \ \ \ \ \ \ new\_stop\_factory\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(exec,\ new\_stop\_factory);}
\DoxyCodeLine{00774\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00775\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase_ab6a8b1418209a1db64c3d4270fe4549c}{IterativeBase::set\_stop\_criterion\_factory}}(new\_stop\_factory);}
\DoxyCodeLine{00776\ \ \ \ \ \}}
\DoxyCodeLine{00777\ }
\DoxyCodeLine{00778\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00779\ \ \ \ \ DerivedType*\ self()\ \{\ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}DerivedType*\textcolor{keyword}{>}(\textcolor{keyword}{this});\ \}}
\DoxyCodeLine{00780\ }
\DoxyCodeLine{00781\ \ \ \ \ \textcolor{keyword}{const}\ DerivedType*\ self()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00782\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00783\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}\textcolor{keyword}{const\ }DerivedType*\textcolor{keyword}{>}(\textcolor{keyword}{this});}
\DoxyCodeLine{00784\ \ \ \ \ \}}
\DoxyCodeLine{00785\ \};}
\DoxyCodeLine{00786\ }
\DoxyCodeLine{00787\ }
\DoxyCodeLine{00798\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType,\ \textcolor{keyword}{typename}\ DerivedType>}
\DoxyCodeLine{00799\ \textcolor{keyword}{class\ }EnablePreconditionedIterativeSolver}
\DoxyCodeLine{00800\ \ \ \ \ :\ \textcolor{keyword}{public}\ EnableSolverBase<DerivedType>,}
\DoxyCodeLine{00801\ \ \ \ \ \ \ \textcolor{keyword}{public}\ EnableIterativeBase<DerivedType>,}
\DoxyCodeLine{00802\ \ \ \ \ \ \ \textcolor{keyword}{public}\ EnablePreconditionable<DerivedType>\ \{}
\DoxyCodeLine{00803\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00804\ \ \ \ \ EnablePreconditionedIterativeSolver()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00805\ }
\DoxyCodeLine{00806\ \ \ \ \ EnablePreconditionedIterativeSolver(}
\DoxyCodeLine{00807\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix,}
\DoxyCodeLine{00808\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ stop::CriterionFactory>\ stop\_factory,}
\DoxyCodeLine{00809\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ \doxymbox{\hyperlink{namespacegko_1_1preconditioner}{preconditioner}})}
\DoxyCodeLine{00810\ \ \ \ \ \ \ \ \ :\ EnableSolverBase<DerivedType>(std::move(system\_matrix)),}
\DoxyCodeLine{00811\ \ \ \ \ \ \ \ \ \ \ EnableIterativeBase<DerivedType>\{std::move(stop\_factory)\},}
\DoxyCodeLine{00812\ \ \ \ \ \ \ \ \ \ \ EnablePreconditionable<DerivedType>\{std::move(\doxymbox{\hyperlink{namespacegko_1_1preconditioner}{preconditioner}})\}}
\DoxyCodeLine{00813\ \ \ \ \ \{\}}
\DoxyCodeLine{00814\ }
\DoxyCodeLine{00815\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ FactoryParameters>}
\DoxyCodeLine{00816\ \ \ \ \ EnablePreconditionedIterativeSolver(}
\DoxyCodeLine{00817\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix,}
\DoxyCodeLine{00818\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ FactoryParameters\&\ params)}
\DoxyCodeLine{00819\ \ \ \ \ \ \ \ \ :\ EnablePreconditionedIterativeSolver\{}
\DoxyCodeLine{00820\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ system\_matrix,\ \doxymbox{\hyperlink{group__stop_ga934dd0c4603a3e815c767f7628163d7e}{stop::combine}}(params.criteria),}
\DoxyCodeLine{00821\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ generate\_preconditioner(system\_matrix,\ params)\}}
\DoxyCodeLine{00822\ \ \ \ \ \{\}}
\DoxyCodeLine{00823\ }
\DoxyCodeLine{00824\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00825\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ FactoryParameters>}
\DoxyCodeLine{00826\ \ \ \ \ \textcolor{keyword}{static}\ std::shared\_ptr<const\ LinOp>\ generate\_preconditioner(}
\DoxyCodeLine{00827\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix,}
\DoxyCodeLine{00828\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ FactoryParameters\&\ params)}
\DoxyCodeLine{00829\ \ \ \ \ \{}
\DoxyCodeLine{00830\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (params.generated\_preconditioner)\ \{}
\DoxyCodeLine{00831\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ params.generated\_preconditioner;}
\DoxyCodeLine{00832\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (params.preconditioner)\ \{}
\DoxyCodeLine{00833\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ params.preconditioner-\/>generate(system\_matrix);}
\DoxyCodeLine{00834\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00835\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity_a55417b971157946c8f5f4f8d30b11aba}{matrix::Identity<ValueType>::create}}(}
\DoxyCodeLine{00836\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ system\_matrix-\/>get\_executor(),\ system\_matrix-\/>get\_size());}
\DoxyCodeLine{00837\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00838\ \ \ \ \ \}}
\DoxyCodeLine{00839\ \};}
\DoxyCodeLine{00840\ }
\DoxyCodeLine{00841\ }
\DoxyCodeLine{00842\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Parameters,\ \textcolor{keyword}{typename}\ Factory>}
\DoxyCodeLine{00843\ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1enable__iterative__solver__factory__parameters}{enable\_iterative\_solver\_factory\_parameters}}}
\DoxyCodeLine{00844\ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1enable__parameters__type}{enable\_parameters\_type}}<Parameters,\ Factory>\ \{}
\DoxyCodeLine{00848\ \ \ \ \ std::vector<std::shared\_ptr<const\ stop::CriterionFactory>>}
\DoxyCodeLine{00849\ \ \ \ \ \ \ \ \ GKO\_DEFERRED\_FACTORY\_VECTOR\_PARAMETER(\doxymbox{\hyperlink{structgko_1_1solver_1_1enable__iterative__solver__factory__parameters_abe513c2c98260f55c5d529dce00224be}{criteria}});}
\DoxyCodeLine{00850\ \};}
\DoxyCodeLine{00851\ }
\DoxyCodeLine{00852\ }
\DoxyCodeLine{00853\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Parameters,\ \textcolor{keyword}{typename}\ Factory>}
\DoxyCodeLine{00854\ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1enable__preconditioned__iterative__solver__factory__parameters}{enable\_preconditioned\_iterative\_solver\_factory\_parameters}}}
\DoxyCodeLine{00855\ \ \ \ \ :\ \doxymbox{\hyperlink{structgko_1_1solver_1_1enable__iterative__solver__factory__parameters}{enable\_iterative\_solver\_factory\_parameters}}<Parameters,\ Factory>\ \{}
\DoxyCodeLine{00860\ \ \ \ \ std::shared\_ptr<const\ LinOpFactory>\ GKO\_DEFERRED\_FACTORY\_PARAMETER(}
\DoxyCodeLine{00861\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1solver_1_1enable__preconditioned__iterative__solver__factory__parameters_abc270279ce305336c15515e385d207a1}{preconditioner}});}
\DoxyCodeLine{00862\ }
\DoxyCodeLine{00867\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(}
\DoxyCodeLine{00868\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1solver_1_1enable__preconditioned__iterative__solver__factory__parameters_a7765c24219826716fd9be54b9a068f2e}{generated\_preconditioner}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00869\ \};}
\DoxyCodeLine{00870\ }
\DoxyCodeLine{00871\ }
\DoxyCodeLine{00872\ \}\ \ \textcolor{comment}{//\ namespace\ solver}}
\DoxyCodeLine{00873\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00874\ }
\DoxyCodeLine{00875\ }
\DoxyCodeLine{00876\ GKO\_END\_DISABLE\_DEPRECATION\_WARNINGS}
\DoxyCodeLine{00877\ }
\DoxyCodeLine{00878\ }
\DoxyCodeLine{00879\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_SOLVER\_SOLVER\_BASE\_HPP\_}}

\end{DoxyCode}
