\doxysection{gko::\+Block\+Operator Class Reference}
\hypertarget{classgko_1_1BlockOperator}{}\label{classgko_1_1BlockOperator}\index{gko::BlockOperator@{gko::BlockOperator}}


A \doxylink{classgko_1_1BlockOperator}{Block\+Operator} represents a linear operator that is partitioned into multiple blocks.  




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



Inheritance diagram for gko::\+Block\+Operator:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1BlockOperator__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+Block\+Operator:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1BlockOperator__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ \doxymbox{\hyperlink{classgko_1_1BlockOperator_a7c5a2afced62435443d0a6e5d67cc5f7}{get\+\_\+block\+\_\+size}} () const
\begin{DoxyCompactList}\small\item\em Get the block dimension of this, i.\+e. \end{DoxyCompactList}\item 
const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} \texorpdfstring{$\ast$}{*} \doxymbox{\hyperlink{classgko_1_1BlockOperator_a8ae64878f419a1719010efa49c660279}{block\+\_\+at}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} i, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} j) const
\begin{DoxyCompactList}\small\item\em Const access to a specific block. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} (const Block\+Operator \&other)
\begin{DoxyCompactList}\small\item\em Copy constructs a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1BlockOperator_a4066b33a9d42462429c76eea3f9532c1}{Block\+Operator}} (Block\+Operator \&\&other) noexcept
\begin{DoxyCompactList}\small\item\em Move constructs a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \& \doxymbox{\hyperlink{classgko_1_1BlockOperator_a2b553db151f4260372d94d952bce4dfb}{operator=}} (const \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \&other)
\begin{DoxyCompactList}\small\item\em Copy assigns a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \& \doxymbox{\hyperlink{classgko_1_1BlockOperator_a6d7ad2c57e28354129a21e9e2098a85f}{operator=}} (\doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \&\&other)
\begin{DoxyCompactList}\small\item\em Move assigns a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Block\+Operator $>$}}}
\begin{DoxyCompactItemize}
\item 
const \doxymbox{\hyperlink{classgko_1_1BlockOperator}{Block\+Operator}} \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$<$ Block\+Operator $>$}}}
\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 
static std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} $>$ \doxymbox{\hyperlink{classgko_1_1BlockOperator_af1263fd5f086a3dd4d72f0fb01db73c4}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec)
\begin{DoxyCompactList}\small\item\em Create empty \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. \end{DoxyCompactList}\item 
static std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} $>$ \doxymbox{\hyperlink{classgko_1_1BlockOperator_a3d78e60e7ed11202db89b00b16e50cca}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, std::\+vector$<$ std::\+vector$<$ std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ $>$ $>$ blocks)
\begin{DoxyCompactList}\small\item\em Create \doxylink{classgko_1_1BlockOperator}{Block\+Operator} from the given blocks. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1BlockOperator_a0d0801ae85a72f2d5968465245783192}\label{classgko_1_1BlockOperator_a0d0801ae85a72f2d5968465245783192} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Block\+Operator, Lin\+Op $>$}
\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Block\+Operator $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A \doxylink{classgko_1_1BlockOperator}{Block\+Operator} represents a linear operator that is partitioned into multiple blocks. 

For example, a \doxylink{classgko_1_1BlockOperator}{Block\+Operator} can be used to define the operator:\+ 
\begin{DoxyCode}{0}
\DoxyCodeLine{|\ A\ B\ |}
\DoxyCodeLine{|\ C\ D\ |}

\end{DoxyCode}
 where {\ttfamily A, B, C, D} itself are matrices of compatible size. This can be created with:\+ 
\begin{DoxyCode}{0}
\DoxyCodeLine{std::shared\_ptr<LinOp>\ A\ =\ ...;}
\DoxyCodeLine{std::shared\_ptr<LinOp>\ B\ =\ ...;}
\DoxyCodeLine{std::shared\_ptr<LinOp>\ C\ =\ ...;}
\DoxyCodeLine{std::shared\_ptr<LinOp>\ D\ =\ ...;}
\DoxyCodeLine{\textcolor{keyword}{auto}\ bop\ =\ \doxymbox{\hyperlink{classgko_1_1BlockOperator_af1263fd5f086a3dd4d72f0fb01db73c4}{BlockOperator::create}}(exec,\ \{\{A,\ B\},\ \{C,\ D\}\});}

\end{DoxyCode}
 The requirements on the individual blocks passed to the create method are:\+
\begin{DoxyItemize}
\item In each block-\/row, all blocks have the same number of rows
\item In each block-\/column, all blocks have the same number of columns
\item Each block-\/row must have the same number of blocks It is possible to set blocks to zero, by passing in a nullptr. But every block-\/row and block-\/column must contain at least one non-\/nullptr block.
\end{DoxyItemize}

The constructor will store all passed in blocks on the same executor as the \doxylink{classgko_1_1BlockOperator}{Block\+Operator}, which will requires copying any block that is associated with a different executor. 

\label{doc-constructors}
\Hypertarget{classgko_1_1BlockOperator_doc-constructors}
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}\index{gko::BlockOperator@{gko::BlockOperator}!BlockOperator@{BlockOperator}}
\index{BlockOperator@{BlockOperator}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{BlockOperator()}{BlockOperator()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03} 
gko::\+\+Block\+Operator::\+\+Block\+Operator (\begin{DoxyParamCaption}\item[{const Block\+Operator \&}]{other}{}\end{DoxyParamCaption})}



Copy constructs a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. 

The executor of other is used for this. The blocks of other are deep-\/copied into this, using clone. 

References \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator()}}.



Referenced by \doxymbox{\hyperlink{classgko_1_1BlockOperator_a4066b33a9d42462429c76eea3f9532c1}{Block\+Operator()}}, \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator()}}, \doxymbox{\hyperlink{classgko_1_1BlockOperator_a6d7ad2c57e28354129a21e9e2098a85f}{operator=()}}, and \doxymbox{\hyperlink{classgko_1_1BlockOperator_a2b553db151f4260372d94d952bce4dfb}{operator=()}}.

\Hypertarget{classgko_1_1BlockOperator_a4066b33a9d42462429c76eea3f9532c1}\index{gko::BlockOperator@{gko::BlockOperator}!BlockOperator@{BlockOperator}}
\index{BlockOperator@{BlockOperator}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{BlockOperator()}{BlockOperator()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_a4066b33a9d42462429c76eea3f9532c1} 
gko::\+\+Block\+Operator::\+\+Block\+Operator (\begin{DoxyParamCaption}\item[{Block\+Operator \&\&}]{other}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [noexcept]}}



Move constructs a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. 

The executor of other is used for this. All remaining data of other is moved into this. After this operation, other will be empty. 

References \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator()}}.



\label{doc-func-members}
\Hypertarget{classgko_1_1BlockOperator_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1BlockOperator_a8ae64878f419a1719010efa49c660279}\index{gko::BlockOperator@{gko::BlockOperator}!block\_at@{block\_at}}
\index{block\_at@{block\_at}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{block\_at()}{block\_at()}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_a8ae64878f419a1719010efa49c660279} 
const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} \texorpdfstring{$\ast$}{*} gko::\+\+Block\+Operator::\+block\+\_\+at (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{i}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{j}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Const access to a specific block. 


\begin{DoxyParams}{Parameters}
{\em i} & block row. \\
\hline
{\em j} & block column.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the block stored at (i, j). 
\end{DoxyReturn}
\Hypertarget{classgko_1_1BlockOperator_af1263fd5f086a3dd4d72f0fb01db73c4}\index{gko::BlockOperator@{gko::BlockOperator}!create@{create}}
\index{create@{create}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_af1263fd5f086a3dd4d72f0fb01db73c4} 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} $>$ gko::\+\+Block\+Operator::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Create empty \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. 


\begin{DoxyParams}{Parameters}
{\em exec} & the executor of this.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
empty \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1BlockOperator_a3d78e60e7ed11202db89b00b16e50cca}\index{gko::BlockOperator@{gko::BlockOperator}!create@{create}}
\index{create@{create}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_a3d78e60e7ed11202db89b00b16e50cca} 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} $>$ gko::\+\+Block\+Operator::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{std::\+vector$<$ std::\+vector$<$ std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ $>$ $>$}]{blocks}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Create \doxylink{classgko_1_1BlockOperator}{Block\+Operator} from the given blocks. 


\begin{DoxyParams}{Parameters}
{\em exec} & the executor of this. \\
\hline
{\em blocks} & the blocks of this operator. The blocks will be used in a row-\/major form.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\doxylink{classgko_1_1BlockOperator}{Block\+Operator} with the given blocks. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1BlockOperator_a7c5a2afced62435443d0a6e5d67cc5f7}\index{gko::BlockOperator@{gko::BlockOperator}!get\_block\_size@{get\_block\_size}}
\index{get\_block\_size@{get\_block\_size}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{get\_block\_size()}{get\_block\_size()}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_a7c5a2afced62435443d0a6e5d67cc5f7} 
\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ gko::\+\+Block\+Operator::\+get\+\_\+block\+\_\+size (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the block dimension of this, i.\+e. 

the number of blocks per row and column.

\begin{DoxyReturn}{Returns}
The block dimension of this. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1BlockOperator_a6d7ad2c57e28354129a21e9e2098a85f}\index{gko::BlockOperator@{gko::BlockOperator}!operator=@{operator=}}
\index{operator=@{operator=}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_a6d7ad2c57e28354129a21e9e2098a85f} 
\doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \& gko::\+\+Block\+Operator::\+operator= (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \&\&}]{other}{}\end{DoxyParamCaption})}



Move assigns a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. 

The executor of this is not modified. All data of other (except its executor) is moved into this. If the executor of this and other differ, the blocks will be copied to the executor of this. After this operation, other will be empty. 

References \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator()}}.

\Hypertarget{classgko_1_1BlockOperator_a2b553db151f4260372d94d952bce4dfb}\index{gko::BlockOperator@{gko::BlockOperator}!operator=@{operator=}}
\index{operator=@{operator=}!gko::BlockOperator@{gko::BlockOperator}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1BlockOperator_a2b553db151f4260372d94d952bce4dfb} 
\doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \& gko::\+\+Block\+Operator::\+operator= (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator}} \&}]{other}{}\end{DoxyParamCaption})}



Copy assigns a \doxylink{classgko_1_1BlockOperator}{Block\+Operator}. 

The executor of this is not modified. The blocks of other are deep-\/copied into this, using clone. 

References \doxymbox{\hyperlink{classgko_1_1BlockOperator_acb8ff1788a332231a3e9f8199dec0d03}{Block\+Operator()}}.



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