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


MC64 is an algorithm for permuting large entries to the diagonal of a sparse matrix.  




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



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


Collaboration diagram for gko::\+experimental::\+reorder::\+Mc64\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1experimental_1_1reorder_1_1Mc64__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \doxymbox{\hyperlink{structgko_1_1experimental_1_1reorder_1_1Mc64_1_1parameters__type}{parameters\+\_\+type}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Mc64_a9ce04cadf45389f6c072a02c27b3ee52}\label{classgko_1_1experimental_1_1reorder_1_1Mc64_a9ce04cadf45389f6c072a02c27b3ee52} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Mc64_a9ab087abb8d52509cc11d57b1419890b}\label{classgko_1_1experimental_1_1reorder_1_1Mc64_a9ab087abb8d52509cc11d57b1419890b} 
using {\bfseries index\+\_\+type} = Index\+Type
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Mc64_a9f8cd98ddd313a23cc2bb855e83e83d5}\label{classgko_1_1experimental_1_1reorder_1_1Mc64_a9f8cd98ddd313a23cc2bb855e83e83d5} 
using {\bfseries result\+\_\+type} = \doxymbox{\hyperlink{classgko_1_1Composition}{Composition}}$<$value\+\_\+type$>$
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Mc64_a3a3f95b4265b88afd0a31c159cc19c9a}\label{classgko_1_1experimental_1_1reorder_1_1Mc64_a3a3f95b4265b88afd0a31c159cc19c9a} 
using {\bfseries matrix\+\_\+type} = \doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{matrix::\+\+Csr}}$<$value\+\_\+type, index\+\_\+type$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Mc64$<$ default\+\_\+precision, 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_1Mc64_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Mc64_aff576ccfb68ed94bd84774944d815053}{get\+\_\+parameters}} () const
\begin{DoxyCompactList}\small\item\em Returns the parameters used to construct the factory. \end{DoxyCompactList}\item 
std::\+unique\+\_\+ptr$<$ result\+\_\+type $>$ \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Mc64_af1d14e06e76327d95b5577bd944a077c}{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$<$ Mc64$<$ 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_1experimental_1_1reorder_1_1Mc64_acf4ff0eb6edb11ea44b9745ece9ded65}\label{classgko_1_1experimental_1_1reorder_1_1Mc64_acf4ff0eb6edb11ea44b9745ece9ded65} 
static \doxymbox{\hyperlink{structgko_1_1experimental_1_1reorder_1_1Mc64_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_1Mc64_a2436db4267d3eedb21765006aa8bc304}\label{classgko_1_1experimental_1_1reorder_1_1Mc64_a2436db4267d3eedb21765006aa8bc304} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Mc64$<$ Value\+Type, Index\+Type $>$, Lin\+Op\+Factory $>$}
\item 
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Mc64_a391e3925b9ae7b694f7e31b2f4d8a4e5}\label{classgko_1_1experimental_1_1reorder_1_1Mc64_a391e3925b9ae7b694f7e31b2f4d8a4e5} 
class {\bfseries enable\+\_\+parameters\+\_\+type$<$ parameters\+\_\+type, Mc64$<$ Value\+Type, Index\+Type $>$ $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$\newline
class gko::\+experimental::\+reorder::\+\+Mc64$<$ Value\+Type, Index\+Type $>$}
MC64 is an algorithm for permuting large entries to the diagonal of a sparse matrix. 

This approach can increase numerical stability of e.\+g. an LU factorization without pivoting. Under the assumption of working on a nonsingular square matrix, the algorithm computes a minimum weight perfect matching on a weighted edge bipartite graph of the matrix. It is described in detail in "{}\+On Algorithms for Permuting Large Entries to the \+Diagonal of a Sparse Matrix"{} (Duff, Koster, 2001, DOI:\+ 10.\+1137/\+\+S0895479899358443). There are two strategies for choosing the weights supported:\+
\begin{DoxyItemize}
\item Maximizing the product of the absolute values on the diagonal. For this strategy, the weights are computed as $c(i, j) = \log_2(a_i) - \log_2(|a(i, j)|)$ if $a(i, j) \neq 0 $ and $c(i, j) = \infty$ otherwise. Here, a\+\_\+i is the maximum absolute value in row i of the matrix A. In this case, the implementation computes a row permutation P and row and column scaling coefficients L and R such that the matrix P\texorpdfstring{$\ast$}{*}\+L\texorpdfstring{$\ast$}{*}\+A\texorpdfstring{$\ast$}{*}R has values with unity absolute value on the diagonal and smaller or equal entries everywhere else.
\item Maximizing the sum of the absolute values on the diagonal. For this strategy, the weights are computed as $c(i, j) = a_i - |a(i, j)|$ if $a(i, j) \neq 0$ and  $c(i, j) =
   \infty$ otherwise. In this case, no scaling coefficients are computed.
\end{DoxyItemize}

This class creates a \doxylink{classgko_1_1Combination}{Combination} of two Scaled\+Permutations representing the row and column permutation and scaling factors computed by this algorithm.


\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_1experimental_1_1reorder_1_1Mc64_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1experimental_1_1reorder_1_1Mc64_af1d14e06e76327d95b5577bd944a077c}\index{gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$@{gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$}!generate@{generate}}
\index{generate@{generate}!gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$@{gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{generate()}{generate()}}
{\footnotesize\ttfamily \label{classgko_1_1experimental_1_1reorder_1_1Mc64_af1d14e06e76327d95b5577bd944a077c} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
std::\+unique\+\_\+ptr$<$ result\+\_\+type $>$ \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Mc64}{gko::\+experimental::\+reorder::\+\+Mc64}}$<$ Value\+Type, 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 Scaled\+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_1Mc64_aff576ccfb68ed94bd84774944d815053}\index{gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$@{gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$}!get\_parameters@{get\_parameters}}
\index{get\_parameters@{get\_parameters}!gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$@{gko::experimental::reorder::Mc64$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_parameters()}{get\_parameters()}}
{\footnotesize\ttfamily \label{classgko_1_1experimental_1_1reorder_1_1Mc64_aff576ccfb68ed94bd84774944d815053} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
const \doxymbox{\hyperlink{structgko_1_1experimental_1_1reorder_1_1Mc64_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1experimental_1_1reorder_1_1Mc64}{gko::\+experimental::\+reorder::\+\+Mc64}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+parameters (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\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/\+mc64.\+hpp\end{DoxyCompactItemize}
