\doxysection{direct.\+hpp}
\hypertarget{direct_8hpp_source}{}\label{direct_8hpp_source}\index{ginkgo/core/solver/direct.hpp@{ginkgo/core/solver/direct.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\_DIRECT\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_SOLVER\_DIRECT\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/config.hpp>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/registry.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/factorization/factorization.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/solver/solver\_base.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/solver/triangular.hpp>}}
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00018\ \textcolor{keyword}{namespace\ }experimental\ \{}
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }solver\ \{}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00032\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType,\ \textcolor{keyword}{typename}\ IndexType>}
\DoxyCodeLine{00033\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<Direct<ValueType,\ IndexType>>,}
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase}{gko::solver::EnableSolverBase}}<}
\DoxyCodeLine{00035\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Direct<ValueType,\ IndexType>,}
\DoxyCodeLine{00036\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ factorization::Factorization<ValueType,\ IndexType>>,}
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1Transposable}{Transposable}}\ \{}
\DoxyCodeLine{00038\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<\doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}},\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}>;}
\DoxyCodeLine{00039\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_AND\_INDEX\_TYPE;}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00041\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00043\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keyword}{using\ }factorization\_type\ =}
\DoxyCodeLine{00045\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization}{factorization::Factorization<value\_type,\ index\_type>}};}
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keyword}{using\ }transposed\_type\ =\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}};}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ \ \ \ \ std::unique\_ptr<LinOp>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a2aefcc7d7179764a2c74b5960e940ca6}{transpose}}()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00050\ \ \ \ \ std::unique\_ptr<LinOp>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1e16204dc058f4615d8e269a9cb3f4d8}{conj\_transpose}}()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_1_1Factory}{Factory}};}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1experimental_1_1solver_1_1Direct_1_1parameters__type}{parameters\_type}}\ :\ \doxymbox{\hyperlink{classgko_1_1enable__parameters__type}{enable\_parameters\_type}}<parameters\_type,\ Factory>\ \{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{gko::size\_type}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1experimental_1_1solver_1_1Direct_1_1parameters__type_afe20b9ec2cab681fb4cbd6f230f76837}{num\_rhs}},\ 1u);}
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00065\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOpFactory>\ GKO\_DEFERRED\_FACTORY\_PARAMETER(}
\DoxyCodeLine{00066\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1experimental_1_1solver_1_1Direct_1_1parameters__type_a4e4047dbf4bedb001c729542c55dabb6}{factorization}});}
\DoxyCodeLine{00067\ \ \ \ \ \};}
\DoxyCodeLine{00068\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(\doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}},\ parameters,\ Factory);}
\DoxyCodeLine{00069\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00070\ }
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keyword}{static}\ \doxymbox{\hyperlink{structgko_1_1experimental_1_1solver_1_1Direct_1_1parameters__type}{parameters\_type}}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a3e0ba0a7411bd6b6241bcb401734b497}{parse}}(}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \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{00086\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::type\_descriptor}}\&\ td\_for\_child\ =}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \ \ \ \ config::make\_type\_descriptor<ValueType,\ IndexType>());}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00090\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}\&);}
\DoxyCodeLine{00091\ }
\DoxyCodeLine{00093\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_aac5efb2d94b1f32a900a2fe2f67caa2e}{Direct}}(\doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}\&\&);}
\DoxyCodeLine{00094\ }
\DoxyCodeLine{00095\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}\&\ operator=(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}\&);}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00097\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}\&\ operator=(\doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}\&\&);}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00099\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00100\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}(std::shared\_ptr<const\ Executor>\ exec);}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00102\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_a1a58ea893f217dbcd32b4a631255a903}{Direct}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct_1_1Factory}{Factory}}*\ factory,\ std::shared\_ptr<const\ LinOp>\ system\_matrix);}
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00104\ \ \ \ \ \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{00105\ }
\DoxyCodeLine{00106\ \ \ \ \ \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{00107\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00109\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00110\ \ \ \ \ \textcolor{keyword}{using\ }lower\_type\ =\ \doxymbox{\hyperlink{classgko_1_1solver_1_1LowerTrs}{gko::solver::LowerTrs<value\_type,\ index\_type>}};}
\DoxyCodeLine{00111\ \ \ \ \ \textcolor{keyword}{using\ }upper\_type\ =\ \doxymbox{\hyperlink{classgko_1_1solver_1_1UpperTrs}{gko::solver::UpperTrs<value\_type,\ index\_type>}};}
\DoxyCodeLine{00112\ }
\DoxyCodeLine{00113\ \ \ \ \ std::unique\_ptr<lower\_type>\ lower\_solver\_;}
\DoxyCodeLine{00114\ \ \ \ \ std::unique\_ptr<upper\_type>\ upper\_solver\_;}
\DoxyCodeLine{00115\ \};}
\DoxyCodeLine{00116\ }
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00118\ \}\ \ \textcolor{comment}{//\ namespace\ solver}}
\DoxyCodeLine{00119\ \}\ \ \textcolor{comment}{//\ namespace\ experimental}}
\DoxyCodeLine{00120\ }
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00122\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1solver}{solver}}\ \{}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00125\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType,\ \textcolor{keyword}{typename}\ IndexType>}
\DoxyCodeLine{00126\ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1workspace__traits}{workspace\_traits}}<}
\DoxyCodeLine{00127\ \ \ \ \ \doxymbox{\hyperlink{namespacegko}{gko}}::\doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct}{experimental::solver::Direct}}<ValueType,\ IndexType>>\ \{}
\DoxyCodeLine{00128\ \ \ \ \ \textcolor{keyword}{using\ }Solver\ =\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1solver_1_1Direct}{gko::experimental::solver::Direct<ValueType,\ IndexType>}};}
\DoxyCodeLine{00129\ \ \ \ \ \textcolor{comment}{//\ number\ of\ vectors\ used\ by\ this\ workspace}}
\DoxyCodeLine{00130\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_vectors(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00131\ \ \ \ \ \textcolor{comment}{//\ number\ of\ arrays\ used\ by\ this\ workspace}}
\DoxyCodeLine{00132\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_arrays(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00133\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_vectors\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00134\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ op\_names(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00135\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_arrays\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00136\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ array\_names(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00137\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ varying\ scalar\ vectors\ (independent\ of\ problem\ size)}}
\DoxyCodeLine{00138\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ scalars(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00139\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ varying\ vectors\ (dependent\ on\ problem\ size)}}
\DoxyCodeLine{00140\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ vectors(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00142\ \ \ \ \ \textcolor{comment}{//\ intermediate\ vector}}
\DoxyCodeLine{00143\ \ \ \ \ \textcolor{keyword}{constexpr}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ intermediate\ =\ 0;}
\DoxyCodeLine{00144\ \};}
\DoxyCodeLine{00145\ }
\DoxyCodeLine{00146\ }
\DoxyCodeLine{00147\ \}\ \ \textcolor{comment}{//\ namespace\ solver}}
\DoxyCodeLine{00148\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_SOLVER\_DIRECT\_HPP\_}}

\end{DoxyCode}
