\doxysection{gko::\+experimental::\+reorder::\+Rcm\texorpdfstring{$<$}{<} Index\+Type \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm}{}\label{classgko_1_1experimental_1_1reorder_1_1Rcm}\index{gko::experimental::reorder::Rcm$<$ IndexType $>$@{gko::experimental::reorder::Rcm$<$ IndexType $>$}}


\doxylink{classgko_1_1experimental_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::\+experimental::\+reorder::\+Rcm\texorpdfstring{$<$}{<} Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1experimental_1_1reorder_1_1Rcm__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+experimental::\+reorder::\+Rcm\texorpdfstring{$<$}{<} Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1experimental_1_1reorder_1_1Rcm__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \doxymbox{\hyperlink{structgko_1_1experimental_1_1reorder_1_1Rcm_1_1parameters__type}{parameters\+\_\+type}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm_aa9370e440d67dc253f038cbe6c9292bf}\label{classgko_1_1experimental_1_1reorder_1_1Rcm_aa9370e440d67dc253f038cbe6c9292bf} 
using {\bfseries index\+\_\+type} = Index\+Type
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm_a11cff0debb6469b588f91b43b79ee616}\label{classgko_1_1experimental_1_1reorder_1_1Rcm_a11cff0debb6469b588f91b43b79ee616} 
using {\bfseries permutation\+\_\+type} = \doxymbox{\hyperlink{classgko_1_1matrix_1_1Permutation}{matrix::\+\+Permutation}}$<$index\+\_\+type$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Rcm$<$ int32 $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
const \doxymbox{\hyperlink{structgko_1_1experimental_1_1reorder_1_1Rcm_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Rcm_a1dc8890f88e6a7786a10ad93d40fb06d}{get\+\_\+parameters}} ()
\begin{DoxyCompactList}\small\item\em Returns the parameters used to construct the factory. \end{DoxyCompactList}\item 
std::\+unique\+\_\+ptr$<$ permutation\+\_\+type $>$ \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Rcm_a61b09ab022128e95d197cb536444a6f1}{generate}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ system\+\_\+matrix) const
\begin{DoxyCompactList}\small\item\em Creates a new product from the given components.    \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Rcm$<$ 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_1experimental_1_1reorder_1_1Rcm_a6be4bed40dd659bc915f4320c6f1ab81}\label{classgko_1_1experimental_1_1reorder_1_1Rcm_a6be4bed40dd659bc915f4320c6f1ab81} 
static \doxymbox{\hyperlink{structgko_1_1experimental_1_1reorder_1_1Rcm_1_1parameters__type}{parameters\+\_\+type}} {\bfseries build} ()
\begin{DoxyCompactList}\small\item\em Creates a new parameter\+\_\+type to set up the factory. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm_acf0591c720a92496e64eca1c2b0001c3}\label{classgko_1_1experimental_1_1reorder_1_1Rcm_acf0591c720a92496e64eca1c2b0001c3} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Rcm$<$ Index\+Type $>$, Lin\+Op\+Factory $>$}
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm_ad71c904182afb12b7e455a6f22f50586}\label{classgko_1_1experimental_1_1reorder_1_1Rcm_ad71c904182afb12b7e455a6f22f50586} 
class {\bfseries enable\+\_\+parameters\+\_\+type$<$ parameters\+\_\+type, Rcm$<$ Index\+Type $>$ $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Index\+Type = int32$>$\newline
class gko::\+experimental::\+reorder::\+\+Rcm$<$ Index\+Type $>$}
\doxylink{classgko_1_1experimental_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.

The class is a \doxylink{classgko_1_1LinOpFactory}{Lin\+Op\+Factory} generating a Permutation matrix out of a Csr system matrix, to be used with {\ttfamily Csr::\+permute(...)}.

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 Index\+Type} & Type of the indices of all matrices used in this class \\
\hline
\end{DoxyTemplParams}


\label{doc-func-members}
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm_a61b09ab022128e95d197cb536444a6f1}\index{gko::experimental::reorder::Rcm$<$ IndexType $>$@{gko::experimental::reorder::Rcm$<$ IndexType $>$}!generate@{generate}}
\index{generate@{generate}!gko::experimental::reorder::Rcm$<$ IndexType $>$@{gko::experimental::reorder::Rcm$<$ IndexType $>$}}
\doxysubsubsection{\texorpdfstring{generate()}{generate()}}
{\footnotesize\ttfamily \label{classgko_1_1experimental_1_1reorder_1_1Rcm_a61b09ab022128e95d197cb536444a6f1} 
template$<$typename Index\+Type = int32$>$ \\
std::\+unique\+\_\+ptr$<$ permutation\+\_\+type $>$ \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Rcm}{gko::\+experimental::\+reorder::\+\+Rcm}}$<$ Index\+Type $>$::\+generate (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$}]{system\+\_\+matrix}{}\end{DoxyParamCaption}) const}



Creates a new product from the given components.    

The method will create an Components\+Type object from the arguments of this method, and pass it to the generate\+\_\+impl() function which will create a new Abstract\+Product\+Type.


\begin{DoxyTemplParams}{Template Parameters}
{\em Args} & types of arguments passed to the constructor of Components\+Type\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em args} & arguments passed to the constructor of Components\+Type\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an instance of Abstract\+Product\+Type    
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This function overrides the default \doxylink{classgko_1_1AbstractFactory_a7287977ddcd747b4351b72be49a6c230}{Lin\+Op\+Factory::\+generate} to return a Permutation instead of a generic \doxylink{classgko_1_1LinOp}{Lin\+Op}, which would need to be cast to Permutation again to access its indices. It is only necessary because smart pointers aren\textquotesingle{}t covariant. 
\end{DoxyNote}
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Rcm_a1dc8890f88e6a7786a10ad93d40fb06d}\index{gko::experimental::reorder::Rcm$<$ IndexType $>$@{gko::experimental::reorder::Rcm$<$ IndexType $>$}!get\_parameters@{get\_parameters}}
\index{get\_parameters@{get\_parameters}!gko::experimental::reorder::Rcm$<$ IndexType $>$@{gko::experimental::reorder::Rcm$<$ IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_parameters()}{get\_parameters()}}
{\footnotesize\ttfamily \label{classgko_1_1experimental_1_1reorder_1_1Rcm_a1dc8890f88e6a7786a10ad93d40fb06d} 
template$<$typename Index\+Type = int32$>$ \\
const \doxymbox{\hyperlink{structgko_1_1experimental_1_1reorder_1_1Rcm_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Rcm}{gko::\+experimental::\+reorder::\+\+Rcm}}$<$ Index\+Type $>$::\+get\+\_\+parameters (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Returns the parameters used to construct the factory. 

\begin{DoxyReturn}{Returns}
the parameters used to construct the factory. 
\end{DoxyReturn}


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