\doxysection{gko::\+matrix::\+Fft2 Class Reference}
\hypertarget{classgko_1_1matrix_1_1Fft2}{}\label{classgko_1_1matrix_1_1Fft2}\index{gko::matrix::Fft2@{gko::matrix::Fft2}}


This \doxylink{classgko_1_1LinOp}{Lin\+Op} implements a 2D Fourier matrix using the FFT algorithm.  




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



Inheritance diagram for gko::\+matrix::\+Fft2:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1matrix_1_1Fft2__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+matrix::\+Fft2:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1matrix_1_1Fft2__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_a3cbd206359c5e130cc58881c3a709e7c}\label{classgko_1_1matrix_1_1Fft2_a3cbd206359c5e130cc58881c3a709e7c} 
using {\bfseries value\+\_\+type} = std::\+complex$<$double$>$
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_a7b067d4578c0405f0c31fe5b1ef46689}\label{classgko_1_1matrix_1_1Fft2_a7b067d4578c0405f0c31fe5b1ef46689} 
using {\bfseries index\+\_\+type} = \doxymbox{\hyperlink{namespacegko_a913ec044df518649fa5a891f8dffae34}{int64}}
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_ac507265ee420b81b421a28756b925279}\label{classgko_1_1matrix_1_1Fft2_ac507265ee420b81b421a28756b925279} 
using {\bfseries transposed\+\_\+type} = Fft2
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Fft2 $>$}}}
\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_1Fft2_ab8d8067830d29ce7af252e5c917c39ad}{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_1Fft2_aaab750e26fcd9d0d8fd731b80312c29a}{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}\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_a0e1073d35eb18ca8413722eb21a0060b}\label{classgko_1_1matrix_1_1Fft2_a0e1073d35eb18ca8413722eb21a0060b} 
void {\bfseries write} (\doxymbox{\hyperlink{structgko_1_1matrix__data}{matrix\+\_\+data}}$<$ std::\+complex$<$ float $>$, \doxymbox{\hyperlink{namespacegko_a16bd14c10900eb804d784908d8aab5ab}{int32}} $>$ \&data) const override
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_a7ed24e68021f93018c6ad3a05d7bcb28}\label{classgko_1_1matrix_1_1Fft2_a7ed24e68021f93018c6ad3a05d7bcb28} 
void {\bfseries write} (\doxymbox{\hyperlink{structgko_1_1matrix__data}{matrix\+\_\+data}}$<$ std::\+complex$<$ float $>$, \doxymbox{\hyperlink{namespacegko_a913ec044df518649fa5a891f8dffae34}{int64}} $>$ \&data) const override
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_ab18446f1deb8d7f1ea5d656396d17b65}\label{classgko_1_1matrix_1_1Fft2_ab18446f1deb8d7f1ea5d656396d17b65} 
void {\bfseries write} (\doxymbox{\hyperlink{structgko_1_1matrix__data}{matrix\+\_\+data}}$<$ std::\+complex$<$ double $>$, \doxymbox{\hyperlink{namespacegko_a16bd14c10900eb804d784908d8aab5ab}{int32}} $>$ \&data) const override
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_aa0dee862c79ca6f9deae59ca8af6d437}\label{classgko_1_1matrix_1_1Fft2_aa0dee862c79ca6f9deae59ca8af6d437} 
void {\bfseries write} (\doxymbox{\hyperlink{structgko_1_1matrix__data}{matrix\+\_\+data}}$<$ std::\+complex$<$ double $>$, \doxymbox{\hyperlink{namespacegko_a913ec044df518649fa5a891f8dffae34}{int64}} $>$ \&data) const override
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_afd14c06036323ab7056d8004af15cb16}\label{classgko_1_1matrix_1_1Fft2_afd14c06036323ab7056d8004af15cb16} 
\doxymbox{\hyperlink{structgko_1_1dim}{dim}}$<$ 2 $>$ {\bfseries get\+\_\+fft\+\_\+size} () const
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_a3482ac258bd52cfc43b76fa0bffc4665}\label{classgko_1_1matrix_1_1Fft2_a3482ac258bd52cfc43b76fa0bffc4665} 
bool {\bfseries is\+\_\+inverse} () const
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{gko::\+\+Enable\+Lin\+Op$<$ Fft2 $>$}}}
\begin{DoxyCompactItemize}
\item 
const Fft2 \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$<$ Fft2 $>$}}}
\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$<$ Fft2 $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Fft2_a3866d9c166cd99ee5bfa2c9f26d38fd7}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec)
\begin{DoxyCompactList}\small\item\em Creates an empty Fourier matrix. \end{DoxyCompactList}\item 
static std::\+unique\+\_\+ptr$<$ Fft2 $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Fft2_a665ee7b9871b5084de4c1f2278984ada}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} size)
\begin{DoxyCompactList}\small\item\em Creates an Fourier matrix with the given dimensions. \end{DoxyCompactList}\item 
static std::\+unique\+\_\+ptr$<$ Fft2 $>$ \doxymbox{\hyperlink{classgko_1_1matrix_1_1Fft2_a4f307f1877e99d1285e1be0c4e3b13a7}{create}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} size1, \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}} size2, bool inverse=false)
\begin{DoxyCompactList}\small\item\em Creates an Fourier matrix with the given dimensions. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1matrix_1_1Fft2_a15be635951799f4200867407f75d406c}\label{classgko_1_1matrix_1_1Fft2_a15be635951799f4200867407f75d406c} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Fft2, Lin\+Op $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This \doxylink{classgko_1_1LinOp}{Lin\+Op} implements a 2D Fourier matrix using the FFT algorithm. 

For indexing purposes, the first dimension is the major axis.

It implements complex-\/to-\/complex forward and inverse FFT.

For a power-\/of-\/two sizes $n_1, n_2$ with corresponding root of unity $\omega = e^{-2\pi i / (n_1 n_2)}$ for forward DFT and $\omega = e^{2 \pi i / (n_1 n_2)}$ for inverse DFT it computes

\[    x_{k_1 n_2 + k_2} = \sum_{i_1=0}^{n_1-1} \sum_{i_2=0}^{n_2-1}
                          \omega^{i_1 k_1 + i_2 k_2} b_{i_1 n_2 + i_2}
\]

without normalization factors.

The Reference and Open\+MP implementations support only power-\/of-\/two input sizes, as they use the Radix-\/2 algorithm by J. W. Cooley and J. W. Tukey, "{}\+An Algorithm for the Machine Calculation of Complex Fourier Series,"{} Mathematics of Computation, vol. 19, no. 90, pp. 297–301, 1965, doi:\+ 10.\+2307/\+2003354. The CUDA and HIP implementations use cu\+SPARSE/\+hip\+SPARSE with full support for non-\/power-\/of-\/two input sizes and special optimizations for products of small prime powers. 

\label{doc-func-members}
\Hypertarget{classgko_1_1matrix_1_1Fft2_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1matrix_1_1Fft2_aaab750e26fcd9d0d8fd731b80312c29a}\index{gko::matrix::Fft2@{gko::matrix::Fft2}!conj\_transpose@{conj\_transpose}}
\index{conj\_transpose@{conj\_transpose}!gko::matrix::Fft2@{gko::matrix::Fft2}}
\doxysubsubsection{\texorpdfstring{conj\_transpose()}{conj\_transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Fft2_aaab750e26fcd9d0d8fd731b80312c29a} 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ gko::\+matrix::\+\+Fft2::\+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_1Fft2_a3866d9c166cd99ee5bfa2c9f26d38fd7}\index{gko::matrix::Fft2@{gko::matrix::Fft2}!create@{create}}
\index{create@{create}!gko::matrix::Fft2@{gko::matrix::Fft2}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Fft2_a3866d9c166cd99ee5bfa2c9f26d38fd7} 
std::\+unique\+\_\+ptr$<$ Fft2 $>$ gko::\+matrix::\+\+Fft2::\+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 Fourier matrix. 


\begin{DoxyParams}{Parameters}
{\em exec} & \doxylink{classgko_1_1Executor}{Executor} associated to the matrix\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A smart pointer to the newly created matrix. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1matrix_1_1Fft2_a665ee7b9871b5084de4c1f2278984ada}\index{gko::matrix::Fft2@{gko::matrix::Fft2}!create@{create}}
\index{create@{create}!gko::matrix::Fft2@{gko::matrix::Fft2}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Fft2_a665ee7b9871b5084de4c1f2278984ada} 
std::\+unique\+\_\+ptr$<$ Fft2 $>$ gko::\+matrix::\+\+Fft2::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{size}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates an Fourier matrix with the given dimensions. 


\begin{DoxyParams}{Parameters}
{\em size} & size of both FFT dimensions\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A smart pointer to the newly created matrix. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1matrix_1_1Fft2_a4f307f1877e99d1285e1be0c4e3b13a7}\index{gko::matrix::Fft2@{gko::matrix::Fft2}!create@{create}}
\index{create@{create}!gko::matrix::Fft2@{gko::matrix::Fft2}}
\doxysubsubsection{\texorpdfstring{create()}{create()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Fft2_a4f307f1877e99d1285e1be0c4e3b13a7} 
std::\+unique\+\_\+ptr$<$ Fft2 $>$ gko::\+matrix::\+\+Fft2::\+create (\begin{DoxyParamCaption}\item[{std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$}]{exec}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{size1}{, }\item[{\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\+\_\+type}}}]{size2}{, }\item[{bool}]{inverse}{ = {\ttfamily false}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates an Fourier matrix with the given dimensions. 


\begin{DoxyParams}{Parameters}
{\em size1} & size of the first FFT dimension \\
\hline
{\em size2} & size of the second FFT dimension \\
\hline
{\em inverse} & true to compute an inverse DFT instead of a normal DFT\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A smart pointer to the newly created matrix. 
\end{DoxyReturn}
\Hypertarget{classgko_1_1matrix_1_1Fft2_ab8d8067830d29ce7af252e5c917c39ad}\index{gko::matrix::Fft2@{gko::matrix::Fft2}!transpose@{transpose}}
\index{transpose@{transpose}!gko::matrix::Fft2@{gko::matrix::Fft2}}
\doxysubsubsection{\texorpdfstring{transpose()}{transpose()}}
{\footnotesize\ttfamily \label{classgko_1_1matrix_1_1Fft2_ab8d8067830d29ce7af252e5c917c39ad} 
std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1LinOp}{Lin\+Op}} $>$ gko::\+matrix::\+\+Fft2::\+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/\+fft.\+hpp\end{DoxyCompactItemize}
