\doxysection{gko::\+reorder::\+Rcm\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classgko_1_1reorder_1_1Rcm}{}\label{classgko_1_1reorder_1_1Rcm}\index{gko::reorder::Rcm$<$ ValueType, IndexType $>$@{gko::reorder::Rcm$<$ ValueType, IndexType $>$}}


\doxylink{classgko_1_1reorder_1_1Rcm}{Rcm} (Reverse Cuthill-\/\+Mc\+Kee) is a reordering algorithm minimizing the bandwidth of a matrix.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+reorder/\+rcm.\+hpp$>$}



Inheritance diagram for gko::\+reorder::\+Rcm\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1reorder_1_1Rcm__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+reorder::\+Rcm\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1reorder_1_1Rcm__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \doxymbox{\hyperlink{structgko_1_1reorder_1_1Rcm_1_1parameters__type}{parameters\+\_\+type}}
\item 
class \doxymbox{\hyperlink{classgko_1_1reorder_1_1Rcm_1_1Factory}{Factory}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1reorder_1_1Rcm_a60cc4e9cb86944dcab5f0e12e8849d12}\label{classgko_1_1reorder_1_1Rcm_a60cc4e9cb86944dcab5f0e12e8849d12} 
using {\bfseries Sparsity\+Matrix} = \doxymbox{\hyperlink{classgko_1_1matrix_1_1SparsityCsr}{matrix::\+\+Sparsity\+Csr}}$<$Value\+Type, Index\+Type$>$
\item 
\Hypertarget{classgko_1_1reorder_1_1Rcm_a1d727450850cc7db8f0a7093936b744a}\label{classgko_1_1reorder_1_1Rcm_a1d727450850cc7db8f0a7093936b744a} 
using {\bfseries Permutation\+Matrix} = \doxymbox{\hyperlink{classgko_1_1matrix_1_1Permutation}{matrix::\+\+Permutation}}$<$Index\+Type$>$
\item 
\Hypertarget{classgko_1_1reorder_1_1Rcm_affd761cf415197348dad938052c0766b}\label{classgko_1_1reorder_1_1Rcm_affd761cf415197348dad938052c0766b} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1reorder_1_1Rcm_ac00369adfaced7455cd2a2010a5f3ee1}\label{classgko_1_1reorder_1_1Rcm_ac00369adfaced7455cd2a2010a5f3ee1} 
using {\bfseries index\+\_\+type} = Index\+Type
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Rcm$<$ default\+\_\+precision, int32 $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
std::\+shared\+\_\+ptr$<$ const Permutation\+Matrix $>$ \doxymbox{\hyperlink{classgko_1_1reorder_1_1Rcm_a618eae188e134f667fca188b0438293e}{get\+\_\+permutation}} () const
\begin{DoxyCompactList}\small\item\em Gets the permutation (permutation matrix, output of the algorithm) of the linear operator. \end{DoxyCompactList}\item 
std::\+shared\+\_\+ptr$<$ const Permutation\+Matrix $>$ \doxymbox{\hyperlink{classgko_1_1reorder_1_1Rcm_a328fd3080bb7dd044dd4017403545f34}{get\+\_\+inverse\+\_\+permutation}} () const
\begin{DoxyCompactList}\small\item\em Gets the inverse permutation (permutation matrix, output of the algorithm) of the linear operator. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1reorder_1_1Rcm_a9b4177688af0a4a8550d5b085bfd701e}\label{classgko_1_1reorder_1_1Rcm_a9b4177688af0a4a8550d5b085bfd701e} 
const \doxymbox{\hyperlink{structgko_1_1reorder_1_1Rcm_1_1parameters__type}{parameters\+\_\+type}} \& {\bfseries get\+\_\+parameters} () const
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Rcm$<$ default\+\_\+precision, int32 $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
void {\bfseries convert\+\_\+to} (result\+\_\+type \texorpdfstring{$\ast$}{*}result) const override
\item 
void {\bfseries move\+\_\+to} (result\+\_\+type \texorpdfstring{$\ast$}{*}result) override
\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1reorder_1_1Rcm_ae8595d98661dd24ea82570bee7c31dc7}\label{classgko_1_1reorder_1_1Rcm_ae8595d98661dd24ea82570bee7c31dc7} 
static auto {\bfseries build} () -\/$>$ decltype(\doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory_a1d077101d9e788e6c65f088612d14cc3}{Factory::\+create}}())
\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1reorder_1_1Rcm_aa3d705c36abd14204c4eccc7d732ef19}\label{classgko_1_1reorder_1_1Rcm_aa3d705c36abd14204c4eccc7d732ef19} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Rcm, Reordering\+Base$<$ Index\+Type $>$ $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$\newline
class gko::\+reorder::\+\+Rcm$<$ Value\+Type, Index\+Type $>$}
\doxylink{classgko_1_1reorder_1_1Rcm}{Rcm} (Reverse Cuthill-\/\+Mc\+Kee) is a reordering algorithm minimizing the bandwidth of a matrix. 

Such a reordering typically also significantly reduces fill-\/in, though usually not as effective as more complex algorithms, specifically AMD and nested dissection schemes. The advantage of this algorithm is its low runtime. It requires the input matrix to be structurally symmetric.

\begin{DoxyNote}{Note}
This class is derived from polymorphic object but is not a \doxylink{classgko_1_1LinOp}{Lin\+Op} as it does not make sense for this class to implement the apply methods. The objective of this class is to generate a reordering/\+permutation vector (in the form of the Permutation matrix), which can be used to apply to reorder a matrix as required. 
\end{DoxyNote}


There are two "{}starting strategies"{} currently available:\+ minimum degree and pseudo-\/peripheral. These strategies control how a starting vertex for a connected component is chosen, which is then renumbered as first vertex in the component, starting the algorithm from there. In general, the bandwidths obtained by choosing a pseudo-\/peripheral vertex are slightly smaller than those obtained from choosing a vertex of minimum degree. On the other hand, this strategy is much more expensive, relatively. The algorithm for finding a pseudo-\/peripheral vertex as described in "{}\+Computer Solution of Sparse Linear Systems"{} (George, Liu, Ng, Oak Ridge National Laboratory, 1994) is implemented here.


\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & Type of the values of all matrices used in this class \\
\hline
{\em Index\+Type} & Type of the indices of all matrices used in this class \\
\hline
\end{DoxyTemplParams}


\label{doc-func-members}
\Hypertarget{classgko_1_1reorder_1_1Rcm_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1reorder_1_1Rcm_a328fd3080bb7dd044dd4017403545f34}\index{gko::reorder::Rcm$<$ ValueType, IndexType $>$@{gko::reorder::Rcm$<$ ValueType, IndexType $>$}!get\_inverse\_permutation@{get\_inverse\_permutation}}
\index{get\_inverse\_permutation@{get\_inverse\_permutation}!gko::reorder::Rcm$<$ ValueType, IndexType $>$@{gko::reorder::Rcm$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_inverse\_permutation()}{get\_inverse\_permutation()}}
{\footnotesize\ttfamily \label{classgko_1_1reorder_1_1Rcm_a328fd3080bb7dd044dd4017403545f34} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
std::\+shared\+\_\+ptr$<$ const Permutation\+Matrix $>$ \doxymbox{\hyperlink{classgko_1_1reorder_1_1Rcm}{gko::\+reorder::\+\+Rcm}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+inverse\+\_\+permutation (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Gets the inverse permutation (permutation matrix, output of the algorithm) of the linear operator. 

\begin{DoxyReturn}{Returns}
the inverse permutation (permutation matrix) 
\end{DoxyReturn}
\Hypertarget{classgko_1_1reorder_1_1Rcm_a618eae188e134f667fca188b0438293e}\index{gko::reorder::Rcm$<$ ValueType, IndexType $>$@{gko::reorder::Rcm$<$ ValueType, IndexType $>$}!get\_permutation@{get\_permutation}}
\index{get\_permutation@{get\_permutation}!gko::reorder::Rcm$<$ ValueType, IndexType $>$@{gko::reorder::Rcm$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_permutation()}{get\_permutation()}}
{\footnotesize\ttfamily \label{classgko_1_1reorder_1_1Rcm_a618eae188e134f667fca188b0438293e} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
std::\+shared\+\_\+ptr$<$ const Permutation\+Matrix $>$ \doxymbox{\hyperlink{classgko_1_1reorder_1_1Rcm}{gko::\+reorder::\+\+Rcm}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+permutation (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Gets the permutation (permutation matrix, output of the algorithm) of the linear operator. 

\begin{DoxyReturn}{Returns}
the permutation (permutation matrix) 
\end{DoxyReturn}


The documentation for this class was generated from the following file:\+\begin{DoxyCompactItemize}
\item 
ginkgo/\+core/\+reorder/\+rcm.\+hpp\end{DoxyCompactItemize}
