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


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)}.  




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



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


Collaboration diagram for gko::\+Perturbation\texorpdfstring{$<$}{<} Value\+Type \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1Perturbation__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1Perturbation_a4cfdd76ca131540add0bd9d01cee1b5e}\label{classgko_1_1Perturbation_a4cfdd76ca131540add0bd9d01cee1b5e} 
using {\bfseries value\+\_\+type} = Value\+Type
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Perturbation$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
const std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation_a0de2213a0e5351749e090f3d2312ca02}{get\+\_\+basis}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the basis of the perturbation. \end{DoxyCompactList}\item 
const std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation_a217aee89800e8b2bc499b1b67d5345fc}{get\+\_\+projector}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the projector of the perturbation. \end{DoxyCompactList}\item 
const std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation_aa3a1a2c11ad2670e09384df7bce6eba5}{get\+\_\+scalar}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the scalar of the perturbation. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1Perturbation_af1063847549525244f7bb291d5c9c0c5}\label{classgko_1_1Perturbation_af1063847549525244f7bb291d5c9c0c5} 
Perturbation \& {\bfseries operator=} (const Perturbation \&other)
\item 
\Hypertarget{classgko_1_1Perturbation_a3067565c674bbce0e0c049e33f85d6f8}\label{classgko_1_1Perturbation_a3067565c674bbce0e0c049e33f85d6f8} 
Perturbation \& {\bfseries operator=} (Perturbation \&\&other)
\item 
\Hypertarget{classgko_1_1Perturbation_a66c8b39bf229c2a4b30cdd7692aa6062}\label{classgko_1_1Perturbation_a66c8b39bf229c2a4b30cdd7692aa6062} 
{\bfseries Perturbation} (const Perturbation \&other)
\item 
\Hypertarget{classgko_1_1Perturbation_af188870089e89df48fdb8be0f4647fde}\label{classgko_1_1Perturbation_af188870089e89df48fdb8be0f4647fde} 
{\bfseries Perturbation} (Perturbation \&\&other)
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Perturbation$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
const \doxymbox{\hyperlink{classgko_1_1Perturbation}{Perturbation}}$<$ \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$<$ Perturbation$<$ 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$<$ Perturbation $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation_a5140f0e3f2bc5d265c802f902ca903bf}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec)
\begin{DoxyCompactList}\small\item\em Creates an empty perturbation operator (0x0 operator). \end{DoxyCompactList}\item 
static std::\+unique\+\_\+ptr$<$ Perturbation $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation_a9c67e8e64a92899b7f4f0037e51e0db0}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ scalar, std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ basis)
\begin{DoxyCompactList}\small\item\em Creates a perturbation with scalar and basis by setting projector to the conjugate transpose of basis. \end{DoxyCompactList}\item 
static std::\+unique\+\_\+ptr$<$ Perturbation $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation_aa760012b6390cfba0b7923090f70f91f}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ scalar, std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ basis, std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ projector)
\begin{DoxyCompactList}\small\item\em Creates a perturbation of scalar, basis and projector. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableCreateMethod}{gko::\+\+Enable\+Create\+Method$<$ Perturbation$<$ default\+\_\+precision $>$ $>$}}}
\begin{DoxyCompactItemize}
\item 
static std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1Perturbation}{Perturbation}}$<$ \doxymbox{\hyperlink{namespacegko_a89637c833af7ae805802226d97cebebf}{default\+\_\+precision}} $>$ $>$ {\bfseries create} (Args \&\&... args)
\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1Perturbation_a7e9386180dd5369d21b42afab1c27562}\label{classgko_1_1Perturbation_a7e9386180dd5369d21b42afab1c27562} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Perturbation, Lin\+Op $>$}
\item 
\Hypertarget{classgko_1_1Perturbation_a13fd7967428770aca8d7f67ac2397215}\label{classgko_1_1Perturbation_a13fd7967428770aca8d7f67ac2397215} 
class {\bfseries Enable\+Create\+Method$<$ Perturbation $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Value\+Type = default\+\_\+precision$>$\newline
class gko::\+\+Perturbation$<$ Value\+Type $>$}
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)}. 

This operator adds a movement along a direction constructed by {\ttfamily basis} and {\ttfamily projector} on the \doxylink{classgko_1_1LinOp}{Lin\+Op}. {\ttfamily projector} gives the coefficient of {\ttfamily basis} to decide the direction.

For example, the Householder matrix can be represented with the \doxylink{classgko_1_1Perturbation}{Perturbation} operator as follows. If u is the Householder factor then we can generate the \href{https://en.wikipedia.org/wiki/Householder_transformation}{\texttt{Householder transformation}}, H = (I -\/ 2 u u\texorpdfstring{$\ast$}{*}). In this case, the parameters of \doxylink{classgko_1_1Perturbation}{Perturbation} class are scalar = -\/2, basis = u, and projector = u\texorpdfstring{$\ast$}{*}.


\begin{DoxyTemplParams}{Template Parameters}
{\em Value\+Type} & precision of input and result vectors\\
\hline
\end{DoxyTemplParams}
\begin{DoxyNote}{Note}
the apply operations of \doxylink{classgko_1_1Perturbation}{Perturbation} class are not thread safe 
\end{DoxyNote}


\label{doc-func-members}
\Hypertarget{classgko_1_1Perturbation_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1Perturbation_a5140f0e3f2bc5d265c802f902ca903bf}\index{gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}!create@{create}}
\index{create@{create}!gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \label{classgko_1_1Perturbation_a5140f0e3f2bc5d265c802f902ca903bf} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ Perturbation $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation}{gko::\+\+Perturbation}}$<$ Value\+Type $>$::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates an empty perturbation operator (0x0 operator). 


\begin{DoxyParams}{Parameters}
{\em exec} & \doxylink{classgko_1_1Executor}{Executor} associated to the perturbation\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A smart pointer to the newly created perturbation. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1Perturbation_a9c67e8e64a92899b7f4f0037e51e0db0}\index{gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}!create@{create}}
\index{create@{create}!gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \label{classgko_1_1Perturbation_a9c67e8e64a92899b7f4f0037e51e0db0} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ Perturbation $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation}{gko::\+\+Perturbation}}$<$ Value\+Type $>$::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$}]{scalar}{, }\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$}]{basis}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates a perturbation with scalar and basis by setting projector to the conjugate transpose of basis. 

Basis must be transposable. \doxylink{classgko_1_1Perturbation}{Perturbation} will throw \doxylink{classgko_1_1NotSupported}{gko::\+\+Not\+Supported} if basis is not transposable.


\begin{DoxyParams}{Parameters}
{\em scalar} & scaling of the movement \\
\hline
{\em basis} & the direction basis\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A smart pointer to the newly created perturbation. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1Perturbation_aa760012b6390cfba0b7923090f70f91f}\index{gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}!create@{create}}
\index{create@{create}!gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \label{classgko_1_1Perturbation_aa760012b6390cfba0b7923090f70f91f} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
std::\+unique\+\_\+ptr$<$ Perturbation $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation}{gko::\+\+Perturbation}}$<$ Value\+Type $>$::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$}]{scalar}{, }\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$}]{basis}{, }\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$}]{projector}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates a perturbation of scalar, basis and projector. 


\begin{DoxyParams}{Parameters}
{\em scalar} & scaling of the movement \\
\hline
{\em basis} & the direction basis \\
\hline
{\em projector} & decides the coefficient of basis\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A smart pointer to the newly created perturbation. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1Perturbation_a0de2213a0e5351749e090f3d2312ca02}\index{gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}!get\_basis@{get\_basis}}
\index{get\_basis@{get\_basis}!gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{get\_basis()}{get\_basis()}}
{\footnotesize\ttfamily \label{classgko_1_1Perturbation_a0de2213a0e5351749e090f3d2312ca02} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
const std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation}{gko::\+\+Perturbation}}$<$ Value\+Type $>$::\+get\+\_\+basis (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns the basis of the perturbation. 

\begin{DoxyReturn}{Returns}
the basis of the perturbation 
\end{DoxyReturn}
\Hypertarget{classgko_1_1Perturbation_a217aee89800e8b2bc499b1b67d5345fc}\index{gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}!get\_projector@{get\_projector}}
\index{get\_projector@{get\_projector}!gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{get\_projector()}{get\_projector()}}
{\footnotesize\ttfamily \label{classgko_1_1Perturbation_a217aee89800e8b2bc499b1b67d5345fc} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
const std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation}{gko::\+\+Perturbation}}$<$ Value\+Type $>$::\+get\+\_\+projector (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns the projector of the perturbation. 

\begin{DoxyReturn}{Returns}
the projector of the perturbation 
\end{DoxyReturn}
\Hypertarget{classgko_1_1Perturbation_aa3a1a2c11ad2670e09384df7bce6eba5}\index{gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}!get\_scalar@{get\_scalar}}
\index{get\_scalar@{get\_scalar}!gko::Perturbation$<$ ValueType $>$@{gko::Perturbation$<$ ValueType $>$}}
\doxysubsubsection{\texorpdfstring{get\_scalar()}{get\_scalar()}}
{\footnotesize\ttfamily \label{classgko_1_1Perturbation_aa3a1a2c11ad2670e09384df7bce6eba5} 
template$<$typename Value\+Type = default\+\_\+precision$>$ \\
const std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ \doxymbox{\hyperlink{classgko_1_1Perturbation}{gko::\+\+Perturbation}}$<$ Value\+Type $>$::\+get\+\_\+scalar (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns the scalar of the perturbation. 

\begin{DoxyReturn}{Returns}
the scalar of the perturbation 
\end{DoxyReturn}


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