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


The \doxylink{classgko_1_1Combination}{Combination} class can be used to construct a linear combination of multiple linear operators {\ttfamily c1 \texorpdfstring{$\ast$}{*} op1 + c2 \texorpdfstring{$\ast$}{*} op2 + ... + ck \texorpdfstring{$\ast$}{*} opk}.  




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



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


Collaboration diagram for gko::\+Combination\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1Combination__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1Combination_a503b5d7f5f35f6ff697e44a850f10f9f}\label{classgko_1_1Combination_a503b5d7f5f35f6ff697e44a850f10f9f} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1Combination_a0af10b245e9cf1131188dd8c13c4ec6d}\label{classgko_1_1Combination_a0af10b245e9cf1131188dd8c13c4ec6d} 
using {\bfseries transposed\+\_\+type} = \doxymbox{\hyperlink{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}}$<$Value\+Type$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Combination$<$ 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_1Combination_a9963998e7d267e5cbd7145167648e622}{get\+\_\+coefficients}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns a list of coefficients of the combination. \end{DoxyCompactList}\item 
const std::\+vector$<$ std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ $>$ \& \doxymbox{\hyperlink{classgko_1_1Combination_a881ebdcec75430a078cb88130ab93740}{get\+\_\+operators}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns a list of operators of the combination. \end{DoxyCompactList}\item 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Combination_a1f3a24989680d5d722d07d589af06253}{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_1Combination_a18bdd88bcfa68b5c9858749c50426629}{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_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}} \& \doxymbox{\hyperlink{classgko_1_1Combination_a16855c320729f31c0a271decf65a6133}{operator=}} (const \doxymbox{\hyperlink{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}} \&)
\begin{DoxyCompactList}\small\item\em Copy-\/assigns a \doxylink{classgko_1_1Combination}{Combination}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}} \& \doxymbox{\hyperlink{classgko_1_1Combination_a583194a7a0180a584b68b2e71f62e876}{operator=}} (\doxymbox{\hyperlink{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}} \&\&)
\begin{DoxyCompactList}\small\item\em Move-\/assigns a \doxylink{classgko_1_1Combination}{Combination}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}} (const Combination \&)
\begin{DoxyCompactList}\small\item\em Copy-\/constructs a \doxylink{classgko_1_1Combination}{Combination}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1Combination_a48d42f2a23c7fa6d55805edac9e29ce8}{Combination}} (Combination \&\&)
\begin{DoxyCompactList}\small\item\em Move-\/constructs a \doxylink{classgko_1_1Combination}{Combination}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Combination$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
const \doxymbox{\hyperlink{classgko_1_1Combination}{Combination}}$<$ \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$<$ Combination$<$ 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_1Combination_ae096eca62ea7e5640d99ece073cf1194}\label{classgko_1_1Combination_ae096eca62ea7e5640d99ece073cf1194} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Combination, Lin\+Op $>$}
\item 
\Hypertarget{classgko_1_1Combination_a54ec531b3585ab2f8572e20e3bebb9d1}\label{classgko_1_1Combination_a54ec531b3585ab2f8572e20e3bebb9d1} 
class {\bfseries Enable\+Create\+Method$<$ Combination $>$}
\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Static Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableCreateMethod}{gko::\+\+Enable\+Create\+Method$<$ Combination$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
static std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1Combination}{Combination}}$<$ \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::\+\+Combination$<$ Value\+Type $>$}
The \doxylink{classgko_1_1Combination}{Combination} class can be used to construct a linear combination of multiple linear operators {\ttfamily c1 \texorpdfstring{$\ast$}{*} op1 + c2 \texorpdfstring{$\ast$}{*} op2 + ... + ck \texorpdfstring{$\ast$}{*} opk}. 

\doxylink{classgko_1_1Combination}{Combination} 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_1Combination_doc-constructors}
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}\index{gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}!Combination@{Combination}}
\index{Combination@{Combination}!gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{Combination()}{Combination()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
\doxymbox{\hyperlink{classgko_1_1Combination}{gko::\+\+Combination}}$<$ Value\+Type $>$::\+\+Combination (\begin{DoxyParamCaption}\item[{const Combination$<$ Value\+Type $>$ \&}]{}{}\end{DoxyParamCaption})}



Copy-\/constructs a \doxylink{classgko_1_1Combination}{Combination}. 

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



Move-\/constructs a \doxylink{classgko_1_1Combination}{Combination}. 

This inherits the executor of the input \doxylink{classgko_1_1Combination}{Combination} 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_1Combination_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1Combination_a18bdd88bcfa68b5c9858749c50426629}\index{gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}!conj\_transpose@{conj\_transpose}}
\index{conj\_transpose@{conj\_transpose}!gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{conj\_transpose()}{conj\_transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1Combination_a18bdd88bcfa68b5c9858749c50426629} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Combination}{gko::\+\+Combination}}$<$ 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_1Combination_a9963998e7d267e5cbd7145167648e622}\index{gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}!get\_coefficients@{get\_coefficients}}
\index{get\_coefficients@{get\_coefficients}!gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{get\_coefficients()}{get\_coefficients()}}
{\footnotesize\ttfamily \label{classgko_1_1Combination_a9963998e7d267e5cbd7145167648e622} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
const std::\+vector$<$ std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ $>$ \& \doxymbox{\hyperlink{classgko_1_1Combination}{gko::\+\+Combination}}$<$ Value\+Type $>$::\+get\+\_\+coefficients (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns a list of coefficients of the combination. 

\begin{DoxyReturn}{Returns}
a list of coefficients 
\end{DoxyReturn}
\Hypertarget{classgko_1_1Combination_a881ebdcec75430a078cb88130ab93740}\index{gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}!get\_operators@{get\_operators}}
\index{get\_operators@{get\_operators}!gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{get\_operators()}{get\_operators()}}
{\footnotesize\ttfamily \label{classgko_1_1Combination_a881ebdcec75430a078cb88130ab93740} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
const std::\+vector$<$ std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ $>$ \& \doxymbox{\hyperlink{classgko_1_1Combination}{gko::\+\+Combination}}$<$ Value\+Type $>$::\+get\+\_\+operators (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns a list of operators of the combination. 

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



Move-\/assigns a \doxylink{classgko_1_1Combination}{Combination}. 

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_1Combination_a16855c320729f31c0a271decf65a6133}\index{gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}!operator=@{operator=}}
\index{operator=@{operator=}!gko::Combination$<$ ValueType $>$@{gko::Combination$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1Combination_a16855c320729f31c0a271decf65a6133} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
\doxymbox{\hyperlink{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}} \& \doxymbox{\hyperlink{classgko_1_1Combination}{gko::\+\+Combination}}$<$ Value\+Type $>$::\+operator= (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{classgko_1_1Combination_ab7e353cbd03d724b65e63262852ea960}{Combination}}$<$ Value\+Type $>$ \&}]{}{}\end{DoxyParamCaption})}



Copy-\/assigns a \doxylink{classgko_1_1Combination}{Combination}. 

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