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


This class generates the (S)SOR preconditioner.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+preconditioner/\+sor.\+hpp$>$}



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


Collaboration diagram for gko::\+preconditioner::\+Sor\texorpdfstring{$<$}{<} Value\+Type, Index\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1preconditioner_1_1Sor__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Sor_1_1parameters__type}{parameters\+\_\+type}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a3a87b769b906a82145c0e2dc140bb832}\label{classgko_1_1preconditioner_1_1Sor_a3a87b769b906a82145c0e2dc140bb832} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a72fa863292bc406a81fb6a2b40e56041}\label{classgko_1_1preconditioner_1_1Sor_a72fa863292bc406a81fb6a2b40e56041} 
using {\bfseries index\+\_\+type} = Index\+Type
\item 
\Hypertarget{classgko_1_1preconditioner_1_1Sor_af95f3e5097be2f9ce72ec59573a11a00}\label{classgko_1_1preconditioner_1_1Sor_af95f3e5097be2f9ce72ec59573a11a00} 
using {\bfseries composition\+\_\+type} = \doxymbox{\hyperlink{classgko_1_1Composition}{Composition}}$<$Value\+Type$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Sor$<$ default\+\_\+precision, int32 $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
const \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Sor_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Sor_a026946b410cd5a3d64482e85c4e7e2e8}{get\+\_\+parameters}} ()
\begin{DoxyCompactList}\small\item\em Returns the parameters used to construct the factory. \end{DoxyCompactList}\item 
const \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Sor_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Sor_a2b16cf310c09bf80e9915521c6224f60}{get\+\_\+parameters}} () const
\begin{DoxyCompactList}\small\item\em Returns the parameters used to construct the factory.    \end{DoxyCompactList}\item 
std::\+unique\+\_\+ptr$<$ composition\+\_\+type $>$ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Sor_a815786e2fe73cf8640cf9823dec59b7c}{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$<$ Sor$<$ 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_1preconditioner_1_1Sor_a23c746f50487fe2824c3957995645099}\label{classgko_1_1preconditioner_1_1Sor_a23c746f50487fe2824c3957995645099} 
static \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Sor_1_1parameters__type}{parameters\+\_\+type}} {\bfseries build} ()
\begin{DoxyCompactList}\small\item\em Creates a new parameter\+\_\+type to set up the factory. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a73c0abc38e35a399177cc7094af4c72b}\label{classgko_1_1preconditioner_1_1Sor_a73c0abc38e35a399177cc7094af4c72b} 
static \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Sor_1_1parameters__type}{parameters\+\_\+type}} {\bfseries 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 $>$())
\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a9ab452479e7aa2a419696979e3dbd593}\label{classgko_1_1preconditioner_1_1Sor_a9ab452479e7aa2a419696979e3dbd593} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Sor, Lin\+Op\+Factory $>$}
\item 
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a36ef1c36baccc109d1d65820c2429ab8}\label{classgko_1_1preconditioner_1_1Sor_a36ef1c36baccc109d1d65820c2429ab8} 
class {\bfseries enable\+\_\+parameters\+\_\+type$<$ parameters\+\_\+type, Sor $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$\newline
class gko::\+preconditioner::\+\+Sor$<$ Value\+Type, Index\+Type $>$}
This class generates the (S)SOR preconditioner. 

The SOR preconditioner starts from a splitting of the the matrix $A$ into $A = D + L + U$, where $L$ contains all entries below the diagonal, and $U$ contains all entries above the diagonal. The application of the preconditioner is then defined as solving $M x = y$ with   \[M = \frac{1}{\omega} (D + \omega L), \quad 0 < \omega < 2.
\] $\omega$ is known as the relaxation factor. The preconditioner can be made symmetric, leading to the SSOR preconitioner. Here, $M$ is defined as    \[M = \frac{1}{\omega (2 - \omega)} (D + \omega L) D^{-1} (D + \omega U) ,
\quad 0 < \omega < 2.
\] A detailed description can be found in Iterative Methods for Sparse Linear Systems (Y. Saad) ch. 4.\+1.

This class is a factory, which will only generate the preconditioner. The resulting \doxylink{classgko_1_1LinOp}{Lin\+Op} will represent the application of $M^{-1}$.


\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & The value type of the internally used CSR matrix \\
\hline
{\em Index\+Type} & The index type of the internally used CSR matrix \\
\hline
\end{DoxyTemplParams}


\label{doc-func-members}
\Hypertarget{classgko_1_1preconditioner_1_1Sor_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a815786e2fe73cf8640cf9823dec59b7c}\index{gko::preconditioner::Sor$<$ ValueType, IndexType $>$@{gko::preconditioner::Sor$<$ ValueType, IndexType $>$}!generate@{generate}}
\index{generate@{generate}!gko::preconditioner::Sor$<$ ValueType, IndexType $>$@{gko::preconditioner::Sor$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{generate()}{generate()}}
{\footnotesize\ttfamily \label{classgko_1_1preconditioner_1_1Sor_a815786e2fe73cf8640cf9823dec59b7c} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
std::\+unique\+\_\+ptr$<$ composition\+\_\+type $>$ \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Sor}{gko::\+preconditioner::\+\+Sor}}$<$ 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 Factorization instead of a generic \doxylink{classgko_1_1LinOp}{Lin\+Op}, which would need to be cast to Factorization again to access its factors. It is only necessary because smart pointers aren\textquotesingle{}t covariant. 
\end{DoxyNote}
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a026946b410cd5a3d64482e85c4e7e2e8}\index{gko::preconditioner::Sor$<$ ValueType, IndexType $>$@{gko::preconditioner::Sor$<$ ValueType, IndexType $>$}!get\_parameters@{get\_parameters}}
\index{get\_parameters@{get\_parameters}!gko::preconditioner::Sor$<$ ValueType, IndexType $>$@{gko::preconditioner::Sor$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_parameters()}{get\_parameters()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1preconditioner_1_1Sor_a026946b410cd5a3d64482e85c4e7e2e8} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
const \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Sor_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Sor}{gko::\+preconditioner::\+\+Sor}}$<$ Value\+Type, 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}
\Hypertarget{classgko_1_1preconditioner_1_1Sor_a2b16cf310c09bf80e9915521c6224f60}\index{gko::preconditioner::Sor$<$ ValueType, IndexType $>$@{gko::preconditioner::Sor$<$ ValueType, IndexType $>$}!get\_parameters@{get\_parameters}}
\index{get\_parameters@{get\_parameters}!gko::preconditioner::Sor$<$ ValueType, IndexType $>$@{gko::preconditioner::Sor$<$ ValueType, IndexType $>$}}
\doxysubsubsection{\texorpdfstring{get\_parameters()}{get\_parameters()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1preconditioner_1_1Sor_a2b16cf310c09bf80e9915521c6224f60} 
template$<$typename Value\+Type = default\+\_\+precision, typename Index\+Type = int32$>$ \\
const \doxymbox{\hyperlink{structgko_1_1preconditioner_1_1Sor_1_1parameters__type}{parameters\+\_\+type}} \& \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Sor}{gko::\+preconditioner::\+\+Sor}}$<$ 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/\+preconditioner/\+sor.\+hpp\end{DoxyCompactItemize}
