\doxysection{gko::\+Composition\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classgko_1_1Composition}{}\label{classgko_1_1Composition}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}


The \doxylink{classgko_1_1Composition}{Composition} class can be used to compose linear operators {\ttfamily op1, op2, ..., opn} and obtain the operator {\ttfamily op1 \texorpdfstring{$\ast$}{*} op2 \texorpdfstring{$\ast$}{*} ... \texorpdfstring{$\ast$}{*} opn}.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+base/\+composition.\+hpp$>$}



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


Collaboration diagram for gko::\+Composition\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1Composition__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1Composition_ab565c6599fe56bf6b96f4c48f5992d6b}\label{classgko_1_1Composition_ab565c6599fe56bf6b96f4c48f5992d6b} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1Composition_a12ae2979361046b134643b49f1249cc5}\label{classgko_1_1Composition_a12ae2979361046b134643b49f1249cc5} 
using {\bfseries transposed\+\_\+type} = \doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}}$<$Value\+Type$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Composition$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
const std::\+vector$<$ std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ $>$ \& \doxymbox{\hyperlink{classgko_1_1Composition_aec22562876d3f5346ae78c96a436d525}{get\+\_\+operators}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns a list of operators of the composition. \end{DoxyCompactList}\item 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Composition_a773045a3e20b724cdc0390c5c154f35c}{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_1Composition_ae9d4e8a318c21b265cdcd7ed33175e52}{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 
\doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}} \& \doxymbox{\hyperlink{classgko_1_1Composition_a23a085f270d9df7842c33ede65f3a693}{operator=}} (const \doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}} \&)
\begin{DoxyCompactList}\small\item\em Copy-\/assigns a \doxylink{classgko_1_1Composition}{Composition}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}} \& \doxymbox{\hyperlink{classgko_1_1Composition_abfdf4c66506dba0b899974ed7687dc76}{operator=}} (\doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}} \&\&)
\begin{DoxyCompactList}\small\item\em Move-\/assigns a \doxylink{classgko_1_1Composition}{Composition}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}} (const Composition \&)
\begin{DoxyCompactList}\small\item\em Copy-\/constructs a \doxylink{classgko_1_1Composition}{Composition}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1Composition_a48b33990c9e3d5a060990b832e5d7787}{Composition}} (Composition \&\&)
\begin{DoxyCompactList}\small\item\em Move-\/constructs a \doxylink{classgko_1_1Composition}{Composition}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Composition$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
const \doxymbox{\hyperlink{classgko_1_1Composition}{Composition}}$<$ \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$<$ Composition$<$ 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}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1Composition_afa7c3f077edf67d0b19255dd78af3ecb}\label{classgko_1_1Composition_afa7c3f077edf67d0b19255dd78af3ecb} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Composition, Lin\+Op $>$}
\item 
\Hypertarget{classgko_1_1Composition_a0350dc3dedd61760b46c3afd62943e6c}\label{classgko_1_1Composition_a0350dc3dedd61760b46c3afd62943e6c} 
class {\bfseries Enable\+Create\+Method$<$ Composition $>$}
\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Static Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableCreateMethod}{gko::\+\+Enable\+Create\+Method$<$ Composition$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
static std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1Composition}{Composition}}$<$ \doxymbox{\hyperlink{namespacegko_a89637c833af7ae805802226d97cebebf}{default\+\_\+precision}} $>$ $>$ {\bfseries create} (Args \&\&... args)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision$>$\newline
class gko::\+\+Composition$<$ Value\+Type $>$}
The \doxylink{classgko_1_1Composition}{Composition} class can be used to compose linear operators {\ttfamily op1, op2, ..., opn} and obtain the operator {\ttfamily op1 \texorpdfstring{$\ast$}{*} op2 \texorpdfstring{$\ast$}{*} ... \texorpdfstring{$\ast$}{*} opn}. 

All Lin\+Ops of the \doxylink{classgko_1_1Composition}{Composition} must operate on Dense inputs. For an operator {\ttfamily op\+\_\+k} that require an initial guess for their {\ttfamily apply}, \doxylink{classgko_1_1Composition}{Composition} provides either
\begin{DoxyItemize}
\item the output of the previous {\ttfamily op\+\_\+\{k+1\}-\/\texorpdfstring{$>$}{>}apply} if {\ttfamily op\+\_\+k} has square dimension
\item zero if {\ttfamily op\+\_\+k} is rectangular as an initial guess.
\end{DoxyItemize}

\doxylink{classgko_1_1Composition}{Composition} ensures that all Lin\+Ops passed to its constructor use the same executor, and if not, copies the operators to the executor of the first operator.


\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & precision of input and result vectors \\
\hline
\end{DoxyTemplParams}


\label{doc-constructors}
\Hypertarget{classgko_1_1Composition_doc-constructors}
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}!Composition@{Composition}}
\index{Composition@{Composition}!gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
\doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition}}$<$ Value\+Type $>$::\+\+Composition (\begin{DoxyParamCaption}\item[{const Composition$<$ Value\+Type $>$ \&}]{}{}\end{DoxyParamCaption})}



Copy-\/constructs a \doxylink{classgko_1_1Composition}{Composition}. 

This inherits the executor of the input \doxylink{classgko_1_1Composition}{Composition} and all of its operators with shared ownership. \Hypertarget{classgko_1_1Composition_a48b33990c9e3d5a060990b832e5d7787}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}!Composition@{Composition}}
\index{Composition@{Composition}!gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1Composition_a48b33990c9e3d5a060990b832e5d7787} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
\doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition}}$<$ Value\+Type $>$::\+\+Composition (\begin{DoxyParamCaption}\item[{Composition$<$ Value\+Type $>$ \&\&}]{}{}\end{DoxyParamCaption})}



Move-\/constructs a \doxylink{classgko_1_1Composition}{Composition}. 

This inherits the executor of the input \doxylink{classgko_1_1Composition}{Composition} and all of its operators. The moved-\/from object is empty (0x0 \doxylink{classgko_1_1LinOp}{Lin\+Op} without operators) afterwards. 

\label{doc-func-members}
\Hypertarget{classgko_1_1Composition_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1Composition_ae9d4e8a318c21b265cdcd7ed33175e52}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}!conj\_transpose@{conj\_transpose}}
\index{conj\_transpose@{conj\_transpose}!gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{conj\_transpose()}{conj\_transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1Composition_ae9d4e8a318c21b265cdcd7ed33175e52} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition}}$<$ 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_1Composition_aec22562876d3f5346ae78c96a436d525}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}!get\_operators@{get\_operators}}
\index{get\_operators@{get\_operators}!gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{get\_operators()}{get\_operators()}}
{\footnotesize\ttfamily \label{classgko_1_1Composition_aec22562876d3f5346ae78c96a436d525} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
const std::\+vector$<$ std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ $>$ \& \doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition}}$<$ Value\+Type $>$::\+get\+\_\+operators (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns a list of operators of the composition. 

\begin{DoxyReturn}{Returns}
a list of operators 
\end{DoxyReturn}
\Hypertarget{classgko_1_1Composition_abfdf4c66506dba0b899974ed7687dc76}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}!operator=@{operator=}}
\index{operator=@{operator=}!gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1Composition_abfdf4c66506dba0b899974ed7687dc76} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
\doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}} \& \doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition}}$<$ Value\+Type $>$::\+operator= (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}}$<$ Value\+Type $>$ \&\&}]{}{}\end{DoxyParamCaption})}



Move-\/assigns a \doxylink{classgko_1_1Composition}{Composition}. 

The executor is not modified, and the wrapped Lin\+Ops are only being cloned if they are on a different executor, otherwise they share ownership. The moved-\/from object is empty (0x0 \doxylink{classgko_1_1LinOp}{Lin\+Op} without operators) afterwards. \Hypertarget{classgko_1_1Composition_a23a085f270d9df7842c33ede65f3a693}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}!operator=@{operator=}}
\index{operator=@{operator=}!gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1Composition_a23a085f270d9df7842c33ede65f3a693} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
\doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}} \& \doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition}}$<$ Value\+Type $>$::\+operator= (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{classgko_1_1Composition_aad32bb5f4c1e90100eafa20be5c6f297}{Composition}}$<$ Value\+Type $>$ \&}]{}{}\end{DoxyParamCaption})}



Copy-\/assigns a \doxylink{classgko_1_1Composition}{Composition}. 

The executor is not modified, and the wrapped Lin\+Ops are only being cloned if they are on a different executor. \Hypertarget{classgko_1_1Composition_a773045a3e20b724cdc0390c5c154f35c}\index{gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}!transpose@{transpose}}
\index{transpose@{transpose}!gko::Composition$<$ ValueType $>$@{gko::Composition$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{transpose()}{transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1Composition_a773045a3e20b724cdc0390c5c154f35c} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition}}$<$ 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/\+base/\+composition.\+hpp\end{DoxyCompactItemize}
