\doxysection{ir.\+hpp}
\hypertarget{ir_8hpp_source}{}\label{ir_8hpp_source}\index{ginkgo/core/solver/ir.hpp@{ginkgo/core/solver/ir.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\_IR\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_SOLVER\_IR\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/exception\_helpers.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/config.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/registry.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/dense.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/identity.hpp>}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#include\ <ginkgo/core/solver/solver\_base.hpp>}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/combined.hpp>}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/criterion.hpp>}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/iteration.hpp>}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00025\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1solver}{solver}}\ \{}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00080\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00081\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}\ :\ \textcolor{keyword}{public}\ EnableLinOp<Ir<ValueType>>,}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase}{EnableSolverBase}}<Ir<ValueType>>,}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase}{EnableIterativeBase}}<Ir<ValueType>>,}
\DoxyCodeLine{00084\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableApplyWithInitialGuess}{EnableApplyWithInitialGuess}}<Ir<ValueType>>,}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ Transposable\ \{}
\DoxyCodeLine{00086\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }EnableLinOp<\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}>;}
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }EnablePolymorphicObject<\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}},\ LinOp>;}
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }EnableApplyWithInitialGuess<\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}>;}
\DoxyCodeLine{00089\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_TYPE;}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00092\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00093\ \ \ \ \ \textcolor{keyword}{using\ }transposed\_type\ =\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir<ValueType>}};}
\DoxyCodeLine{00094\ }
\DoxyCodeLine{00095\ \ \ \ \ std::unique\_ptr<LinOp>\ \doxymbox{\hyperlink{namespacegko_aacad7f87b38d3f26674ed034d442a1a0}{transpose}}()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00097\ \ \ \ \ std::unique\_ptr<LinOp>\ conj\_transpose()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00104\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga92a31864b7c45b24d228a35a8a090b83}{apply\_uses\_initial\_guess}}()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00105\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>get\_default\_initial\_guess()\ ==}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa1f5f6080965ed6d0a90e6b9ec599e441}{initial\_guess\_mode::provided}};}
\DoxyCodeLine{00108\ \ \ \ \ \}}
\DoxyCodeLine{00109\ }
\DoxyCodeLine{00115\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ \doxymbox{\hyperlink{namespacegko_1_1solver_aeca59c548688fc75b0aa2b259390fb3b}{get\_solver}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ solver\_;\ \}}
\DoxyCodeLine{00116\ }
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a5aded6d72b7e8360b700550820177ac2}{set\_solver}}(std::shared\_ptr<const\ LinOp>\ new\_solver);}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00130\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}\&\ \doxymbox{\hyperlink{namespacegko_1_1solver_ae5760acd16e9a702da395d689f237b33}{operator=}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}\&);}
\DoxyCodeLine{00131\ }
\DoxyCodeLine{00139\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}\&\ \doxymbox{\hyperlink{namespacegko_1_1solver_ae5760acd16e9a702da395d689f237b33}{operator=}}(\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}\&\&);}
\DoxyCodeLine{00140\ }
\DoxyCodeLine{00145\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}\&);}
\DoxyCodeLine{00146\ }
\DoxyCodeLine{00152\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}(\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}\&\&);}
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00154\ \ \ \ \ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1solver_1_1Factory}{Factory}};}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ \ \ \ \ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type}{parameters\_type}}}
\DoxyCodeLine{00157\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{structgko_1_1solver_1_1enable__iterative__solver__factory__parameters}{enable\_iterative\_solver\_factory\_parameters}}<parameters\_type,\ Factory>\ \{}
\DoxyCodeLine{00161\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOpFactory>\ GKO\_DEFERRED\_FACTORY\_PARAMETER(}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_ab435ae5dc85ac06cf552f839866823ea}{solver}});}
\DoxyCodeLine{00163\ }
\DoxyCodeLine{00168\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(}
\DoxyCodeLine{00169\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_a57a0aa04756adc0d2335b609409ca9b2}{generated\_solver}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00170\ }
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ ValueType\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_a8d0105656174e1f1934ccecc5839bd5a}{relaxation\_factor}},}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ value\_type\{1\});}
\DoxyCodeLine{00176\ }
\DoxyCodeLine{00181\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(}
\DoxyCodeLine{00182\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_a7a56369b741490e04c129ed2f032c36a}{default\_initial\_guess}},\ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa1f5f6080965ed6d0a90e6b9ec599e441}{initial\_guess\_mode::provided}});}
\DoxyCodeLine{00183\ \ \ \ \ \};}
\DoxyCodeLine{00184\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}},\ parameters,\ Factory);}
\DoxyCodeLine{00185\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00186\ }
\DoxyCodeLine{00200\ \ \ \ \ \textcolor{keyword}{static}\ parameters\_type\ parse(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode}{config::pnode}}\&\ config,}
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1registry}{config::registry}}\&\ context,}
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::type\_descriptor}}\&\ td\_for\_child\ =}
\DoxyCodeLine{00203\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ config::make\_type\_descriptor<ValueType>());}
\DoxyCodeLine{00204\ }
\DoxyCodeLine{00205\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00206\ \ \ \ \ \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{00207\ }
\DoxyCodeLine{00208\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ VectorType>}
\DoxyCodeLine{00209\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_dense\_impl(\textcolor{keyword}{const}\ VectorType*\ b,\ VectorType*\ x,}
\DoxyCodeLine{00210\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00211\ }
\DoxyCodeLine{00212\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\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,}
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00214\ }
\DoxyCodeLine{00215\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00216\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00217\ }
\DoxyCodeLine{00218\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ alpha,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,}
\DoxyCodeLine{00219\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ beta,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00220\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00221\ }
\DoxyCodeLine{00222\ \ \ \ \ \textcolor{keywordtype}{void}\ set\_relaxation\_factor(}
\DoxyCodeLine{00223\ \ \ \ \ \ \ \ \ std::shared\_ptr<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<ValueType>}}>\ new\_factor);}
\DoxyCodeLine{00224\ }
\DoxyCodeLine{00225\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}(std::shared\_ptr<const\ Executor>\ exec)}
\DoxyCodeLine{00226\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}>(\doxymbox{\hyperlink{namespacestd}{std}}::move(exec))}
\DoxyCodeLine{00227\ \ \ \ \ \{\}}
\DoxyCodeLine{00228\ }
\DoxyCodeLine{00229\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Factory}{Factory}}*\ factory,}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix)}
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}>(factory-\/>get\_executor(),}
\DoxyCodeLine{00232\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko}{gko}}::\doxymbox{\hyperlink{namespacegko_aacad7f87b38d3f26674ed034d442a1a0}{transpose}}(system\_matrix-\/>get\_size())),}
\DoxyCodeLine{00233\ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase}{EnableSolverBase}}<\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}>\{std::move(system\_matrix)\},}
\DoxyCodeLine{00234\ \ \ \ \ \ \ \ \ \ \ EnableIterativeBase<Ir>\{}
\DoxyCodeLine{00235\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__stop_ga934dd0c4603a3e815c767f7628163d7e}{stop::combine}}(factory-\/>get\_parameters().criteria)\},}
\DoxyCodeLine{00236\ \ \ \ \ \ \ \ \ \ \ parameters\_\{factory-\/>get\_parameters()\}}
\DoxyCodeLine{00237\ \ \ \ \ \{}
\DoxyCodeLine{00238\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (parameters\_.\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_a57a0aa04756adc0d2335b609409ca9b2}{generated\_solver}})\ \{}
\DoxyCodeLine{00239\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{namespacegko_1_1solver_a5aded6d72b7e8360b700550820177ac2}{set\_solver}}(parameters\_.\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_a57a0aa04756adc0d2335b609409ca9b2}{generated\_solver}});}
\DoxyCodeLine{00240\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (parameters\_.\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_ab435ae5dc85ac06cf552f839866823ea}{solver}})\ \{}
\DoxyCodeLine{00241\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{namespacegko_1_1solver_a5aded6d72b7e8360b700550820177ac2}{set\_solver}}(}
\DoxyCodeLine{00242\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ parameters\_.\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_ab435ae5dc85ac06cf552f839866823ea}{solver}}-\/>generate(this-\/>get\_system\_matrix()));}
\DoxyCodeLine{00243\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00244\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>\doxymbox{\hyperlink{namespacegko_1_1solver_a5aded6d72b7e8360b700550820177ac2}{set\_solver}}(\doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity_a55417b971157946c8f5f4f8d30b11aba}{matrix::Identity<ValueType>::create}}(}
\DoxyCodeLine{00245\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>get\_executor(),\ this-\/>get\_size()[0]));}
\DoxyCodeLine{00246\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00247\ \ \ \ \ \ \ \ \ this-\/>set\_default\_initial\_guess(parameters\_.\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_a7a56369b741490e04c129ed2f032c36a}{default\_initial\_guess}});}
\DoxyCodeLine{00248\ \ \ \ \ \ \ \ \ relaxation\_factor\_\ =\ \doxymbox{\hyperlink{group__LinOp_ga70851b4c3c9b01bb667b3a8e438fb6d2}{gko::initialize<matrix::Dense<ValueType>}}>(}
\DoxyCodeLine{00249\ \ \ \ \ \ \ \ \ \ \ \ \ \{parameters\_.\doxymbox{\hyperlink{structgko_1_1solver_1_1parameters__type_a8d0105656174e1f1934ccecc5839bd5a}{relaxation\_factor}}\},\ this-\/>get\_executor());}
\DoxyCodeLine{00250\ \ \ \ \ \}}
\DoxyCodeLine{00251\ }
\DoxyCodeLine{00252\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00253\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ solver\_\{\};}
\DoxyCodeLine{00254\ \ \ \ \ std::shared\_ptr<const\ matrix::Dense<ValueType>>\ relaxation\_factor\_\{\};}
\DoxyCodeLine{00255\ \};}
\DoxyCodeLine{00256\ }
\DoxyCodeLine{00257\ }
\DoxyCodeLine{00258\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00259\ \textcolor{keyword}{using\ }Richardson\ =\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir<ValueType>}};}
\DoxyCodeLine{00260\ }
\DoxyCodeLine{00261\ }
\DoxyCodeLine{00262\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00263\ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1workspace__traits}{workspace\_traits}}<\doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir}}<ValueType>>\ \{}
\DoxyCodeLine{00264\ \ \ \ \ \textcolor{keyword}{using\ }Solver\ =\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir<ValueType>}};}
\DoxyCodeLine{00265\ \ \ \ \ \textcolor{comment}{//\ number\ of\ vectors\ used\ by\ this\ workspace}}
\DoxyCodeLine{00266\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_vectors(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00267\ \ \ \ \ \textcolor{comment}{//\ number\ of\ arrays\ used\ by\ this\ workspace}}
\DoxyCodeLine{00268\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_arrays(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00269\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_vectors\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00270\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ op\_names(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00271\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_arrays\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00272\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ array\_names(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00273\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ varying\ scalar\ vectors\ (independent\ of\ problem\ size)}}
\DoxyCodeLine{00274\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ scalars(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00275\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ varying\ vectors\ (dependent\ on\ problem\ size)}}
\DoxyCodeLine{00276\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ vectors(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00277\ }
\DoxyCodeLine{00278\ \ \ \ \ \textcolor{comment}{//\ residual\ vector}}
\DoxyCodeLine{00279\ \ \ \ \ \textcolor{keyword}{constexpr}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ residual\ =\ 0;}
\DoxyCodeLine{00280\ \ \ \ \ \textcolor{comment}{//\ inner\ solution\ vector}}
\DoxyCodeLine{00281\ \ \ \ \ \textcolor{keyword}{constexpr}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ inner\_solution\ =\ 1;}
\DoxyCodeLine{00282\ \ \ \ \ \textcolor{comment}{//\ constant\ 1.0\ scalar}}
\DoxyCodeLine{00283\ \ \ \ \ \textcolor{keyword}{constexpr}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ \doxymbox{\hyperlink{namespacegko_a0059e27f8f4bc348ff65c1e60caf47c8}{one}}\ =\ 2;}
\DoxyCodeLine{00284\ \ \ \ \ \textcolor{comment}{//\ constant\ -\/1.0\ scalar}}
\DoxyCodeLine{00285\ \ \ \ \ \textcolor{keyword}{constexpr}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ minus\_one\ =\ 3;}
\DoxyCodeLine{00286\ }
\DoxyCodeLine{00287\ \ \ \ \ \textcolor{comment}{//\ stopping\ status\ array}}
\DoxyCodeLine{00288\ \ \ \ \ \textcolor{keyword}{constexpr}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ stop\ =\ 0;}
\DoxyCodeLine{00289\ \};}
\DoxyCodeLine{00290\ }
\DoxyCodeLine{00291\ }
\DoxyCodeLine{00302\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00303\ \textcolor{keyword}{auto}\ build\_smoother(std::shared\_ptr<const\ LinOpFactory>\ factory,}
\DoxyCodeLine{00304\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ iteration\ =\ 1,\ ValueType\ relaxation\_factor\ =\ 0.9)}
\DoxyCodeLine{00305\ \{}
\DoxyCodeLine{00306\ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>get\_executor();}
\DoxyCodeLine{00307\ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir<ValueType>::build}}()}
\DoxyCodeLine{00308\ \ \ \ \ \ \ \ \ .with\_solver(factory)}
\DoxyCodeLine{00309\ \ \ \ \ \ \ \ \ .with\_relaxation\_factor(relaxation\_factor)}
\DoxyCodeLine{00310\ \ \ \ \ \ \ \ \ .with\_criteria(gko::stop::Iteration::build().with\_max\_iters(iteration))}
\DoxyCodeLine{00311\ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{00312\ \}}
\DoxyCodeLine{00313\ }
\DoxyCodeLine{00326\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00327\ \textcolor{keyword}{auto}\ build\_smoother(std::shared\_ptr<const\ LinOp>\ solver,}
\DoxyCodeLine{00328\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ iteration\ =\ 1,\ ValueType\ relaxation\_factor\ =\ 0.9)}
\DoxyCodeLine{00329\ \{}
\DoxyCodeLine{00330\ \ \ \ \ \textcolor{keyword}{auto}\ exec\ =\ \doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a7cbf673200498a0d1324f4330825202a}{solver}}-\/>get\_executor();}
\DoxyCodeLine{00331\ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{namespacegko_1_1solver_a1dac6a1b61c52db896845967e899aef0}{Ir<ValueType>::build}}()}
\DoxyCodeLine{00332\ \ \ \ \ \ \ \ \ .with\_generated\_solver(solver)}
\DoxyCodeLine{00333\ \ \ \ \ \ \ \ \ .with\_relaxation\_factor(relaxation\_factor)}
\DoxyCodeLine{00334\ \ \ \ \ \ \ \ \ .with\_criteria(gko::stop::Iteration::build().with\_max\_iters(iteration))}
\DoxyCodeLine{00335\ \ \ \ \ \ \ \ \ .on(exec);}
\DoxyCodeLine{00336\ \}}
\DoxyCodeLine{00337\ }
\DoxyCodeLine{00338\ }
\DoxyCodeLine{00339\ \}\ \ \textcolor{comment}{//\ namespace\ solver}}
\DoxyCodeLine{00340\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00341\ }
\DoxyCodeLine{00342\ }
\DoxyCodeLine{00343\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_SOLVER\_IR\_HPP\_}}

\end{DoxyCode}
