\doxysection{factorization.\+hpp}
\hypertarget{factorization_8hpp_source}{}\label{factorization_8hpp_source}\index{ginkgo/core/factorization/factorization.hpp@{ginkgo/core/factorization/factorization.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\_FACTORIZATION\_FACTORIZATION\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_FACTORIZATION\_FACTORIZATION\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/composition.hpp>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/csr.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/diagonal.hpp>}}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00016\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00017\ \textcolor{keyword}{namespace\ }experimental\ \{}
\DoxyCodeLine{00018\ \textcolor{keyword}{namespace\ }factorization\ \{}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00025\ \textcolor{keyword}{enum\ class}\ storage\_type\ \{}
\DoxyCodeLine{00027\ \ \ \ \ empty,}
\DoxyCodeLine{00032\ \ \ \ \ composition,}
\DoxyCodeLine{00033\ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ \ \ \ \ *\ The\ two\ factors\ are\ stored\ as\ a\ single\ matrix\ containing\ L\ +\ U\ -\/\ I,\ where}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ \ \ \ \ *\ L\ has\ an\ implicit\ unit\ diagonal.}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{00037\ \ \ \ \ combined\_lu,}
\DoxyCodeLine{00038\ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00039\ \textcolor{comment}{\ \ \ \ \ *\ The\ factorization\ L\ *\ D\ *\ U\ is\ stored\ as\ L\ +\ D\ +\ U\ -\/\ 2I,\ where}}
\DoxyCodeLine{00040\ \textcolor{comment}{\ \ \ \ \ *\ L\ and\ U\ have\ implicit\ unit\ diagonals.}}
\DoxyCodeLine{00041\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{00042\ \ \ \ \ combined\_ldu,}
\DoxyCodeLine{00047\ \ \ \ \ symm\_composition,}
\DoxyCodeLine{00048\ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00049\ \textcolor{comment}{\ \ \ \ \ *\ The\ factorization\ L\ *\ L\string^H\ is\ symmetric\ and\ stored\ as\ a\ single\ matrix}}
\DoxyCodeLine{00050\ \textcolor{comment}{\ \ \ \ \ *\ containing\ L\ +\ L\string^H\ -\/\ diag(L).}}
\DoxyCodeLine{00051\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{00052\ \ \ \ \ symm\_combined\_cholesky,}
\DoxyCodeLine{00053\ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00054\ \textcolor{comment}{\ \ \ \ \ *\ The\ factorization\ is\ symmetric\ and\ stored\ as\ a\ single\ matrix\ containing}}
\DoxyCodeLine{00055\ \textcolor{comment}{\ \ \ \ \ *\ L\ +\ D\ +\ L\string^H\ -\/\ 2\ *\ diag(L),\ where\ L\ and\ L\string^H\ have\ an\ implicit\ unit}}
\DoxyCodeLine{00056\ \textcolor{comment}{\ \ \ \ \ *\ diagonal.}}
\DoxyCodeLine{00057\ \textcolor{comment}{\ \ \ \ \ */}}
\DoxyCodeLine{00058\ \ \ \ \ symm\_combined\_ldl,}
\DoxyCodeLine{00059\ \};}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00075\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType,\ \textcolor{keyword}{typename}\ IndexType>}
\DoxyCodeLine{00076\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<Factorization<ValueType,\ IndexType>>\ \{}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<\doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}},\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}>;}
\DoxyCodeLine{00078\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_AND\_INDEX\_TYPE;}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00081\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00083\ \ \ \ \ \textcolor{keyword}{using\ }matrix\_type\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{matrix::Csr<ValueType,\ IndexType>}};}
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keyword}{using\ }diag\_type\ =\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Diagonal}{matrix::Diagonal<ValueType>}};}
\DoxyCodeLine{00085\ \ \ \ \ \textcolor{keyword}{using\ }composition\_type\ =\ \doxymbox{\hyperlink{classgko_1_1Composition}{Composition<ValueType>}};}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00095\ \ \ \ \ std::unique\_ptr<Factorization>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_ad0163a75274ff8054cc4d93732d82501}{unpack}}()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00098\ \ \ \ \ storage\_type\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a83193188cd0fd4fd0e89c50e56dab03c}{get\_storage\_type}}()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00104\ \ \ \ \ std::shared\_ptr<const\ matrix\_type>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a1ed10321bb3b5a0f4fd46d15382d0b80}{get\_lower\_factor}}()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00105\ }
\DoxyCodeLine{00110\ \ \ \ \ std::shared\_ptr<const\ diag\_type>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a44cdb2f93476cdd41e7f4fc41a77163c}{get\_diagonal}}()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00116\ \ \ \ \ std::shared\_ptr<const\ matrix\_type>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a658230dbe344bf1af7f57668b173aa83}{get\_upper\_factor}}()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00122\ \ \ \ \ std::shared\_ptr<const\ matrix\_type>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_abb4550c4aba839e702e38a09b47a67ce}{get\_combined}}()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00125\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}\&);}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00128\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_afa55f6bf600858d6ffacc7182ab08085}{Factorization}}(\doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}\&\&);}
\DoxyCodeLine{00129\ }
\DoxyCodeLine{00130\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}\&\ operator=(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}\&);}
\DoxyCodeLine{00131\ }
\DoxyCodeLine{00132\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}\&\ operator=(\doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}\&\&);}
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00143\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Factorization>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a4cf8b09e90da8c69e7ac4dd90bcd2771}{create\_from\_composition}}(}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ std::unique\_ptr<composition\_type>\ composition);}
\DoxyCodeLine{00145\ }
\DoxyCodeLine{00156\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Factorization>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a97b209cb7e411cdc93958063c24c9f08}{create\_from\_symm\_composition}}(}
\DoxyCodeLine{00157\ \ \ \ \ \ \ \ \ std::unique\_ptr<composition\_type>\ composition);}
\DoxyCodeLine{00158\ }
\DoxyCodeLine{00170\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Factorization>\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_ae648146d85cce8841b8ced32189832f9}{create\_from\_combined\_lu}}(}
\DoxyCodeLine{00171\ \ \ \ \ \ \ \ \ std::unique\_ptr<matrix\_type>\ \doxymbox{\hyperlink{namespacegko_1_1matrix}{matrix}});}
\DoxyCodeLine{00172\ }
\DoxyCodeLine{00173\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Factorization>\ create\_from\_combined\_ldu(}
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ std::unique\_ptr<matrix\_type>\ \doxymbox{\hyperlink{namespacegko_1_1matrix}{matrix}});}
\DoxyCodeLine{00175\ }
\DoxyCodeLine{00176\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Factorization>\ create\_from\_combined\_cholesky(}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ std::unique\_ptr<matrix\_type>\ \doxymbox{\hyperlink{namespacegko_1_1matrix}{matrix}});}
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00179\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<Factorization>\ create\_from\_combined\_ldl(}
\DoxyCodeLine{00180\ \ \ \ \ \ \ \ \ std::unique\_ptr<matrix\_type>\ \doxymbox{\hyperlink{namespacegko_1_1matrix}{matrix}});}
\DoxyCodeLine{00181\ }
\DoxyCodeLine{00182\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00183\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}(std::shared\_ptr<const\ Executor>\ exec);}
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00185\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1factorization_1_1Factorization_a8e939895eed947b5317c91f6bbe03004}{Factorization}}(std::unique\_ptr<\doxymbox{\hyperlink{classgko_1_1Composition}{Composition<ValueType>}}>\ factors,}
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ storage\_type\ type);}
\DoxyCodeLine{00187\ }
\DoxyCodeLine{00188\ \ \ \ \ \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{00189\ }
\DoxyCodeLine{00190\ \ \ \ \ \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{00191\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00192\ }
\DoxyCodeLine{00193\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00194\ \ \ \ \ storage\_type\ storage\_type\_;}
\DoxyCodeLine{00195\ \ \ \ \ std::unique\_ptr<Composition<ValueType>>\ factors\_;}
\DoxyCodeLine{00196\ \};}
\DoxyCodeLine{00197\ }
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00199\ \}\ \ \textcolor{comment}{//\ namespace\ factorization}}
\DoxyCodeLine{00200\ \}\ \ \textcolor{comment}{//\ namespace\ experimental}}
\DoxyCodeLine{00201\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00202\ }
\DoxyCodeLine{00203\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_FACTORIZATION\_FACTORIZATION\_HPP\_}}

\end{DoxyCode}
