\doxysection{Linear Operators }
\hypertarget{group__LinOp}{}\label{group__LinOp}\index{Linear Operators@{Linear Operators}}


A module dedicated to the implementation and usage of the Linear operators in Ginkgo.  


Collaboration diagram for Linear Operators:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{group__LinOp}
\end{center}
\end{figure}
\doxysubsubsection*{Topics}
\begin{DoxyCompactItemize}
\item 
\doxymbox{\hyperlink{group__factor}{Factorizations}}
\begin{DoxyCompactList}\small\item\em A module dedicated to the implementation and usage of the Factorizations in Ginkgo. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{group__mat__formats}{Sp\+MV employing different Matrix formats}}
\begin{DoxyCompactList}\small\item\em A module dedicated to the implementation and usage of the various Matrix Formats in Ginkgo. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{group__precond}{Preconditioners}}
\begin{DoxyCompactList}\small\item\em A module dedicated to the implementation and usage of the Preconditioners in Ginkgo. \end{DoxyCompactList}\item 
\doxymbox{\hyperlink{group__solvers}{Solvers}}
\begin{DoxyCompactList}\small\item\em A module dedicated to the implementation and usage of the Solvers in Ginkgo. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \doxymbox{\hyperlink{classgko_1_1Combination}{gko::\+\+Combination$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em 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}. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1Composition}{gko::\+\+Composition$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em 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}. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1LinOpFactory}{gko::\+\+Lin\+Op\+Factory}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOpFactory}{Lin\+Op\+Factory} represents a higher order mapping which transforms one linear operator into another. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1ReadableFromMatrixData}{gko::\+\+Readable\+From\+Matrix\+Data$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOp}{Lin\+Op} implementing this interface can read its data from a \doxylink{structgko_1_1matrix__data}{matrix\+\_\+data} structure. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1WritableToMatrixData}{gko::\+\+Writable\+To\+Matrix\+Data$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOp}{Lin\+Op} implementing this interface can write its data to a \doxylink{structgko_1_1matrix__data}{matrix\+\_\+data} structure. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1Preconditionable}{gko::\+\+Preconditionable}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOp}{Lin\+Op} implementing this interface can be preconditioned. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1DiagonalLinOpExtractable}{gko::\+\+Diagonal\+Lin\+Op\+Extractable}}
\begin{DoxyCompactList}\small\item\em The diagonal of a \doxylink{classgko_1_1LinOp}{Lin\+Op} can be extracted. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1DiagonalExtractable}{gko::\+\+Diagonal\+Extractable$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em The diagonal of a \doxylink{classgko_1_1LinOp}{Lin\+Op} implementing this interface can be extracted. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1EnableAbsoluteComputation}{gko::\+\+Enable\+Absolute\+Computation$<$ Absolute\+Lin\+Op $>$}}
\begin{DoxyCompactList}\small\item\em The \doxylink{classgko_1_1EnableAbsoluteComputation}{Enable\+Absolute\+Computation} mixin provides the default implementations of {\ttfamily \doxylink{classgko_1_1EnableAbsoluteComputation_a4cf4eedb2090f486bdef0a8717142b7c}{compute\+\_\+absolute\+\_\+linop}} and the absolute interface. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Concrete\+Lin\+Op, Polymorphic\+Base $>$}}
\begin{DoxyCompactList}\small\item\em The \doxylink{classgko_1_1EnableLinOp}{Enable\+Lin\+Op} mixin can be used to provide sensible default implementations of the majority of the \doxylink{classgko_1_1LinOp}{Lin\+Op} and \doxylink{classgko_1_1PolymorphicObject}{Polymorphic\+Object} interface. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1Perturbation}{gko::\+\+Perturbation$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em The \doxylink{classgko_1_1Perturbation}{Perturbation} class can be used to construct a \doxylink{classgko_1_1LinOp}{Lin\+Op} to represent the operation {\ttfamily (identity + scalar \texorpdfstring{$\ast$}{*} basis \texorpdfstring{$\ast$}{*} projector)}. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1experimental_1_1distributed_1_1preconditioner_1_1Schwarz}{gko::\+experimental::\+distributed::\+preconditioner::\+\+Schwarz$<$ Value\+Type, Local\+Index\+Type, Global\+Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1experimental_1_1distributed_1_1preconditioner_1_1Schwarz}{Schwarz} preconditioner is a simple domain decomposition preconditioner that generalizes the Block Jacobi preconditioner, incorporating options for different local subdomain solvers and overlaps between the subdomains. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1experimental_1_1distributed_1_1Vector}{gko::\+experimental::\+distributed::\+\+Vector$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1experimental_1_1distributed_1_1Vector}{Vector} is a format which explicitly stores (multiple) distributed column vectors in a dense storage format. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ic}{gko::\+factorization::\+\+Ic$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Represents an incomplete Cholesky factorization (IC(0)) of a sparse matrix. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1factorization_1_1Ilu}{gko::\+factorization::\+\+Ilu$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Represents an incomplete LU factorization -- ILU(0) -- of a sparse matrix. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1factorization_1_1ParIc}{gko::\+factorization::\+\+Par\+Ic$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Par\+IC is an incomplete Cholesky factorization which is computed in parallel. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1factorization_1_1ParIct}{gko::\+factorization::\+\+Par\+Ict$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Par\+ICT is an incomplete threshold-\/based Cholesky factorization which is computed in parallel. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1factorization_1_1ParIlu}{gko::\+factorization::\+\+Par\+Ilu$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Par\+ILU is an incomplete LU factorization which is computed in parallel. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1factorization_1_1ParIlut}{gko::\+factorization::\+\+Par\+Ilut$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Par\+ILUT is an incomplete threshold-\/based LU factorization which is computed in parallel. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Coo}{gko::\+matrix::\+\+Coo$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em COO stores a matrix in the coordinate matrix format. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Csr}{gko::\+matrix::\+\+Csr$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em CSR is a matrix format which stores only the nonzero coefficients by compressing each row of the matrix (compressed sparse row format). \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{gko::\+matrix::\+\+Dense$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1matrix_1_1Dense}{Dense} is a matrix format which explicitly stores all values of the matrix. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Diagonal}{gko::\+matrix::\+\+Diagonal$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em This class is a utility which efficiently implements the diagonal matrix (a linear operator which scales a vector row wise). \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Ell}{gko::\+matrix::\+\+Ell$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em ELL is a matrix format where stride with explicit zeros is used such that all rows have the same number of stored elements. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Fbcsr}{gko::\+matrix::\+\+Fbcsr$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Fixed-\/block compressed sparse row storage matrix format. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Fft}{gko::\+matrix::\+\+Fft}}
\begin{DoxyCompactList}\small\item\em This \doxylink{classgko_1_1LinOp}{Lin\+Op} implements a 1D Fourier matrix using the FFT algorithm. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Fft2}{gko::\+matrix::\+\+Fft2}}
\begin{DoxyCompactList}\small\item\em This \doxylink{classgko_1_1LinOp}{Lin\+Op} implements a 2D Fourier matrix using the FFT algorithm. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Fft3}{gko::\+matrix::\+\+Fft3}}
\begin{DoxyCompactList}\small\item\em This \doxylink{classgko_1_1LinOp}{Lin\+Op} implements a 3D Fourier matrix using the FFT algorithm. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Hybrid}{gko::\+matrix::\+\+Hybrid$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em HYBRID is a matrix format which splits the matrix into ELLPACK and COO format. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity}{gko::\+matrix::\+\+Identity$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em This class is a utility which efficiently implements the identity matrix (a linear operator which maps each vector to itself). \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1IdentityFactory}{gko::\+matrix::\+\+Identity\+Factory$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em This factory is a utility which can be used to generate \doxylink{classgko_1_1matrix_1_1Identity}{Identity} operators. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Permutation}{gko::\+matrix::\+\+Permutation$<$ Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1matrix_1_1Permutation}{Permutation} is a matrix format that represents a permutation matrix, i.\+e. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1RowGatherer}{gko::\+matrix::\+\+Row\+Gatherer$<$ Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1matrix_1_1RowGatherer}{Row\+Gatherer} is a matrix "{}format"{} which stores the gather indices arrays which can be used to gather rows to another matrix. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1ScaledPermutation}{gko::\+matrix::\+\+Scaled\+Permutation$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1matrix_1_1ScaledPermutation}{Scaled\+Permutation} is a matrix combining a permutation with scaling factors. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1Sellp}{gko::\+matrix::\+\+Sellp$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em SELL-\/P is a matrix format similar to ELL format. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1matrix_1_1SparsityCsr}{gko::\+matrix::\+\+Sparsity\+Csr$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1matrix_1_1SparsityCsr}{Sparsity\+Csr} is a matrix format which stores only the sparsity pattern of a sparse matrix by compressing each row of the matrix (compressed sparse row format). \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1multigrid_1_1FixedCoarsening}{gko::\+multigrid::\+\+Fixed\+Coarsening$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1multigrid_1_1FixedCoarsening}{Fixed\+Coarsening} is a very simple coarse grid generation algorithm. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1multigrid_1_1Pgm}{gko::\+multigrid::\+\+Pgm$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Parallel graph match (\doxylink{classgko_1_1multigrid_1_1Pgm}{Pgm}) is the aggregate method introduced in the paper M. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ic}{gko::\+preconditioner::\+\+Ic$<$ LSolver\+Type\+Or\+Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em The Incomplete Cholesky (IC) preconditioner solves the equation $LL^H*x = b$ for a given lower triangular matrix L and the right hand side b (can contain multiple right hand sides). \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Ilu}{gko::\+preconditioner::\+\+Ilu$<$ LSolver\+Type\+Or\+Value\+Type, USolver\+Type\+Or\+Value\+Type, Reverse\+Apply, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em The Incomplete LU (ILU) preconditioner solves the equation $LUx = b$ for a given lower triangular matrix L, an upper triangular matrix U and the right hand side b (can contain multiple right hand sides). \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Isai}{gko::\+preconditioner::\+\+Isai$<$ Isai\+Type, Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em The Incomplete Sparse Approximate Inverse (ISAI) Preconditioner generates an approximate inverse matrix for a given square matrix A, lower triangular matrix L, upper triangular matrix U or symmetric positive (spd) matrix B. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1preconditioner_1_1Jacobi}{gko::\+preconditioner::\+\+Jacobi$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em A block-\/\+Jacobi preconditioner is a block-\/diagonal linear operator, obtained by inverting the diagonal blocks of the source operator. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Bicg}{gko::\+solver::\+\+Bicg$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em BICG or the Biconjugate gradient method is a Krylov subspace solver. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Bicgstab}{gko::\+solver::\+\+Bicgstab$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em Bi\+CGSTAB or the Bi-\/\+Conjugate Gradient-\/\+Stabilized is a Krylov subspace solver. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1CbGmres}{gko::\+solver::\+\+Cb\+Gmres$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em CB-\/\+GMRES or the compressed basis generalized minimal residual method is an iterative type Krylov subspace method which is suitable for nonsymmetric linear systems. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Cg}{gko::\+solver::\+\+Cg$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em CG or the conjugate gradient method is an iterative type Krylov subspace method which is suitable for symmetric positive definite methods. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Cgs}{gko::\+solver::\+\+Cgs$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em CGS or the conjugate gradient square method is an iterative type Krylov subspace method which is suitable for general systems. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Chebyshev}{gko::\+solver::\+\+Chebyshev$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1solver_1_1Chebyshev}{Chebyshev} iteration is an iterative method for solving nonsymmetric problems based on some knowledge of the spectrum of the (preconditioned) system matrix. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Fcg}{gko::\+solver::\+\+Fcg$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em FCG or the flexible conjugate gradient method is an iterative type Krylov subspace method which is suitable for symmetric positive definite methods. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Gcr}{gko::\+solver::\+\+Gcr$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em GCR or the generalized conjugate residual method is an iterative type Krylov subspace method similar to GMRES which is suitable for nonsymmetric linear systems. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Gmres}{gko::\+solver::\+\+Gmres$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em GMRES or the generalized minimal residual method is an iterative type Krylov subspace method which is suitable for nonsymmetric linear systems. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Idr}{gko::\+solver::\+\+Idr$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em IDR(s) is an efficient method for solving large nonsymmetric systems of linear equations. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Minres}{gko::\+solver::\+\+Minres$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1solver_1_1Minres}{Minres} is an iterative type Krylov subspace method, which is suitable for indefinite and full-\/rank symmetric/\+hermitian operators. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid}{gko::\+solver::\+\+Multigrid}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1solver_1_1Multigrid}{Multigrid} methods have a hierarchy of many levels, whose corase level is a subset of the fine level, of the problem. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1PipeCg}{gko::\+solver::\+\+Pipe\+Cg$<$ Value\+Type $>$}}
\begin{DoxyCompactList}\small\item\em PIPE\+\_\+\+CG or the pipelined conjugate gradient method is an iterative type Krylov subspace method which is suitable for symmetric positive definite methods. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableSolverBase}{gko::\+solver::\+\+Enable\+Solver\+Base$<$ Derived\+Type, Matrix\+Type $>$}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOp}{Lin\+Op} deriving from this CRTP class stores a system matrix. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1IterativeBase}{gko::\+solver::\+\+Iterative\+Base}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOp}{Lin\+Op} implementing this interface stores a stopping criterion factory. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1EnableIterativeBase}{gko::\+solver::\+\+Enable\+Iterative\+Base$<$ Derived\+Type $>$}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOp}{Lin\+Op} deriving from this CRTP class stores a stopping criterion factory and allows applying with a guess. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1EnablePreconditionedIterativeSolver}{gko::\+solver::\+\+Enable\+Preconditioned\+Iterative\+Solver$<$ Value\+Type, Derived\+Type $>$}}
\begin{DoxyCompactList}\small\item\em A \doxylink{classgko_1_1LinOp}{Lin\+Op} implementing this interface stores a system matrix and stopping criterion factory. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1LowerTrs}{gko::\+solver::\+\+Lower\+Trs$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1solver_1_1LowerTrs}{Lower\+Trs} is the triangular solver which solves the system L x = b, when L is a lower triangular matrix. \end{DoxyCompactList}\item 
class \doxymbox{\hyperlink{classgko_1_1solver_1_1UpperTrs}{gko::\+solver::\+\+Upper\+Trs$<$ Value\+Type, Index\+Type $>$}}
\begin{DoxyCompactList}\small\item\em \doxylink{classgko_1_1solver_1_1UpperTrs}{Upper\+Trs} is the triangular solver which solves the system U x = b, when U is an upper triangular matrix. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\+\#define \doxymbox{\hyperlink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\+\_\+\+CREATE\+\_\+\+FACTORY\+\_\+\+PARAMETERS}}(\+\_\+parameters\+\_\+name,  \+\_\+factory\+\_\+name)
\begin{DoxyCompactList}\small\item\em This Macro will generate a new type containing the parameters for the factory {\ttfamily \+\_\+factory\+\_\+name}. \end{DoxyCompactList}\item 
\+\#define \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\+\_\+\+ENABLE\+\_\+\+BUILD\+\_\+\+METHOD}}(\+\_\+factory\+\_\+name)
\begin{DoxyCompactList}\small\item\em Defines a build method for the factory, simplifying its construction by removing the repetitive typing of factory\textquotesingle{}s name. \end{DoxyCompactList}\item 
\+\#define \doxymbox{\hyperlink{group__LinOp_gaa037309884bbd0562b897cee95dd91c8}{GKO\+\_\+\+FACTORY\+\_\+\+PARAMETER}}(\+\_\+name, ...)
\begin{DoxyCompactList}\small\item\em Creates a factory parameter in the factory parameters structure. \end{DoxyCompactList}\item 
\+\#define \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\+\_\+\+FACTORY\+\_\+\+PARAMETER\+\_\+\+SCALAR}}(\+\_\+name,  \+\_\+default)
\begin{DoxyCompactList}\small\item\em Creates a scalar factory parameter in the factory parameters structure. \end{DoxyCompactList}\item 
\+\#define \doxymbox{\hyperlink{group__LinOp_gaa292314d27ec1fb7ad54debaa3606ea8}{GKO\+\_\+\+FACTORY\+\_\+\+PARAMETER\+\_\+\+VECTOR}}(\+\_\+name, ...)
\begin{DoxyCompactList}\small\item\em Creates a vector factory parameter in the factory parameters structure. \end{DoxyCompactList}\item 
\+\#define \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\+\_\+\+ENABLE\+\_\+\+LIN\+\_\+\+OP\+\_\+\+FACTORY}}(\+\_\+lin\+\_\+op,  \+\_\+parameters\+\_\+name,  \+\_\+factory\+\_\+name)
\begin{DoxyCompactList}\small\item\em This macro will generate a default implementation of a Lin\+Op\+Factory for the Lin\+Op subclass it is defined in. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Concrete\+Factory, typename Concrete\+Lin\+Op, typename Parameters\+Type, typename Polymorphic\+Base = Lin\+Op\+Factory$>$ }\\using \doxymbox{\hyperlink{group__LinOp_gab1cdce0d622345d1322a2bc6bdcaa9b6}{gko::\+\+Enable\+Default\+Lin\+Op\+Factory}}
\begin{DoxyCompactList}\small\item\em This is an alias for the \doxylink{classgko_1_1EnableDefaultFactory}{Enable\+Default\+Factory} mixin, which correctly sets the template parameters to enable a subclass of \doxylink{classgko_1_1LinOpFactory}{Lin\+Op\+Factory}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Matrix, typename... TArgs$>$ }\\std::\+unique\+\_\+ptr$<$ Matrix $>$ \doxymbox{\hyperlink{group__LinOp_ga70851b4c3c9b01bb667b3a8e438fb6d2}{gko::\+initialize}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} stride, std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$ vals, std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, TArgs \&\&... create\+\_\+args)
\begin{DoxyCompactList}\small\item\em Creates and initializes a column-\/vector. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Matrix, typename... TArgs$>$ }\\std::\+unique\+\_\+ptr$<$ Matrix $>$ \doxymbox{\hyperlink{group__LinOp_ga97de1557afe54a2e9013f9f95f290387}{gko::\+initialize}} (std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$ vals, std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, TArgs \&\&... create\+\_\+args)
\begin{DoxyCompactList}\small\item\em Creates and initializes a column-\/vector. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Matrix, typename... TArgs$>$ }\\std::\+unique\+\_\+ptr$<$ Matrix $>$ \doxymbox{\hyperlink{group__LinOp_ga698f7e43f788413f45a6e91fd65d0c1e}{gko::\+initialize}} (\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} stride, std::\+initializer\+\_\+list$<$ std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$ $>$ vals, std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, TArgs \&\&... create\+\_\+args)
\begin{DoxyCompactList}\small\item\em Creates and initializes a matrix. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Matrix, typename... TArgs$>$ }\\std::\+unique\+\_\+ptr$<$ Matrix $>$ \doxymbox{\hyperlink{group__LinOp_ga858a8403f19e76ac1ded3c154a91d7eb}{gko::\+initialize}} (std::\+initializer\+\_\+list$<$ std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$ $>$ vals, std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, TArgs \&\&... create\+\_\+args)
\begin{DoxyCompactList}\small\item\em Creates and initializes a matrix. \end{DoxyCompactList}\item 
bool \doxymbox{\hyperlink{group__LinOp_ga92a31864b7c45b24d228a35a8a090b83}{gko::\+solver::\+apply\+\_\+uses\+\_\+initial\+\_\+guess}} () const override
\begin{DoxyCompactList}\small\item\em Iterative refinement (IR) is an iterative method that uses another coarse method to approximate the error of the current solution via the current residual. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A module dedicated to the implementation and usage of the Linear operators in Ginkgo. 

Below we elaborate on one of the most important concepts of Ginkgo, the linear operator. The linear operator (\doxylink{classgko_1_1LinOp}{Lin\+Op}) is a base class for all linear algebra objects in Ginkgo. The main benefit of having a single base class for the entire collection of linear algebra objects (as opposed to having separate hierarchies for matrices, solvers and preconditioners) is the generality it provides.\hypertarget{group__LinOp_linop_3}{}\doxysubsection{\texorpdfstring{Advantages of this approach and usage}{Advantages of this approach and usage}}\label{group__LinOp_linop_3}
A common interface often allows for writing more generic code. If a user\textquotesingle{}s routine requires only operations provided by the \doxylink{classgko_1_1LinOp}{Lin\+Op} interface, the same code can be used for any kind of linear operators, independent of whether these are matrices, solvers or preconditioners. This feature is also extensively used in Ginkgo itself. For example, a preconditioner used inside a Krylov solver is a \doxylink{classgko_1_1LinOp}{Lin\+Op}. This allows the user to supply a wide variety of preconditioners:\+ either the ones which were designed to be used in this scenario (like ILU or block-\/\+Jacobi), a user-\/supplied matrix which is known to be a good preconditioner for the specific problem, or even another solver (e.\+g., if constructing a flexible GMRES solver).

For example, a matrix free implementation would require the user to provide an apply implementation and instead of passing the generated matrix to the solver, they would have to provide their apply implementation for all the executors needed and no other code needs to be changed. See \doxysectlink{custom_matrix_format}{The custom-\/matrix-\/format program}{0} example for more details.\hypertarget{group__LinOp_linop_concept}{}\doxysubsection{\texorpdfstring{Linear operator as a concept}{Linear operator as a concept}}\label{group__LinOp_linop_concept}
The linear operator (\doxylink{classgko_1_1LinOp}{Lin\+Op}) is a base class for all linear algebra objects in Ginkgo. The main benefit of having a single base class for the entire collection of linear algebra objects (as opposed to having separate hierarchies for matrices, solvers and preconditioners) is the generality it provides.

First, since all subclasses provide a common interface, the library users are exposed to a smaller set of routines. For example, a matrix-\/vector product, a preconditioner application, or even a system solve are just different terms given to the operation of applying a certain linear operator to a vector. As such, Ginkgo uses the same routine name, \doxylink{classgko_1_1LinOp_a8aba659b97d7bb9ad0c1a0d385c28f28}{Lin\+Op::\+apply()} for each of these operations, where the actual operation performed depends on the type of linear operator involved in the operation.

Second, a common interface often allows for writing more generic code. If a user\textquotesingle{}s routine requires only operations provided by the \doxylink{classgko_1_1LinOp}{Lin\+Op} interface, the same code can be used for any kind of linear operators, independent of whether these are matrices, solvers or preconditioners. This feature is also extensively used in Ginkgo itself. For example, a preconditioner used inside a Krylov solver is a \doxylink{classgko_1_1LinOp}{Lin\+Op}. This allows the user to supply a wide variety of preconditioners:\+ either the ones which were designed to be used in this scenario (like ILU or block-\/\+Jacobi), a user-\/supplied matrix which is known to be a good preconditioner for the specific problem, or even another solver (e.\+g., if constructing a flexible GMRES solver).

A key observation for providing a unified interface for matrices, solvers, and preconditioners is that the most common operation performed on all of them can be expressed as an application of a linear operator to a vector:\+


\begin{DoxyItemize}
\item the sparse matrix-\/vector product with a matrix $A$ is a linear operator application $y = Ax$;
\item the application of a preconditioner is a linear operator application $y = M^{-1}x$, where $M$ is an approximation of the original system matrix $A$ (thus a preconditioner represents an "{}approximate        inverse"{} operator $M^{-1}$).
\item the system solve $Ax = b$ can be viewed as linear operator application $x = A^{-1}b$ (it goes without saying that the implementation of linear system solves does not follow this conceptual idea), so a linear system solver can be viewed as a representation of the operator $A^{-1}$.
\end{DoxyItemize}

Finally, direct manipulation of \doxylink{classgko_1_1LinOp}{Lin\+Op} objects is rarely required in simple scenarios. As an illustrative example, one could construct a fixed-\/point iteration routine $x_{k+1} = Lx_k + b$ as follows:\+


\begin{DoxyCode}{0}
\DoxyCodeLine{std::unique\_ptr<matrix::Dense<>>\ calculate\_fixed\_point(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ iters,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}\ *L,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<>}}\ *x0}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Dense}{matrix::Dense<>}}\ *b)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ x\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(x0);}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ tmp\ =\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{gko::clone}}(x0);}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{auto}\ \doxymbox{\hyperlink{namespacegko_a0059e27f8f4bc348ff65c1e60caf47c8}{one}}\ =\ Dense<>::create(L-\/>get\_executor(),\ \{1.0,\});}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ iters;\ ++i)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ L-\/>\doxymbox{\hyperlink{classgko_1_1LinOp_a8aba659b97d7bb9ad0c1a0d385c28f28}{apply}}(tmp,\ x);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ x-\/>add\_scaled(\doxymbox{\hyperlink{namespacegko_a0059e27f8f4bc348ff65c1e60caf47c8}{one}},\ b);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ tmp-\/>copy\_from(x);}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return}\ x;}
\DoxyCodeLine{\}}

\end{DoxyCode}


Here, if $L$ is a matrix, \doxylink{classgko_1_1LinOp_a8aba659b97d7bb9ad0c1a0d385c28f28}{Lin\+Op::\+apply()} refers to the matrix vector product, and {\ttfamily L-\/\texorpdfstring{$>$}{>}apply(a, b)} computes $b = L \cdot a$. {\ttfamily x-\/\texorpdfstring{$>$}{>}add\+\_\+scaled(one, b)} is the {\ttfamily axpy} vector update $x:=x+b$.

The interesting part of this example is the apply() routine at line 4 of the function body. Since this routine is part of the \doxylink{classgko_1_1LinOp}{Lin\+Op} base class, the fixed-\/point iteration routine can calculate a fixed point not only for matrices, but for any type of linear operator.

\doxylink{group__LinOp}{Linear Operators} 

\label{doc-define-members}
\Hypertarget{group__LinOp_doc-define-members}
\doxysubsection{Macro Definition Documentation}
\Hypertarget{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}\index{Linear Operators@{Linear Operators}!GKO\_CREATE\_FACTORY\_PARAMETERS@{GKO\_CREATE\_FACTORY\_PARAMETERS}}
\index{GKO\_CREATE\_FACTORY\_PARAMETERS@{GKO\_CREATE\_FACTORY\_PARAMETERS}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{GKO\_CREATE\_FACTORY\_PARAMETERS}{GKO\_CREATE\_FACTORY\_PARAMETERS}}
{\footnotesize\ttfamily \label{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358} 
\+\#define GKO\+\_\+\+CREATE\+\_\+\+FACTORY\+\_\+\+PARAMETERS(\begin{DoxyParamCaption}\item[{}]{\+\_\+parameters\+\_\+name}{, }\item[{}]{\+\_\+factory\+\_\+name}{}\end{DoxyParamCaption})}

{\bfseries Value:\+}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{public}:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{class\ }\_factory\_name;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{struct\ }\_parameters\_name\#\#\_type\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1enable__parameters__type}{::gko::enable\_parameters\_type}}<\_parameters\_name\#\#\_type,\ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_factory\_name>}

\end{DoxyCode}


This Macro will generate a new type containing the parameters for the factory {\ttfamily \+\_\+factory\+\_\+name}. 

For more details, see \doxylink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\+\_\+\+ENABLE\+\_\+\+LIN\+\_\+\+OP\+\_\+\+FACTORY()}. It is required to use this macro {\bfseries{before}} calling the macro \doxylink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\+\_\+\+ENABLE\+\_\+\+LIN\+\_\+\+OP\+\_\+\+FACTORY()}. It is also required to use the same names for all parameters between both macros.


\begin{DoxyParams}{Parameters}
{\em \+\_\+parameters\+\_\+name} & name of the parameters member in the class \\
\hline
{\em \+\_\+factory\+\_\+name} & name of the generated factory type \\
\hline
\end{DoxyParams}
\Hypertarget{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}\index{Linear Operators@{Linear Operators}!GKO\_ENABLE\_BUILD\_METHOD@{GKO\_ENABLE\_BUILD\_METHOD}}
\index{GKO\_ENABLE\_BUILD\_METHOD@{GKO\_ENABLE\_BUILD\_METHOD}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{GKO\_ENABLE\_BUILD\_METHOD}{GKO\_ENABLE\_BUILD\_METHOD}}
{\footnotesize\ttfamily \label{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c} 
\+\#define GKO\+\_\+\+ENABLE\+\_\+\+BUILD\+\_\+\+METHOD(\begin{DoxyParamCaption}\item[{}]{\+\_\+factory\+\_\+name}{}\end{DoxyParamCaption})}

{\bfseries Value:\+}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keyword}{auto}\ build()-\/>decltype(\_factory\_name::create())\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return}\ \_factory\_name::create();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{static\_assert(\textcolor{keyword}{true},\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}This\ assert\ is\ used\ to\ counter\ the\ false\ positive\ extra\ "{}}\ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}semi-\/colon\ warnings"{}})}

\end{DoxyCode}


Defines a build method for the factory, simplifying its construction by removing the repetitive typing of factory\textquotesingle{}s name. 


\begin{DoxyParams}{Parameters}
{\em \+\_\+factory\+\_\+name} & the factory for which to define the method \\
\hline
\end{DoxyParams}
\Hypertarget{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}\index{Linear Operators@{Linear Operators}!GKO\_ENABLE\_LIN\_OP\_FACTORY@{GKO\_ENABLE\_LIN\_OP\_FACTORY}}
\index{GKO\_ENABLE\_LIN\_OP\_FACTORY@{GKO\_ENABLE\_LIN\_OP\_FACTORY}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{GKO\_ENABLE\_LIN\_OP\_FACTORY}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}
{\footnotesize\ttfamily \label{group__LinOp_ga8e0af90ec2414b768266f77cedffc309} 
\+\#define GKO\+\_\+\+ENABLE\+\_\+\+LIN\+\_\+\+OP\+\_\+\+FACTORY(\begin{DoxyParamCaption}\item[{}]{\+\_\+lin\+\_\+op}{, }\item[{}]{\+\_\+parameters\+\_\+name}{, }\item[{}]{\+\_\+factory\+\_\+name}{}\end{DoxyParamCaption})}



This macro will generate a default implementation of a Lin\+Op\+Factory for the Lin\+Op subclass it is defined in. 

It is required to first call the macro \doxylink{group__LinOp_ga1fc8e9d8be0c9ad2d72bc1ddfc6d8358}{GKO\+\_\+\+CREATE\+\_\+\+FACTORY\+\_\+\+PARAMETERS()} before this one in order to instantiate the parameters type first.

The list of parameters for the factory should be defined in a code block after the macro definition, and should contain a list of GKO\+\_\+\+FACTORY\+\_\+\+PARAMETER\+\_\+\texorpdfstring{$\ast$}{*} declarations. The class should provide a constructor with signature \+\_\+lin\+\_\+op(const \+\_\+factory\+\_\+name \texorpdfstring{$\ast$}{*}, std::\+shared\+\_\+ptr$<$const Lin\+Op$>$) which the factory will use a callback to construct the object.

A minimal example of a linear operator is the following:\+


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{struct\ }MyLinOp\ :\ \textcolor{keyword}{public}\ EnableLinOp<MyLinOp>\ \{}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(MyLinOp,\ my\_parameters,\ Factory)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ a\ factory\ parameter\ named\ "{}my\_value"{},\ of\ type\ int\ and\ default}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ value\ of\ 5}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(my\_value,\ 5);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ a\ factory\ parameter\ named\ \`{}my\_pair`\ of\ type\ \`{}std::pair<int,int>`}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ and\ default\ value\ \{5,\ 5\}}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ std::pair<int,\ int>\ \doxymbox{\hyperlink{group__LinOp_gaa292314d27ec1fb7ad54debaa3606ea8}{GKO\_FACTORY\_PARAMETER\_VECTOR}}(my\_pair,\ 5,\ 5);}
\DoxyCodeLine{\ \ \ \ \};}
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ constructor\ needed\ by\ EnableLinOp}}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{explicit}\ MyLinOp(std::shared\_ptr<const\ Executor>\ exec)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ :\ EnableLinOp<MyLinOp>(exec)\ \{\}}
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ constructor\ needed\ by\ the\ factory}}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{explicit}\ MyLinOp(\textcolor{keyword}{const}\ Factory\ *factory,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ matrix)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ :\ EnableLinOp<MyLinOp>(\doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>get\_executor()),\ matrix-\/>get\_size()),}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ store\ factory's\ parameters\ locally}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ my\_parameters\_\{\doxymbox{\hyperlink{namespacegko_1_1log_a15f71654c6c4f4defc95f9359343fa27a9549dd6065d019211460c59a86dd6536}{factory}}-\/>get\_parameters()\},}
\DoxyCodeLine{\ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ value\ =\ my\_parameters\_.my\_value;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ do\ something\ with\ value}}
\DoxyCodeLine{\ \ \ \ \}}

\end{DoxyCode}


My\+Lin\+Op can then be created as follows:\+


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{auto}\ exec\ =\ gko::ReferenceExecutor::create();}
\DoxyCodeLine{\textcolor{comment}{//\ create\ a\ factory\ with\ default\ \`{}my\_value`\ parameter}}
\DoxyCodeLine{\textcolor{keyword}{auto}\ fact\ =\ MyLinOp::build().on(exec);}
\DoxyCodeLine{\textcolor{comment}{//\ create\ a\ operator\ using\ the\ factory:}}
\DoxyCodeLine{\textcolor{keyword}{auto}\ my\_op\ =\ fact-\/>generate(\doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity_a55417b971157946c8f5f4f8d30b11aba}{gko::matrix::Identity::create}}(exec,\ 2));}
\DoxyCodeLine{std::cout\ <<\ my\_op-\/>get\_my\_parameters().my\_value;\ \ \textcolor{comment}{//\ prints\ 5}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{//\ create\ a\ factory\ with\ custom\ \`{}my\_value`\ parameter}}
\DoxyCodeLine{\textcolor{keyword}{auto}\ fact\ =\ MyLinOp::build().with\_my\_value(0).on(exec);}
\DoxyCodeLine{\textcolor{comment}{//\ create\ a\ operator\ using\ the\ factory:}}
\DoxyCodeLine{\textcolor{keyword}{auto}\ my\_op\ =\ fact-\/>generate(\doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity_a55417b971157946c8f5f4f8d30b11aba}{gko::matrix::Identity::create}}(exec,\ 2));}
\DoxyCodeLine{std::cout\ <<\ my\_op-\/>get\_my\_parameters().my\_value;\ \ \textcolor{comment}{//\ prints\ 0}}

\end{DoxyCode}


\begin{DoxyNote}{Note}
It is possible to combine both the \+\#\+GKO\+\_\+\+CREATE\+\_\+\+FACTORY\+\_\+\+PARAMETER\+\_\+\texorpdfstring{$\ast$}{*}() macros with this one in a unique macro for class {\bfseries{templates}} (not with regular classes). Splitting this into two distinct macros allows to use them in all contexts. See \href{https://stackoverflow.com/q/50202718/9385966}{\texttt{https:\+/\+/\+stackoverflow.\+com/\+q/\+50202718/\+9385966}} for more details.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em \+\_\+lin\+\_\+op} & concrete operator for which the factory is to be created \+[CRTP parameter]\+ \\
\hline
{\em \+\_\+parameters\+\_\+name} & name of the parameters member in the class (its type is {\ttfamily \texorpdfstring{$<$}{<}\+\_\+parameters\+\_\+name\texorpdfstring{$>$}{>}\+\_\+type}, the protected member\textquotesingle{}s name is {\ttfamily \texorpdfstring{$<$}{<}\+\_\+parameters\+\_\+name\texorpdfstring{$>$}{>}\+\_\+}, and the public getter\textquotesingle{}s name is {\ttfamily get\+\_\+\texorpdfstring{$<$}{<}\+\_\+parameters\+\_\+name\texorpdfstring{$>$}{>}()}) \\
\hline
{\em \+\_\+factory\+\_\+name} & name of the generated factory type \\
\hline
\end{DoxyParams}
\Hypertarget{group__LinOp_gaa037309884bbd0562b897cee95dd91c8}\index{Linear Operators@{Linear Operators}!GKO\_FACTORY\_PARAMETER@{GKO\_FACTORY\_PARAMETER}}
\index{GKO\_FACTORY\_PARAMETER@{GKO\_FACTORY\_PARAMETER}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{GKO\_FACTORY\_PARAMETER}{GKO\_FACTORY\_PARAMETER}}
{\footnotesize\ttfamily \label{group__LinOp_gaa037309884bbd0562b897cee95dd91c8} 
\+\#define GKO\+\_\+\+FACTORY\+\_\+\+PARAMETER(\begin{DoxyParamCaption}\item[{}]{\+\_\+name}{, }\item[{}]{}...{}\end{DoxyParamCaption})}

{\bfseries Value:\+}
\begin{DoxyCode}{0}
\DoxyCodeLine{\_name\{\_\_VA\_ARGS\_\_\};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\textcolor{keyword}{template}\ <\textcolor{keyword}{typename}...\ Args>\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\textcolor{keyword}{auto}\ with\_\#\#\_name(Args\&\&...\ \_value)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ -\/>std::decay\_t<\textcolor{keyword}{decltype}(*(this-\/>self()))>\&\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{using\ }type\ =\ \textcolor{keyword}{decltype}(this-\/>\_name);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ this-\/>\_name\ =\ type\{std::forward<Args>(\_value)...\};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return}\ *(this-\/>self());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{static\_assert(\textcolor{keyword}{true},\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}This\ assert\ is\ used\ to\ counter\ the\ false\ positive\ extra\ "{}}\ \(\backslash\)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}semi-\/colon\ warnings"{}})}

\end{DoxyCode}


Creates a factory parameter in the factory parameters structure. 


\begin{DoxyParams}{Parameters}
{\em \+\_\+name} & name of the parameter \\
\hline
{\em \+\_\+\+\_\+\+VA\+\_\+\+ARGS\+\_\+\+\_\+} & default value of the parameter\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxylink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\+\_\+\+ENABLE\+\_\+\+LIN\+\_\+\+OP\+\_\+\+FACTORY} for more details, and usage example
\end{DoxySeeAlso}
\Hypertarget{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}\index{Linear Operators@{Linear Operators}!GKO\_FACTORY\_PARAMETER\_SCALAR@{GKO\_FACTORY\_PARAMETER\_SCALAR}}
\index{GKO\_FACTORY\_PARAMETER\_SCALAR@{GKO\_FACTORY\_PARAMETER\_SCALAR}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{GKO\_FACTORY\_PARAMETER\_SCALAR}{GKO\_FACTORY\_PARAMETER\_SCALAR}}
{\footnotesize\ttfamily \label{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450} 
\+\#define GKO\+\_\+\+FACTORY\+\_\+\+PARAMETER\+\_\+\+SCALAR(\begin{DoxyParamCaption}\item[{}]{\+\_\+name}{, }\item[{}]{\+\_\+default}{}\end{DoxyParamCaption})}

{\bfseries Value:\+}
\begin{DoxyCode}{0}
\DoxyCodeLine{\doxymbox{\hyperlink{group__LinOp_gaa037309884bbd0562b897cee95dd91c8}{GKO\_FACTORY\_PARAMETER}}(\_name,\ \_default)}

\end{DoxyCode}


Creates a scalar factory parameter in the factory parameters structure. 

Scalar in this context means that the constructor for this type only takes a single parameter.


\begin{DoxyParams}{Parameters}
{\em \+\_\+name} & name of the parameter \\
\hline
{\em \+\_\+default} & default value of the parameter\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxylink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\+\_\+\+ENABLE\+\_\+\+LIN\+\_\+\+OP\+\_\+\+FACTORY} for more details, and usage example 
\end{DoxySeeAlso}
\Hypertarget{group__LinOp_gaa292314d27ec1fb7ad54debaa3606ea8}\index{Linear Operators@{Linear Operators}!GKO\_FACTORY\_PARAMETER\_VECTOR@{GKO\_FACTORY\_PARAMETER\_VECTOR}}
\index{GKO\_FACTORY\_PARAMETER\_VECTOR@{GKO\_FACTORY\_PARAMETER\_VECTOR}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{GKO\_FACTORY\_PARAMETER\_VECTOR}{GKO\_FACTORY\_PARAMETER\_VECTOR}}
{\footnotesize\ttfamily \label{group__LinOp_gaa292314d27ec1fb7ad54debaa3606ea8} 
\+\#define GKO\+\_\+\+FACTORY\+\_\+\+PARAMETER\+\_\+\+VECTOR(\begin{DoxyParamCaption}\item[{}]{\+\_\+name}{, }\item[{}]{}...{}\end{DoxyParamCaption})}

{\bfseries Value:\+}
\begin{DoxyCode}{0}
\DoxyCodeLine{\doxymbox{\hyperlink{group__LinOp_gaa037309884bbd0562b897cee95dd91c8}{GKO\_FACTORY\_PARAMETER}}(\_name,\ \_\_VA\_ARGS\_\_)}

\end{DoxyCode}


Creates a vector factory parameter in the factory parameters structure. 

Vector in this context means that the constructor for this type takes multiple parameters.


\begin{DoxyParams}{Parameters}
{\em \+\_\+name} & name of the parameter \\
\hline
{\em \+\_\+default} & default value of the parameter\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxylink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\+\_\+\+ENABLE\+\_\+\+LIN\+\_\+\+OP\+\_\+\+FACTORY} for more details, and usage example 
\end{DoxySeeAlso}


\label{doc-typedef-members}
\Hypertarget{group__LinOp_doc-typedef-members}
\doxysubsection{Typedef Documentation}
\Hypertarget{group__LinOp_gab1cdce0d622345d1322a2bc6bdcaa9b6}\index{Linear Operators@{Linear Operators}!EnableDefaultLinOpFactory@{EnableDefaultLinOpFactory}}
\index{EnableDefaultLinOpFactory@{EnableDefaultLinOpFactory}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{EnableDefaultLinOpFactory}{EnableDefaultLinOpFactory}}
{\footnotesize\ttfamily \label{group__LinOp_gab1cdce0d622345d1322a2bc6bdcaa9b6} 
template$<$typename Concrete\+Factory, typename Concrete\+Lin\+Op, typename Parameters\+Type, typename Polymorphic\+Base = Lin\+Op\+Factory$>$ \\
using \doxymbox{\hyperlink{group__LinOp_gab1cdce0d622345d1322a2bc6bdcaa9b6}{gko::\+\+Enable\+Default\+Lin\+Op\+Factory}}}

{\bfseries Initial value:\+}
\begin{DoxyCode}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory}{EnableDefaultFactory}}<ConcreteFactory,\ ConcreteLinOp,\ ParametersType,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ PolymorphicBase>}

\end{DoxyCode}


This is an alias for the \doxylink{classgko_1_1EnableDefaultFactory}{Enable\+Default\+Factory} mixin, which correctly sets the template parameters to enable a subclass of \doxylink{classgko_1_1LinOpFactory}{Lin\+Op\+Factory}. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Concrete\+Factory} & the concrete factory which is being implemented \+[CRTP parameter]\+ \\
\hline
{\em Concrete\+Lin\+Op} & the concrete \doxylink{classgko_1_1LinOp}{Lin\+Op} type which this factory produces, needs to have a constructor which takes a const Concrete\+Factory \texorpdfstring{$\ast$}{*}, and an std::\+shared\+\_\+ptr$<$const Lin\+Op$>$ as parameters. \\
\hline
{\em Parameters\+Type} & a subclass of \doxylink{classgko_1_1enable__parameters__type}{enable\+\_\+parameters\+\_\+type} template which defines all of the parameters of the factory \\
\hline
{\em Polymorphic\+Base} & parent of Concrete\+Factory in the polymorphic hierarchy, has to be a subclass of \doxylink{classgko_1_1LinOpFactory}{Lin\+Op\+Factory} \\
\hline
\end{DoxyTemplParams}


\label{doc-func-members}
\Hypertarget{group__LinOp_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{group__LinOp_ga92a31864b7c45b24d228a35a8a090b83}\index{Linear Operators@{Linear Operators}!apply\_uses\_initial\_guess@{apply\_uses\_initial\_guess}}
\index{apply\_uses\_initial\_guess@{apply\_uses\_initial\_guess}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{apply\_uses\_initial\_guess()}{apply\_uses\_initial\_guess()}}
{\footnotesize\ttfamily \label{group__LinOp_ga92a31864b7c45b24d228a35a8a090b83} 
bool gko::\+solver::\+apply\+\_\+uses\+\_\+initial\+\_\+guess (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}}



Iterative refinement (IR) is an iterative method that uses another coarse method to approximate the error of the current solution via the current residual. 

Moreover, it can be also considered as preconditioned Richardson iteration with relaxation factor = 1.

For any approximation of the solution {\ttfamily solution} to the system {\ttfamily Ax = b}, the residual is defined as:\+ {\ttfamily residual = b -\/ A solution}. The error in {\ttfamily solution}, {\ttfamily e = x -\/ solution} (with {\ttfamily x} being the exact solution) can be obtained as the solution to the residual equation {\ttfamily Ae = residual}, since {\ttfamily A e = Ax -\/ A solution = b -\/ A solution = residual}. Then, the real solution is computed as {\ttfamily x = relaxation\+\_\+factor \texorpdfstring{$\ast$}{*} solution + e}. Instead of accurately solving the residual equation {\ttfamily Ae = residual}, the solution of the system {\ttfamily e} can be approximated to obtain the approximation {\ttfamily error} using a coarse method {\ttfamily \doxylink{namespacegko_1_1solver}{solver}}, which is used to update {\ttfamily solution}, and the entire process is repeated with the updated {\ttfamily solution}. This yields the iterative refinement method:\+


\begin{DoxyCode}{0}
\DoxyCodeLine{solution\ =\ initial\_guess}
\DoxyCodeLine{\textcolor{keywordflow}{while}\ not\ converged:}
\DoxyCodeLine{\ \ \ \ residual\ =\ b\ -\/\ A\ solution}
\DoxyCodeLine{\ \ \ \ error\ =\ \doxymbox{\hyperlink{namespacegko_1_1solver}{solver}}(A,\ residual)}
\DoxyCodeLine{\ \ \ \ solution\ =\ solution\ +\ relaxation\_factor\ *\ error}

\end{DoxyCode}


With {\ttfamily relaxation\+\_\+factor} equal to 1 (default), the solver is Iterative Refinement, with {\ttfamily relaxation\+\_\+factor} equal to a value other than {\ttfamily 1}, the solver is a Richardson iteration, with possibility for additional preconditioning.

Assuming that {\ttfamily \doxylink{namespacegko_1_1solver}{solver}} has accuracy {\ttfamily c}, i.\+e., {\ttfamily \texorpdfstring{$\vert$}{|} e -\/ error \texorpdfstring{$\vert$}{|} \texorpdfstring{$<$}{<}= c \texorpdfstring{$\vert$}{|} e \texorpdfstring{$\vert$}{|}}, iterative refinement will converge with a convergence rate of {\ttfamily c}. Indeed, from {\ttfamily e -\/ error = x -\/ solution -\/ error = x -\/ solution\texorpdfstring{$\ast$}{*}} (where {\ttfamily solution\texorpdfstring{$\ast$}{*}} denotes the value stored in {\ttfamily solution} after the update) and {\ttfamily e = inv(\+A) residual = inv(\+A)b -\/ inv(\+A) A solution = x -\/ solution} it follows that \texorpdfstring{$\vert$}{|} x -\/ solution\texorpdfstring{$\ast$}{*} \texorpdfstring{$\vert$}{|} \texorpdfstring{$<$}{<}= c \texorpdfstring{$\vert$}{|} x -\/ solution \texorpdfstring{$\vert$}{|}.

Unless otherwise specified via the {\ttfamily \doxylink{namespacegko_1_1solver}{solver}} factory parameter, this implementation uses the identity operator (i.\+e. the solver that approximates the solution of a system Ax = b by setting x :\+= b) as the default inner solver. Such a setting results in a relaxation method known as the Richardson iteration with parameter 1, which is guaranteed to converge for matrices whose spectrum is strictly contained within the unit disc around 1 (i.\+e., all its eigenvalues {\ttfamily lambda} have to satisfy the equation \`{}\texorpdfstring{$\vert$}{|}relaxation\+\_\+factor \texorpdfstring{$\ast$}{*} lambda -\/ 1\texorpdfstring{$\vert$}{|} \texorpdfstring{$<$}{<} 1).


\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & precision of matrix elements\\
\hline
\end{DoxyTemplParams}
\texorpdfstring{$\ast$}{*}/\+ template $<$typename Value\+Type = default\+\_\+precision$>$$>$ class Ir :\+ public \doxylink{classgko_1_1EnableLinOp}{Enable\+Lin\+Op$<$\+Ir$<$\+Value\+Type$>$$>$}, public \doxylink{classgko_1_1solver_1_1EnableSolverBase}{Enable\+Solver\+Base$<$\+Ir$<$\+Value\+Type$>$$>$}, public \doxylink{classgko_1_1solver_1_1EnableIterativeBase}{Enable\+Iterative\+Base$<$\+Ir$<$\+Value\+Type$>$$>$}, public \doxylink{classgko_1_1solver_1_1EnableApplyWithInitialGuess}{Enable\+Apply\+With\+Initial\+Guess$<$\+Ir$<$\+Value\+Type$>$$>$}, public \doxylink{classgko_1_1Transposable}{Transposable} \{ friend class \doxylink{classgko_1_1EnableLinOp}{Enable\+Lin\+Op$<$\+Ir$>$}; friend class \doxylink{classgko_1_1EnablePolymorphicObject}{Enable\+Polymorphic\+Object$<$\+Ir, Lin\+Op$>$}; friend class \doxylink{classgko_1_1solver_1_1EnableApplyWithInitialGuess}{Enable\+Apply\+With\+Initial\+Guess$<$\+Ir$>$}; static\+\_\+assert(::\+gko::\+detail::\+is\+\_\+supported\+\_\+value\+\_\+type$<$\+Value\+Type$>$::\+value, "{}\+Unsupported value type"{}) ;

public:\+ using value\+\_\+type = Value\+Type; using transposed\+\_\+type = Ir$<$\+Value\+Type$>$;

std::\+unique\+\_\+ptr$<$\+Lin\+Op$>$ transpose() const override;

std::\+unique\+\_\+ptr$<$\+Lin\+Op$>$ conj\+\_\+transpose() const override;

/\+\texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*} 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}


References \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa1f5f6080965ed6d0a90e6b9ec599e441}{provided}}.

\Hypertarget{group__LinOp_ga698f7e43f788413f45a6e91fd65d0c1e}\index{Linear Operators@{Linear Operators}!initialize@{initialize}}
\index{initialize@{initialize}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{initialize()}{initialize()}\hspace{0.1cm}{\footnotesize\ttfamily [1/4]}}
{\footnotesize\ttfamily \label{group__LinOp_ga698f7e43f788413f45a6e91fd65d0c1e} 
template$<$typename Matrix, typename... TArgs$>$ \\
std::\+unique\+\_\+ptr$<$ Matrix $>$ gko::\+initialize (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{stride}{, }\item[{std::\+initializer\+\_\+list$<$ std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$ $>$}]{vals}{, }\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{TArgs \&\&...}]{create\+\_\+args}{}\end{DoxyParamCaption})}



Creates and initializes a matrix. 

This function first creates a temporary Dense matrix, fills it with passed in values, and then converts the matrix to the requested type.


\begin{DoxyTemplParams}{Template Parameters}
{\em Matrix} & matrix type to initialize (Dense has to implement the Convertible\+To$<$\+Matrix$>$ interface) \\
\hline
{\em TArgs} & argument types for Matrix::\+create method (not including the implied \doxylink{classgko_1_1Executor}{Executor} as the first argument)\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em stride} & row stride for the temporary Dense matrix \\
\hline
{\em vals} & values used to initialize the matrix \\
\hline
{\em exec} & \doxylink{classgko_1_1Executor}{Executor} associated to the matrix \\
\hline
{\em create\+\_\+args} & additional arguments passed to Matrix::\+create, not including the \doxylink{classgko_1_1Executor}{Executor}, which is passed as the first argument \\
\hline
\end{DoxyParams}
\Hypertarget{group__LinOp_ga70851b4c3c9b01bb667b3a8e438fb6d2}\index{Linear Operators@{Linear Operators}!initialize@{initialize}}
\index{initialize@{initialize}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{initialize()}{initialize()}\hspace{0.1cm}{\footnotesize\ttfamily [2/4]}}
{\footnotesize\ttfamily \label{group__LinOp_ga70851b4c3c9b01bb667b3a8e438fb6d2} 
template$<$typename Matrix, typename... TArgs$>$ \\
std::\+unique\+\_\+ptr$<$ Matrix $>$ gko::\+initialize (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{stride}{, }\item[{std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$}]{vals}{, }\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{TArgs \&\&...}]{create\+\_\+args}{}\end{DoxyParamCaption})}



Creates and initializes a column-\/vector. 

This function first creates a temporary Dense matrix, fills it with passed in values, and then converts the matrix to the requested type.


\begin{DoxyTemplParams}{Template Parameters}
{\em Matrix} & matrix type to initialize (Dense has to implement the Convertible\+To$<$\+Matrix$>$ interface) \\
\hline
{\em TArgs} & argument types for Matrix::\+create method (not including the implied \doxylink{classgko_1_1Executor}{Executor} as the first argument)\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em stride} & row stride for the temporary Dense matrix \\
\hline
{\em vals} & values used to initialize the vector \\
\hline
{\em exec} & \doxylink{classgko_1_1Executor}{Executor} associated to the vector \\
\hline
{\em create\+\_\+args} & additional arguments passed to Matrix::\+create, not including the \doxylink{classgko_1_1Executor}{Executor}, which is passed as the first argument \\
\hline
\end{DoxyParams}


Referenced by \doxymbox{\hyperlink{classgko_1_1log_1_1ProfilerHook_a901375406301386b0374a6dab8b16597}{gko::\+log::\+\+Profiler\+Hook::\+create\+\_\+tau()}}, \doxymbox{\hyperlink{group__LinOp_ga858a8403f19e76ac1ded3c154a91d7eb}{initialize()}}, and \doxymbox{\hyperlink{group__LinOp_ga97de1557afe54a2e9013f9f95f290387}{initialize()}}.

\Hypertarget{group__LinOp_ga858a8403f19e76ac1ded3c154a91d7eb}\index{Linear Operators@{Linear Operators}!initialize@{initialize}}
\index{initialize@{initialize}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{initialize()}{initialize()}\hspace{0.1cm}{\footnotesize\ttfamily [3/4]}}
{\footnotesize\ttfamily \label{group__LinOp_ga858a8403f19e76ac1ded3c154a91d7eb} 
template$<$typename Matrix, typename... TArgs$>$ \\
std::\+unique\+\_\+ptr$<$ Matrix $>$ gko::\+initialize (\begin{DoxyParamCaption}\item[{std::\+initializer\+\_\+list$<$ std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$ $>$}]{vals}{, }\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{TArgs \&\&...}]{create\+\_\+args}{}\end{DoxyParamCaption})}



Creates and initializes a matrix. 

This function first creates a temporary Dense matrix, fills it with passed in values, and then converts the matrix to the requested type. The stride of the intermediate Dense matrix is set to the number of columns of the initializer list.


\begin{DoxyTemplParams}{Template Parameters}
{\em Matrix} & matrix type to initialize (Dense has to implement the Convertible\+To$<$\+Matrix$>$ interface) \\
\hline
{\em TArgs} & argument types for Matrix::\+create method (not including the implied \doxylink{classgko_1_1Executor}{Executor} as the first argument)\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em vals} & values used to initialize the matrix \\
\hline
{\em exec} & \doxylink{classgko_1_1Executor}{Executor} associated to the matrix \\
\hline
{\em create\+\_\+args} & additional arguments passed to Matrix::\+create, not including the \doxylink{classgko_1_1Executor}{Executor}, which is passed as the first argument \\
\hline
\end{DoxyParams}


References \doxymbox{\hyperlink{group__LinOp_ga70851b4c3c9b01bb667b3a8e438fb6d2}{initialize()}}.

\Hypertarget{group__LinOp_ga97de1557afe54a2e9013f9f95f290387}\index{Linear Operators@{Linear Operators}!initialize@{initialize}}
\index{initialize@{initialize}!Linear Operators@{Linear Operators}}
\doxysubsubsection{\texorpdfstring{initialize()}{initialize()}\hspace{0.1cm}{\footnotesize\ttfamily [4/4]}}
{\footnotesize\ttfamily \label{group__LinOp_ga97de1557afe54a2e9013f9f95f290387} 
template$<$typename Matrix, typename... TArgs$>$ \\
std::\+unique\+\_\+ptr$<$ Matrix $>$ gko::\+initialize (\begin{DoxyParamCaption}\item[{std::\+initializer\+\_\+list$<$ typename Matrix::\+value\+\_\+type $>$}]{vals}{, }\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{TArgs \&\&...}]{create\+\_\+args}{}\end{DoxyParamCaption})}



Creates and initializes a column-\/vector. 

This function first creates a temporary Dense matrix, fills it with passed in values, and then converts the matrix to the requested type. The stride of the intermediate Dense matrix is set to 1.


\begin{DoxyTemplParams}{Template Parameters}
{\em Matrix} & matrix type to initialize (Dense has to implement the Convertible\+To$<$\+Matrix$>$ interface) \\
\hline
{\em TArgs} & argument types for Matrix::\+create method (not including the implied \doxylink{classgko_1_1Executor}{Executor} as the first argument)\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em vals} & values used to initialize the vector \\
\hline
{\em exec} & \doxylink{classgko_1_1Executor}{Executor} associated to the vector \\
\hline
{\em create\+\_\+args} & additional arguments passed to Matrix::\+create, not including the \doxylink{classgko_1_1Executor}{Executor}, which is passed as the first argument \\
\hline
\end{DoxyParams}


References \doxymbox{\hyperlink{group__LinOp_ga70851b4c3c9b01bb667b3a8e438fb6d2}{initialize()}}.

\input{group__factor}
\input{group__mat__formats}
\input{group__precond}
\input{group__solvers}
