\doxysection{gko::\+solver::\+Pipe\+Cg\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classgko_1_1solver_1_1PipeCg}{}\label{classgko_1_1solver_1_1PipeCg}\index{gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}}


PIPE\+\_\+\+CG or the pipelined conjugate gradient method is an iterative type Krylov subspace method which is suitable for symmetric positive definite methods.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+solver/\+pipe\+\_\+cg.\+hpp$>$}



Inheritance diagram for gko::\+solver::\+Pipe\+Cg\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1solver_1_1PipeCg__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+solver::\+Pipe\+Cg\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1solver_1_1PipeCg__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \doxymbox{\hyperlink{structgko_1_1solver_1_1PipeCg_1_1parameters__type}{parameters\+\_\+type}}
\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg_1_1Factory}{Factory}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1solver_1_1PipeCg_a641217d1084134ec900b33306e802238}\label{classgko_1_1solver_1_1PipeCg_a641217d1084134ec900b33306e802238} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1solver_1_1PipeCg_a5e219478763a0440c1bd696342169807}\label{classgko_1_1solver_1_1PipeCg_a5e219478763a0440c1bd696342169807} 
using {\bfseries transposed\+\_\+type} = Pipe\+Cg$<$Value\+Type$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Pipe\+Cg$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg_a321b7b76b873acad55e4e1e9dda1a0c4}{transpose}} () const override
\begin{DoxyCompactList}\small\item\em Returns a \doxylink{classgko_1_1LinOp}{Lin\+Op} representing the transpose of the \doxylink{classgko_1_1Transposable}{Transposable} object. \end{DoxyCompactList}\item 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg_a1056959c5a3d92583235754bf823e19c}{conj\+\_\+transpose}} () const override
\begin{DoxyCompactList}\small\item\em Returns a \doxylink{classgko_1_1LinOp}{Lin\+Op} representing the conjugate transpose of the \doxylink{classgko_1_1Transposable}{Transposable} object. \end{DoxyCompactList}\item 
bool \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg_a9c281801a55afcf6e6bfa0a0e55e5825}{apply\+\_\+uses\+\_\+initial\+\_\+guess}} () const override
\begin{DoxyCompactList}\small\item\em Return true as iterative solvers use the data in x as an initial guess. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1solver_1_1PipeCg_a82711df6e3a5e0433319dea107097796}\label{classgko_1_1solver_1_1PipeCg_a82711df6e3a5e0433319dea107097796} 
const \doxymbox{\hyperlink{structgko_1_1solver_1_1PipeCg_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$<$ Pipe\+Cg$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
const Pipe\+Cg$<$ \doxymbox{\hyperlink{namespacegko_a89637c833af7ae805802226d97cebebf}{default\+\_\+precision}} $>$ \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$<$ Pipe\+Cg$<$ default\+\_\+precision $>$ $>$}}}
\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_1solver_1_1EnableSolverBase}{gko::\+solver::\+\+Enable\+Solver\+Base$<$ Pipe\+Cg$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
Enable\+Solver\+Base \& {\bfseries operator=} (const Enable\+Solver\+Base \&other)
\begin{DoxyCompactList}\small\item\em Creates a shallow copy of the provided system matrix, clones it onto this executor if executors don\textquotesingle{}t match. \end{DoxyCompactList}\item 
int {\bfseries get\+\_\+num\+\_\+workspace\+\_\+ops} () const override
\item 
std::\+vector$<$ std::\+string $>$ {\bfseries get\+\_\+workspace\+\_\+op\+\_\+names} () const override
\item 
std::\+vector$<$ int $>$ {\bfseries get\+\_\+workspace\+\_\+scalars} () const override
\begin{DoxyCompactList}\small\item\em Returns the IDs of all scalars (workspace vectors with system dimension-\/independent size, usually 1 x num\+\_\+rhs). \end{DoxyCompactList}\item 
std::\+vector$<$ int $>$ {\bfseries get\+\_\+workspace\+\_\+vectors} () const override
\begin{DoxyCompactList}\small\item\em Returns the IDs of all vectors (workspace vectors with system dimension-\/dependent size, usually system\+\_\+matrix\+\_\+size x num\+\_\+rhs). \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase}{gko::\+solver::\+\+Solver\+Base$<$ Lin\+Op $>$}}}
\begin{DoxyCompactItemize}
\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1solver_1_1SolverBase_a2270916c6cb8451c275c0bca44c5d09e}{get\+\_\+system\+\_\+matrix}} () const
\begin{DoxyCompactList}\small\item\em Returns the system matrix, with its concrete type, used by the solver. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase}{gko::\+solver::\+\+Enable\+Iterative\+Base$<$ Pipe\+Cg$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
Enable\+Iterative\+Base \& {\bfseries operator=} (const Enable\+Iterative\+Base \&other)
\begin{DoxyCompactList}\small\item\em Creates a shallow copy of the provided stopping criterion, clones it onto this executor if executors don\textquotesingle{}t match. \end{DoxyCompactList}\item 
void \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase_a5e96a31681a2bc03fffb2d76e7a7da12}{set\+\_\+stop\+\_\+criterion\+\_\+factory}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{namespacegko_1_1stop_a61839f234ddbaaf68db337e58e012499}{stop::\+\+Criterion\+Factory}} $>$ new\+\_\+stop\+\_\+factory) override
\begin{DoxyCompactList}\small\item\em Sets the stopping criterion of the solver. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase}{gko::\+solver::\+\+Iterative\+Base}}}
\begin{DoxyCompactItemize}
\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{namespacegko_1_1stop_a61839f234ddbaaf68db337e58e012499}{stop::\+\+Criterion\+Factory}} $>$ \doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase_a26beb5ec985d883c22b614a8240d981d}{get\+\_\+stop\+\_\+criterion\+\_\+factory}} () const
\begin{DoxyCompactList}\small\item\em Gets the stopping criterion factory of the solver. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable}{gko::\+solver::\+\+Enable\+Preconditionable$<$ Pipe\+Cg$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
void \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionable_ad1f52e213256cd7c50811787dfcf4288}{set\+\_\+preconditioner}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ new\+\_\+precond) override
\begin{DoxyCompactList}\small\item\em Sets the preconditioner operator used by the \doxylink{classgko_1_1Preconditionable}{Preconditionable}. \end{DoxyCompactList}\item 
Enable\+Preconditionable \& {\bfseries operator=} (const Enable\+Preconditionable \&other)
\begin{DoxyCompactList}\small\item\em Creates a shallow copy of the provided preconditioner, clones it onto this executor if executors don\textquotesingle{}t match. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1Preconditionable}{gko::\+\+Preconditionable}}}
\begin{DoxyCompactItemize}
\item 
virtual std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Preconditionable_abde941e32b5fc5007a4afe0f6d3fdfbc}{get\+\_\+preconditioner}} () const
\begin{DoxyCompactList}\small\item\em Returns the preconditioner operator used by the \doxylink{classgko_1_1Preconditionable}{Preconditionable}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1solver_1_1PipeCg_ad54a3486a0dabbba5d8179d7ab50bcb8}\label{classgko_1_1solver_1_1PipeCg_ad54a3486a0dabbba5d8179d7ab50bcb8} 
static auto {\bfseries build} () -\/$>$ decltype(\doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory_a1d077101d9e788e6c65f088612d14cc3}{Factory::\+create}}())
\item 
static \doxymbox{\hyperlink{structgko_1_1solver_1_1PipeCg_1_1parameters__type}{parameters\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg_aaf33e66323571c9fe466c1cdac7073e2}{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 $>$())
\begin{DoxyCompactList}\small\item\em Create the parameters from the property\+\_\+tree. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1solver_1_1PipeCg_a251b3e2b347b045631e829527630dc7f}\label{classgko_1_1solver_1_1PipeCg_a251b3e2b347b045631e829527630dc7f} 
class {\bfseries Enable\+Lin\+Op$<$ Pipe\+Cg $>$}
\item 
\Hypertarget{classgko_1_1solver_1_1PipeCg_a773344161b2e2c7210ee5b35b7bae3d4}\label{classgko_1_1solver_1_1PipeCg_a773344161b2e2c7210ee5b35b7bae3d4} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Pipe\+Cg, Lin\+Op $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision$>$\newline
class gko::\+solver::\+\+Pipe\+Cg$<$ Value\+Type $>$}
PIPE\+\_\+\+CG or the pipelined conjugate gradient method is an iterative type Krylov subspace method which is suitable for symmetric positive definite methods. 

It improves upon the CG method by allowing computation of inner products and norms to be overlapped with operator and preconditioner application. The pipelined method scales up to the 10\texorpdfstring{$^\wedge$}{\string^}6 nodes of the assumed exascale machine, while its standard counterpart level off about one order of magnitude earlier, as suggested in the referenced paper (see below).

Possible issues:\+
\begin{DoxyEnumerate}
\item Numerical instability:\+ Due to the rearrangement of the operations, the method is known to be less stable than standard PCG.
\item The method is suitable for cases where a large number of iterations need to be performed and when the solver is distributed over a large number of distributed nodes. The advantage of lesser number of reductions that need to be performed comes at the cost of increased vector operations, and the cost of increased storage of vectors.
\item As the CG itself, this method performs very well for symmetric positive definite matrices but it is in general not suitable for general matrices.
\end{DoxyEnumerate}

The implementation in Ginkgo is based on the following paper:\+ Pipelined, Flexible Krylov Subspace Methods, P. Sanan et. al, SISC, 2016, doi:\+ 10.\+1137/\+15\+M1049130


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


\label{doc-func-members}
\Hypertarget{classgko_1_1solver_1_1PipeCg_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1solver_1_1PipeCg_a9c281801a55afcf6e6bfa0a0e55e5825}\index{gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}!apply\_uses\_initial\_guess@{apply\_uses\_initial\_guess}}
\index{apply\_uses\_initial\_guess@{apply\_uses\_initial\_guess}!gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{apply\_uses\_initial\_guess()}{apply\_uses\_initial\_guess()}}
{\footnotesize\ttfamily \label{classgko_1_1solver_1_1PipeCg_a9c281801a55afcf6e6bfa0a0e55e5825} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
bool \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg}{gko::\+solver::\+\+Pipe\+Cg}}$<$ Value\+Type $>$::\+apply\+\_\+uses\+\_\+initial\+\_\+guess (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}



Return true as iterative solvers use the data in x as an initial guess. 

\begin{DoxyReturn}{Returns}
true as iterative solvers use the data in x as an initial guess. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1solver_1_1PipeCg_a1056959c5a3d92583235754bf823e19c}\index{gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}!conj\_transpose@{conj\_transpose}}
\index{conj\_transpose@{conj\_transpose}!gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{conj\_transpose()}{conj\_transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1solver_1_1PipeCg_a1056959c5a3d92583235754bf823e19c} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg}{gko::\+solver::\+\+Pipe\+Cg}}$<$ Value\+Type $>$::\+conj\+\_\+transpose (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Returns a \doxylink{classgko_1_1LinOp}{Lin\+Op} representing the conjugate transpose of the \doxylink{classgko_1_1Transposable}{Transposable} object. 

\begin{DoxyReturn}{Returns}
a pointer to the new conjugate transposed object 
\end{DoxyReturn}


Implements \doxymbox{\hyperlink{classgko_1_1Transposable_a7c230aacdb222f09ba49baf0bd9e82eb}{gko::\+\+Transposable}}.

\Hypertarget{classgko_1_1solver_1_1PipeCg_aaf33e66323571c9fe466c1cdac7073e2}\index{gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}!parse@{parse}}
\index{parse@{parse}!gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{parse()}{parse()}}
{\footnotesize\ttfamily \label{classgko_1_1solver_1_1PipeCg_aaf33e66323571c9fe466c1cdac7073e2} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
\doxymbox{\hyperlink{structgko_1_1solver_1_1PipeCg_1_1parameters__type}{parameters\+\_\+type}} \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg}{gko::\+solver::\+\+Pipe\+Cg}}$<$ Value\+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~$>$()}}\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 type of this class.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
parameters 
\end{DoxyReturn}
\Hypertarget{classgko_1_1solver_1_1PipeCg_a321b7b76b873acad55e4e1e9dda1a0c4}\index{gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}!transpose@{transpose}}
\index{transpose@{transpose}!gko::solver::PipeCg$<$ ValueType $>$@{gko::solver::PipeCg$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{transpose()}{transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1solver_1_1PipeCg_a321b7b76b873acad55e4e1e9dda1a0c4} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg}{gko::\+solver::\+\+Pipe\+Cg}}$<$ Value\+Type $>$::\+transpose (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Returns a \doxylink{classgko_1_1LinOp}{Lin\+Op} representing the transpose of the \doxylink{classgko_1_1Transposable}{Transposable} object. 

\begin{DoxyReturn}{Returns}
a pointer to the new transposed object 
\end{DoxyReturn}


Implements \doxymbox{\hyperlink{classgko_1_1Transposable_adf04fdf2ed79b117edbef42520bfe8fa}{gko::\+\+Transposable}}.



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