\doxysection{scaled\+\_\+permutation.\+hpp}
\hypertarget{scaled__permutation_8hpp_source}{}\label{scaled__permutation_8hpp_source}\index{ginkgo/core/matrix/scaled\_permutation.hpp@{ginkgo/core/matrix/scaled\_permutation.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\_MATRIX\_SCALED\_PERMUTATION\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_MATRIX\_SCALED\_PERMUTATION\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/array.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/executor.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/utils.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/permutation.hpp>}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00020\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1matrix}{matrix}}\ \{}
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00035\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision,\ \textcolor{keyword}{typename}\ IndexType\ =\ \textcolor{keywordtype}{int}32>}
\DoxyCodeLine{00036\ \textcolor{keyword}{class\ }ScaledPermutation\ final}
\DoxyCodeLine{00037\ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<ScaledPermutation<ValueType,\ IndexType>>,}
\DoxyCodeLine{00038\ \ \ \ \ \ \ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1WritableToMatrixData}{WritableToMatrixData}}<ValueType,\ IndexType>\ \{}
\DoxyCodeLine{00039\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<ScaledPermutation,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}>;}
\DoxyCodeLine{00040\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_AND\_INDEX\_TYPE;}
\DoxyCodeLine{00041\ }
\DoxyCodeLine{00042\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00043\ \ \ \ \ \textcolor{keyword}{using\ }value\_type\ =\ ValueType;}
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ IndexType;}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00051\ \ \ \ \ value\_type*\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_af6bdc0527426f558a5cf70c3cd30ceee}{get\_scaling\_factors}}()\ noexcept\ \{\ \textcolor{keywordflow}{return}\ scale\_.get\_data();\ \}}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00060\ \ \ \ \ \textcolor{keyword}{const}\ value\_type*\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_a019f2a93ec3227b8c60f03bf0757d06e}{get\_const\_scaling\_factors}}()\ const\ noexcept}
\DoxyCodeLine{00061\ \ \ \ \ \{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ scale\_.get\_const\_data();}
\DoxyCodeLine{00063\ \ \ \ \ \}}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00070\ \ \ \ \ index\_type*\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_a23dab0900976e9c5f1a99dc4d9e81366}{get\_permutation}}()\ noexcept\ \{\ \textcolor{keywordflow}{return}\ permutation\_.get\_data();\ \}}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00079\ \ \ \ \ \textcolor{keyword}{const}\ index\_type*\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_a433e75949e8cad9195d2f46e749c3312}{get\_const\_permutation}}()\ const\ noexcept}
\DoxyCodeLine{00080\ \ \ \ \ \{}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ permutation\_.get\_const\_data();}
\DoxyCodeLine{00082\ \ \ \ \ \}}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00092\ \ \ \ \ std::unique\_ptr<ScaledPermutation>\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_ad7287f473769051c10ddb1c110329c3d}{compute\_inverse}}()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00093\ }
\DoxyCodeLine{00102\ \ \ \ \ std::unique\_ptr<ScaledPermutation>\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_ac3d100586896e50640f44f9a3425db53}{compose}}(}
\DoxyCodeLine{00103\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<const\ ScaledPermutation>}}\ other)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00105\ \ \ \ \ \textcolor{keywordtype}{void}\ write(\doxymbox{\hyperlink{structgko_1_1matrix__data}{gko::matrix\_data<value\_type,\ index\_type>}}\&\ data)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00115\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<ScaledPermutation>\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_a901ba04db357fe2d96512bdf8ed387b6}{create}}(}
\DoxyCodeLine{00116\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ size\ =\ 0);}
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00126\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<ScaledPermutation>\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_a7086cc95572a9daa00607bc7a5449d77}{create}}(}
\DoxyCodeLine{00127\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param}}<\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Permutation}{Permutation<IndexType>}}>\ permutation);}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00138\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<ScaledPermutation>\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_a50954184829fa6a25952f00180c0fe82}{create}}(}
\DoxyCodeLine{00139\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ scaling\_factors,}
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ permutation\_indices);}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00153\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<const\ ScaledPermutation>\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation_ae9bfb03b62202a41a86060895d00a250}{create\_const}}(}
\DoxyCodeLine{00154\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00155\ \ \ \ \ \ \ \ \ gko::detail::const\_array\_view<value\_type>\&\&\ scale,}
\DoxyCodeLine{00156\ \ \ \ \ \ \ \ \ gko::detail::const\_array\_view<index\_type>\&\&\ perm\_idxs);}
\DoxyCodeLine{00157\ }
\DoxyCodeLine{00158\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00159\ \ \ \ \ ScaledPermutation(std::shared\_ptr<const\ Executor>\ exec,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ size\ =\ 0);}
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00161\ \ \ \ \ ScaledPermutation(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ scaling\_factors,}
\DoxyCodeLine{00163\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ permutation\_indices);}
\DoxyCodeLine{00164\ }
\DoxyCodeLine{00165\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ in,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ out)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00166\ }
\DoxyCodeLine{00167\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ in,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*,}
\DoxyCodeLine{00168\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ out)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00169\ }
\DoxyCodeLine{00170\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<value\_type>}}\ scale\_;}
\DoxyCodeLine{00171\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ permutation\_;}
\DoxyCodeLine{00172\ \};}
\DoxyCodeLine{00173\ }
\DoxyCodeLine{00174\ }
\DoxyCodeLine{00175\ \}\ \ \textcolor{comment}{//\ namespace\ matrix}}
\DoxyCodeLine{00176\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00177\ }
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00179\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_MATRIX\_SCALED\_PERMUTATION\_HPP\_}}

\end{DoxyCode}
