\doxysection{gko::\+batch::\+Batch\+Lin\+Op\+Factory Class Reference}
\hypertarget{classgko_1_1batch_1_1BatchLinOpFactory}{}\label{classgko_1_1batch_1_1BatchLinOpFactory}\index{gko::batch::BatchLinOpFactory@{gko::batch::BatchLinOpFactory}}


A \doxylink{classgko_1_1batch_1_1BatchLinOpFactory}{Batch\+Lin\+Op\+Factory} represents a higher order mapping which transforms one batch linear operator into another.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+base/\+batch\+\_\+lin\+\_\+op.\+hpp$>$}



Inheritance diagram for gko::\+batch::\+Batch\+Lin\+Op\+Factory:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1batch_1_1BatchLinOpFactory__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+batch::\+Batch\+Lin\+Op\+Factory:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1batch_1_1BatchLinOpFactory__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1batch_1_1BatchLinOpFactory_accacc0a68673314a9b2fb554542d9e1c}\label{classgko_1_1batch_1_1BatchLinOpFactory_accacc0a68673314a9b2fb554542d9e1c} 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1batch_1_1BatchLinOp}{Batch\+Lin\+Op}} $>$ {\bfseries generate} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1batch_1_1BatchLinOp}{Batch\+Lin\+Op}} $>$ input) const
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A \doxylink{classgko_1_1batch_1_1BatchLinOpFactory}{Batch\+Lin\+Op\+Factory} represents a higher order mapping which transforms one batch linear operator into another. 

In a similar fashion to Lin\+Ops, Batch\+Lin\+Ops are also "{}generated"{} from the \doxylink{classgko_1_1batch_1_1BatchLinOpFactory}{Batch\+Lin\+Op\+Factory}. A function of this class is to provide a generate method, which internally cals the generate\+\_\+impl(), which the concrete Batch\+Lin\+Ops have to implement.\hypertarget{classgko_1_1batch_1_1BatchLinOpFactory_autotoc_md71}{}\doxysubsubsection{\texorpdfstring{Example:\+ using Batch\+CG in Ginkgo}{Example:\+ using Batch\+CG in Ginkgo}}\label{classgko_1_1batch_1_1BatchLinOpFactory_autotoc_md71}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{//\ Suppose\ A\ is\ a\ batch\ matrix,\ batch\_b,\ a\ batch\ rhs\ vector,\ and\ batch\_x,\ an}}
\DoxyCodeLine{\textcolor{comment}{//\ initial\ guess}}
\DoxyCodeLine{\textcolor{comment}{//\ Create\ a\ BatchCG\ which\ runs\ for\ at\ most\ 1000\ iterations,\ and\ stops\ after}}
\DoxyCodeLine{\textcolor{comment}{//\ reducing\ the\ residual\ norm\ by\ 6\ orders\ of\ magnitude}}
\DoxyCodeLine{\textcolor{keyword}{auto}\ batch\_cg\_factory\ =\ solver::BatchCg<>::build()}
\DoxyCodeLine{\ \ \ \ .with\_max\_iters(1000)}
\DoxyCodeLine{\ \ \ \ .with\_rel\_residual\_goal(1e-\/6)}
\DoxyCodeLine{\ \ \ \ .on(cuda);}
\DoxyCodeLine{\textcolor{comment}{//\ create\ a\ batch\ linear\ operator\ which\ represents\ the\ solver}}
\DoxyCodeLine{\textcolor{keyword}{auto}\ batch\_cg\ =\ batch\_cg\_factory-\/>generate(A);}
\DoxyCodeLine{\textcolor{comment}{//\ solve\ the\ system}}
\DoxyCodeLine{batch\_cg-\/>apply(batch\_b,\ batch\_x);}

\end{DoxyCode}
 

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