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


This class is a utility which efficiently implements the identity matrix (a linear operator which maps each vector to itself).  




{\ttfamily \+\#include $<$ginkgo/\+core/\+matrix/\+identity.\+hpp$>$}



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


Collaboration diagram for gko::\+matrix::\+Identity\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1matrix_1_1Identity__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1matrix_1_1Identity_aa84aa862065ce17dde7941b77d0ca209}\label{classgko_1_1matrix_1_1Identity_aa84aa862065ce17dde7941b77d0ca209} 
using {\bfseries value\+\_\+type} = Value\+Type
\item 
\Hypertarget{classgko_1_1matrix_1_1Identity_a8a62bb88c4924ba1f9385e229417ec94}\label{classgko_1_1matrix_1_1Identity_a8a62bb88c4924ba1f9385e229417ec94} 
using {\bfseries transposed\+\_\+type} = Identity$<$Value\+Type$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Identity$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity_ab8e03f1121e194c79b82bb98e15ea03f}{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_1matrix_1_1Identity_a75a54f2d74087e57a275db5605cc7478}{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}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Identity$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
const Identity$<$ \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$<$ Identity$<$ 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*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static std::\+unique\+\_\+ptr$<$ Identity $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity_a55417b971157946c8f5f4f8d30b11aba}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, \doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ size)
\begin{DoxyCompactList}\small\item\em Creates an \doxylink{classgko_1_1matrix_1_1Identity}{Identity} matrix of the specified size. \end{DoxyCompactList}\item 
static std::\+unique\+\_\+ptr$<$ Identity $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity_aa69427eb2fd05e98813ee0c2353b455b}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} size=0)
\begin{DoxyCompactList}\small\item\em Creates an \doxylink{classgko_1_1matrix_1_1Identity}{Identity} matrix of the specified size. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1matrix_1_1Identity_ab9d7730057c8c909a698f79f71c901d8}\label{classgko_1_1matrix_1_1Identity_ab9d7730057c8c909a698f79f71c901d8} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Identity, Lin\+Op $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision$>$\newline
class gko::\+matrix::\+\+Identity$<$ Value\+Type $>$}
This class is a utility which efficiently implements the identity matrix (a linear operator which maps each vector to itself). 

Thus, objects of the \doxylink{classgko_1_1matrix_1_1Identity}{Identity} class always represent a square matrix, and don\textquotesingle{}t require any storage for their values. The apply method is implemented as a simple copy (or a linear combination).

\begin{DoxyNote}{Note}
This class is useful when composing it with other operators. For example, it can be used instead of a preconditioner in Krylov solvers, if one wants to run a "{}plain"{} solver, without using a preconditioner.
\end{DoxyNote}

\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & precision of matrix elements \\
\hline
\end{DoxyTemplParams}


\label{doc-func-members}
\Hypertarget{classgko_1_1matrix_1_1Identity_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1matrix_1_1Identity_a75a54f2d74087e57a275db5605cc7478}\index{gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}!conj\_transpose@{conj\_transpose}}
\index{conj\_transpose@{conj\_transpose}!gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{conj\_transpose()}{conj\_transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Identity_a75a54f2d74087e57a275db5605cc7478} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity}{gko::\+matrix::\+\+Identity}}$<$ 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_1matrix_1_1Identity_a55417b971157946c8f5f4f8d30b11aba}\index{gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}!create@{create}}
\index{create@{create}!gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Identity_a55417b971157946c8f5f4f8d30b11aba} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ Identity $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity}{gko::\+matrix::\+\+Identity}}$<$ Value\+Type $>$::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$}]{size}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates an \doxylink{classgko_1_1matrix_1_1Identity}{Identity} matrix of the specified size. 


\begin{DoxyParams}{Parameters}
{\em size} & size of the matrix (must be square) \\
\hline
\end{DoxyParams}
\Hypertarget{classgko_1_1matrix_1_1Identity_aa69427eb2fd05e98813ee0c2353b455b}\index{gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}!create@{create}}
\index{create@{create}!gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Identity_aa69427eb2fd05e98813ee0c2353b455b} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ Identity $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity}{gko::\+matrix::\+\+Identity}}$<$ Value\+Type $>$::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{size}{ = {\ttfamily 0}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates an \doxylink{classgko_1_1matrix_1_1Identity}{Identity} matrix of the specified size. 


\begin{DoxyParams}{Parameters}
{\em size} & size of the matrix \\
\hline
\end{DoxyParams}
\Hypertarget{classgko_1_1matrix_1_1Identity_ab8e03f1121e194c79b82bb98e15ea03f}\index{gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}!transpose@{transpose}}
\index{transpose@{transpose}!gko::matrix::Identity$<$ ValueType $>$@{gko::matrix::Identity$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{transpose()}{transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Identity_ab8e03f1121e194c79b82bb98e15ea03f} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Identity}{gko::\+matrix::\+\+Identity}}$<$ 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/\+matrix/\+identity.\+hpp\end{DoxyCompactItemize}
