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


Parallel graph match (\doxylink{classgko_1_1multigrid_1_1Pgm}{Pgm}) is the aggregate method introduced in the paper M.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+multigrid/\+pgm.\+hpp$>$}



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


Collaboration diagram for gko::\+multigrid::\+Pgm\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1multigrid_1_1Pgm__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \doxymbox{\hyperlink{structgko_1_1multigrid_1_1Pgm_1_1parameters__type}{parameters\+\_\+type}}
\item 
class \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm_1_1Factory}{Factory}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1multigrid_1_1Pgm_aec6fc8b98806d58ade399f3b4d462388}\label{classgko_1_1multigrid_1_1Pgm_aec6fc8b98806d58ade399f3b4d462388} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1multigrid_1_1Pgm_a41fc09c4e9ae928bc97eabef7ce83395}\label{classgko_1_1multigrid_1_1Pgm_a41fc09c4e9ae928bc97eabef7ce83395} 
using {\bfseries index\+\_\+type} = Index\+Type
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Pgm$<$ default\+\_\+precision, int32 $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1multigrid_1_1EnableMultigridLevel}{gko::\+multigrid::\+\+Enable\+Multigrid\+Level$<$ default\+\_\+precision $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries value\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1UseComposition}{gko::\+\+Use\+Composition$<$ default\+\_\+precision $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries value\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm_af4256a2ba571d8fe579e7b092b426561}{get\+\_\+system\+\_\+matrix}} () const
\begin{DoxyCompactList}\small\item\em Returns the system operator (matrix) of the linear system. \end{DoxyCompactList}\item 
Index\+Type \texorpdfstring{$\ast$}{*} \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm_a410a9f34612fbbbc7492beadb6944bc9}{get\+\_\+agg}} () noexcept
\begin{DoxyCompactList}\small\item\em Returns the aggregate group. \end{DoxyCompactList}\item 
const Index\+Type \texorpdfstring{$\ast$}{*} \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm_a18df85e700558f8b57d6013744c24a15}{get\+\_\+const\+\_\+agg}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the aggregate group.    \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1multigrid_1_1Pgm_a072ec7f74e3961629a6632fc24c73e71}\label{classgko_1_1multigrid_1_1Pgm_a072ec7f74e3961629a6632fc24c73e71} 
const \doxymbox{\hyperlink{structgko_1_1multigrid_1_1Pgm_1_1parameters__type}{parameters\+\_\+type}} \& {\bfseries get\+\_\+parameters} () const
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Pgm$<$ default\+\_\+precision, int32 $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
const Pgm$<$ \doxymbox{\hyperlink{namespacegko_a89637c833af7ae805802226d97cebebf}{default\+\_\+precision}}, \doxymbox{\hyperlink{namespacegko_a16bd14c10900eb804d784908d8aab5ab}{int32}} $>$ \texorpdfstring{$\ast$}{*} {\bfseries apply} (\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\+\_\+param}}$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ b, \doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\+\_\+param}}$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ x) const
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Pgm$<$ 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}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1multigrid_1_1EnableMultigridLevel}{gko::\+multigrid::\+\+Enable\+Multigrid\+Level$<$ default\+\_\+precision $>$}}}
\begin{DoxyCompactItemize}
\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1EnableMultigridLevel_afe1942cb9e7ad413f14c2837cf699e96}{get\+\_\+fine\+\_\+op}} () const override
\begin{DoxyCompactList}\small\item\em Returns the operator on fine level. \end{DoxyCompactList}\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1EnableMultigridLevel_a660228f99b543605ccbd24f3fa0e816b}{get\+\_\+restrict\+\_\+op}} () const override
\begin{DoxyCompactList}\small\item\em Returns the restrict operator. \end{DoxyCompactList}\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1EnableMultigridLevel_a6be3e7352bd2b57d95717caa757fbf7c}{get\+\_\+coarse\+\_\+op}} () const override
\begin{DoxyCompactList}\small\item\em Returns the operator on coarse level. \end{DoxyCompactList}\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1EnableMultigridLevel_a27e2ddde81000fae9f6df287585b71a6}{get\+\_\+prolong\+\_\+op}} () const override
\begin{DoxyCompactList}\small\item\em Returns the prolong operator. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1UseComposition}{gko::\+\+Use\+Composition$<$ default\+\_\+precision $>$}}}
\begin{DoxyCompactItemize}
\item 
std::\+shared\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1Composition}{Composition}}$<$ \doxymbox{\hyperlink{namespacegko_a89637c833af7ae805802226d97cebebf}{default\+\_\+precision}} $>$ $>$ \doxymbox{\hyperlink{classgko_1_1UseComposition_a81d7f1c982c43df853ed9b9074e45409}{get\+\_\+composition}} () const
\begin{DoxyCompactList}\small\item\em Returns the composition operators. \end{DoxyCompactList}\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1UseComposition_a46d5ea836edce6f0c0738d0218dd394b}{get\+\_\+operator\+\_\+at}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} index) const
\begin{DoxyCompactList}\small\item\em Returns the operator at index-\/th position of composition. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1multigrid_1_1Pgm_a98e96651e2ebfa8e9068d69d076f5a71}\label{classgko_1_1multigrid_1_1Pgm_a98e96651e2ebfa8e9068d69d076f5a71} 
static auto {\bfseries build} () -\/$>$ decltype(\doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory_a1d077101d9e788e6c65f088612d14cc3}{Factory::\+create}}())
\item 
static \doxymbox{\hyperlink{structgko_1_1multigrid_1_1Pgm_1_1parameters__type}{parameters\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm_a0bef9b63524f0040cca27976cb086816}{parse}} (const \doxymbox{\hyperlink{classgko_1_1config_1_1pnode}{config::\+pnode}} \&config, const \doxymbox{\hyperlink{classgko_1_1config_1_1registry}{config::\+registry}} \&context, const \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::\+type\+\_\+descriptor}} \&td\+\_\+for\+\_\+child=config::\+make\+\_\+type\+\_\+descriptor$<$ Value\+Type, Index\+Type $>$())
\begin{DoxyCompactList}\small\item\em Create the parameters from the property\+\_\+tree. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1multigrid_1_1Pgm_a58dd546603584a2d4d4fe696f4f6bc82}\label{classgko_1_1multigrid_1_1Pgm_a58dd546603584a2d4d4fe696f4f6bc82} 
class {\bfseries Enable\+Lin\+Op$<$ Pgm $>$}
\item 
\Hypertarget{classgko_1_1multigrid_1_1Pgm_aa3a4baffdf1c91efd7dd1ecc9f38dbe4}\label{classgko_1_1multigrid_1_1Pgm_aa3a4baffdf1c91efd7dd1ecc9f38dbe4} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Pgm, Lin\+Op $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$\newline
class gko::\+multigrid::\+\+Pgm$<$ Value\+Type, Index\+Type $>$}
Parallel graph match (\doxylink{classgko_1_1multigrid_1_1Pgm}{Pgm}) is the aggregate method introduced in the paper M. 

Naumov et al., "{}\+Amg\+X:\+ A Library for GPU Accelerated Algebraic \+Multigrid and Preconditioned Iterative Methods"{}. Current implementation only contains size = 2 version.

\doxylink{classgko_1_1multigrid_1_1Pgm}{Pgm} creates the aggregate group according to the matrix value not the structure. \doxylink{classgko_1_1multigrid_1_1Pgm}{Pgm} gives two steps (one-\/phase handshaking) to group the elements. 1:\+ get the strongest neighbor of each unaggregated element. 2:\+ group the elements whose strongest neighbor is each other. repeating until reaching the given conditions. After that, the un-\/aggregated elements are assigned to an aggregated group or are left alone.


\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & precision of matrix elements \\
\hline
{\em Index\+Type} & precision of matrix indexes \\
\hline
\end{DoxyTemplParams}


\label{doc-func-members}
\Hypertarget{classgko_1_1multigrid_1_1Pgm_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1multigrid_1_1Pgm_a410a9f34612fbbbc7492beadb6944bc9}\index{gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}!get\_agg@{get\_agg}}
\index{get\_agg@{get\_agg}!gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_agg()}{get\_agg()}}
{\footnotesize\ttfamily \label{classgko_1_1multigrid_1_1Pgm_a410a9f34612fbbbc7492beadb6944bc9} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
Index\+Type \texorpdfstring{$\ast$}{*} \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm}{gko::\+multigrid::\+\+Pgm}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+agg (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns the aggregate group. 

Aggregate group whose size is same as the number of rows. Stores the mapping information from row index to coarse row index. i.\+e., agg\+[row\+\_\+idx]\+ = coarse\+\_\+row\+\_\+idx.

\begin{DoxyReturn}{Returns}
the aggregate group. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1multigrid_1_1Pgm_a18df85e700558f8b57d6013744c24a15}\index{gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}!get\_const\_agg@{get\_const\_agg}}
\index{get\_const\_agg@{get\_const\_agg}!gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_const\_agg()}{get\_const\_agg()}}
{\footnotesize\ttfamily \label{classgko_1_1multigrid_1_1Pgm_a18df85e700558f8b57d6013744c24a15} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
const Index\+Type \texorpdfstring{$\ast$}{*} \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm}{gko::\+multigrid::\+\+Pgm}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+const\+\_\+agg (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns the aggregate group.    

Aggregate group whose size is same as the number of rows. Stores the mapping information from row index to coarse row index. i.\+e., agg\+[row\+\_\+idx]\+ = coarse\+\_\+row\+\_\+idx.

\begin{DoxyReturn}{Returns}
the aggregate group.   
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This is the constant version of the function, which can be significantly more memory efficient than the non-\/constant version, so always prefer this version. 
\end{DoxyNote}
\Hypertarget{classgko_1_1multigrid_1_1Pgm_af4256a2ba571d8fe579e7b092b426561}\index{gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}!get\_system\_matrix@{get\_system\_matrix}}
\index{get\_system\_matrix@{get\_system\_matrix}!gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_system\_matrix()}{get\_system\_matrix()}}
{\footnotesize\ttfamily \label{classgko_1_1multigrid_1_1Pgm_af4256a2ba571d8fe579e7b092b426561} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm}{gko::\+multigrid::\+\+Pgm}}$<$ Value\+Type, Index\+Type $>$::\+get\+\_\+system\+\_\+matrix (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns the system operator (matrix) of the linear system. 

\begin{DoxyReturn}{Returns}
the system operator (matrix) 
\end{DoxyReturn}
\Hypertarget{classgko_1_1multigrid_1_1Pgm_a0bef9b63524f0040cca27976cb086816}\index{gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}!parse@{parse}}
\index{parse@{parse}!gko::multigrid::Pgm$<$ ValueType, IndexType $>$@{gko::multigrid::Pgm$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{parse()}{parse()}}
{\footnotesize\ttfamily \label{classgko_1_1multigrid_1_1Pgm_a0bef9b63524f0040cca27976cb086816} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
\doxymbox{\hyperlink{structgko_1_1multigrid_1_1Pgm_1_1parameters__type}{parameters\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm}{gko::\+multigrid::\+\+Pgm}}$<$ Value\+Type, Index\+Type $>$::\+parse (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{classgko_1_1config_1_1pnode}{config::\+pnode}} \&}]{config}{, }\item[{const \doxymbox{\hyperlink{classgko_1_1config_1_1registry}{config::\+registry}} \&}]{context}{, }\item[{const \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::\+type\+\_\+descriptor}} \&}]{td\+\_\+for\+\_\+child}{ = {\ttfamily config:\+:\+make\+\_\+type\+\_\+descriptor$<$~ValueType,~IndexType~$>$()}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Create the parameters from the property\+\_\+tree. 

Because this is directly tied to the specific type, the value/\+index type settings within config are ignored and type\+\_\+descriptor is only used for children configs.


\begin{DoxyParams}{Parameters}
{\em config} & the property tree for setting \\
\hline
{\em context} & the registry \\
\hline
{\em td\+\_\+for\+\_\+child} & the type descriptor for children configs. The default uses the value/\+index type of this class.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
parameters 
\end{DoxyReturn}


The documentation for this class was generated from the following files:\+\begin{DoxyCompactItemize}
\item 
ginkgo/\+core/\+distributed/\+matrix.\+hpp\item 
ginkgo/\+core/\+multigrid/\+pgm.\+hpp\end{DoxyCompactItemize}
