From d58224abd5f73e5afe43278185fc050e4370c3a1 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Fri, 20 Aug 2021 10:12:26 +0200 Subject: [PATCH] listed all the API methods --- api.tex | 210 ++++++++++++++++++++++++++++++++++++++++++--- future.tex | 11 +++ gsoc-report.tex | 2 + implementation.tex | 1 + makefile | 2 +- quickstart.tex | 7 +- 6 files changed, 219 insertions(+), 14 deletions(-) create mode 100644 future.tex create mode 100644 implementation.tex diff --git a/api.tex b/api.tex index 2ad9b07..8a78f24 100644 --- a/api.tex +++ b/api.tex @@ -44,6 +44,205 @@ \section{Detailed API} and \verb|halfcomplex_to_real| respectively, where the halfcomplex part is represented in an array of $n$ complex numbers, hence keeping redundant values. +\subsection{Complex \dft} + +\begin{lstlisting}[language=C++] +template< class Complex = std::complex, + class Allocator = std::allocator > +class bsl_dft; +\end{lstlisting} + +The backends \verb|gsl_dft| and \verb|fftw_dft| behave in the same way as +\verb|bsl_dft|. + +\subsubsection{Member functions} + +\begin{lstlisting}[language=C++] +template< class Complex, class Allocator > +constexpr bsl_dft::bsl_dft( + unsigned int n, const Allocator& alloc = Allocator{} ); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void forward(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void backward(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +constexpr std::size_t size() const; +\end{lstlisting} +\begin{lstlisting}[language=C++] +void resize(std::size_t new_size); +\end{lstlisting} + +\subsubsection{One-time transform methods} + +\begin{lstlisting}[language=C++] +template +void bsl_transform::forward(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void bsl_transform::backward(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} + +\subsection{Algebraic \dft} + +\begin{lstlisting}[language=C++] +template< class T = std::complex, + class Allocator = std::allocator > +class bsl_algebraic_dft; +\end{lstlisting} + +Remark: \gsl\ and \fftw\ libraries do not have the equivalent to this type of +transform. + +\subsubsection{Member functions} + +\begin{lstlisting}[language=C++] +template< class T, class Allocator > +constexpr bsl_algebraic_dft::bsl_algebraic_dft( + unsigned int n, T w, const Allocator& alloc = Allocator{} ); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void forward(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void backward(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +constexpr std::size_t size() const; +\end{lstlisting} + +% The fact is that the algebraic_dft does have a resize method, but resizing the +% DFT here must be followed with a change of the internal root of unity w. A +% correct resize method here requires two arguments: the new size and the new +% value of w. +% \begin{lstlisting}[language=C++] +% void resize(std::size_t new_size); +% \end{lstlisting} + +\subsubsection{One-time transform methods} + +\begin{lstlisting}[language=C++] +template +void bsl_algebraic_transform::forward( + InputIt first1, InputIt last1, OutputIt d_first, const T w); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void bsl_algebraic_transform::backward( + InputIt first1, InputIt last1, OutputIt d_first, const T w); +\end{lstlisting} + +\subsection{Real \dft} + +\begin{lstlisting}[language=C++] +template< class Real = double, + class Allocator = std::allocator > +class bsl_rdft; +\end{lstlisting} + +The backends \verb|gsl_rdft| and \verb|fftw_rdft| behave in the same way as +\verb|bsl_rdft|. + +\subsubsection{Member functions} + +\begin{lstlisting}[language=C++] +template< class Real, class Allocator > +constexpr bsl_rdft::bsl_rdft( + unsigned int n, const Allocator& alloc = Allocator{} ); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void real_to_halfcomplex(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void real_to_complex(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void halfcomplex_to_real(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void complex_to_real(InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +constexpr std::size_t size() const; +\end{lstlisting} +\begin{lstlisting}[language=C++] +void resize(std::size_t new_size); +\end{lstlisting} + +\subsubsection{One-time transform methods} + +\begin{lstlisting}[language=C++] +template +void bsl_real_transform::real_to_halfcomplex( + InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void bsl_real_transform::real_to_complex( + InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void bsl_real_transform::halfcomplex_to_real( + InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} +\begin{lstlisting}[language=C++] +template +void bsl_real_transform::complex_to_real( + InputIt first1, InputIt last1, OutputIt d_first); +\end{lstlisting} + +\subsection{Convolution} + +\begin{lstlisting}[language=C++] +template +void bsl_transform::convolution( + InputIt1 first1, InputIt1 last1, InputIt2 first2, OutputIt d_first); +\end{lstlisting} + +% template, class Allocator_t = std::allocator > +% using bsl_dft = detail::complex_dft; +% +% template > +% using bsl_rdft = detail::real_dft; +% +% template, class Allocator_t = std::allocator > +% using bsl_algebraic_dft = detail::algebraic_dft; +% +% using bsl_transform = transform< bsl_dft<> >; +% using bsl_algebraic_transform = transform< bsl_algebraic_dft<> >; +% using bsl_real_transform = transform< bsl_rdft<> >; %proposes the design and implementation of a modern C++ template %interface for \dft\ within \boostmath\ library. The implementation will consist @@ -161,14 +360,3 @@ \section{Detailed API} % %\item (if time permits) with multithreaded capabilities. % \end{itemize} -\subsection{Future outlook} -Describe the pending issues and plans for improvement: -\begin{itemize} - \item Documentation inside boost, - \item optimization of the Boost routines, - \item multithreading, - \item multidimentional transforms, - \item to work in collaboration with boost.mpi to create distributed memory - transforms to tacke the $D$-dimentional scalability problem proposing a - $D-1$ domain decomposition similar to \cite{pippig_13}. -\end{itemize} diff --git a/future.tex b/future.tex new file mode 100644 index 0000000..4c252d8 --- /dev/null +++ b/future.tex @@ -0,0 +1,11 @@ +\section{Future outlook} +Describe the pending issues and plans for improvement: +\begin{itemize} + \item Documentation inside boost, + \item optimization of the Boost routines, + \item multithreading, + \item multidimentional transforms, + \item to work in collaboration with Boost.MPI to create distributed memory + transforms to tacke the $D$-dimentional scalability problem proposing a + $D-1$ domain decomposition similar to \cite{pippig_13}. +\end{itemize} diff --git a/gsoc-report.tex b/gsoc-report.tex index 4ef0097..1349e21 100644 --- a/gsoc-report.tex +++ b/gsoc-report.tex @@ -80,7 +80,9 @@ \input quickstart \input state \input api +\input implementation \input benchmarks +\input future \bibliography{biblio} diff --git a/implementation.tex b/implementation.tex new file mode 100644 index 0000000..f286ddb --- /dev/null +++ b/implementation.tex @@ -0,0 +1 @@ +\section{Implementation} diff --git a/makefile b/makefile index 859eb89..5691f70 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ VPATH=plots docfiles:=gsoc-report.tex intro.tex state.tex api.tex app_ring.tex \ - quickstart.tex benchmarks.tex + quickstart.tex benchmarks.tex future.tex target:=gsoc-report.pdf main:=gsoc-report.tex command:=rubber diff --git a/quickstart.tex b/quickstart.tex index 06e3fe5..8708ffc 100644 --- a/quickstart.tex +++ b/quickstart.tex @@ -1,9 +1,12 @@ \section{Quickstart} -Our interface was designed for easy of use. The user can start performing +Boost.Math.FFT provides an interface to compute Fourier Transforms for different +types using C++ templates. +Its design aims to be easy to use. +For instance the user can start performing complex FFTs by just calling one of the \texttt{std::transform}-like routines \texttt{forward} or \texttt{backward} that correspond to a Discrete Fourier -Transform (DFT) in $\Complex^n$ space with the root of unity +Transform (\dft) in $\Complex^n$ space with the root of unity $\exp(-\frac{2\pi}{n} i)$ and $\exp(\frac{2\pi}{n} i)$ respectively. See listings \ref{ls:complex_dft_transform} \begin{lstlisting}[language=C++,label=ls:complex_dft_transform,caption=Simple complex FFT