#include <complex_to_complex.h>

Public Member Functions | |
| complex_to_complex () | |
| Default constructor. | |
| complex_to_complex (std::size_t n) | |
| Initialization for transforms of length n. | |
| af::shared< real_type > | wa () const |
| Access to the pre-computed "twiddle factors.". | |
| template<typename ComplexOrRealIterOrPtrType> | |
| void | forward (ComplexOrRealIterOrPtrType seq_begin, real_type *scratch=0) |
| In-place "forward" Fourier transformation of a sequence of length n(). | |
| template<typename ComplexOrRealIterOrPtrType> | |
| void | backward (ComplexOrRealIterOrPtrType seq_begin, real_type *scratch=0) |
| In-place "backward" Fourier transformation of a sequence of length n(). | |
| template<typename Tag> | |
| void | transform (select_sign< Tag > tag, complex_type *seq_begin, real_type *scratch=0) |
| Generic in-place Fourier transformation of a contiguous sequence. | |
| template<typename Tag> | |
| void | transform (select_sign< Tag > tag, real_type *c, real_type *ch=0) |
| Generic in-place Fourier transformation of a contiguous sequence. | |
| complex_to_complex | ( | std::size_t | n | ) | [inline] |
Initialization for transforms of length n.
This constructor determines the factorization of n, pre-computes some constants, determines the "twiddle factors" needed in the transformation (n complex values), and allocates scratch space (n complex values).
| void forward | ( | ComplexOrRealIterOrPtrType | seq_begin, | |
| real_type * | scratch = 0 | |||
| ) | [inline] |
In-place "forward" Fourier transformation of a sequence of length n().
Equivalent to, but much faster than the following Python code:
for i in range(n):
Sum = 0
for k in range(n):
Sum += Seq_in[k] * exp(-2*pi*1j*i*k/n)
Seq_out.append(Sum)
Note that 1j is the imaginary number (sqrt(-1)) in Python.
| void backward | ( | ComplexOrRealIterOrPtrType | seq_begin, | |
| real_type * | scratch = 0 | |||
| ) | [inline] |
In-place "backward" Fourier transformation of a sequence of length n().
Equivalent to, but much faster than the following Python code:
for i in range(n):
Sum = 0
for k in range(n):
Sum += Seq_in[k] * exp(+2*pi*1j*i*k/n)
Seq_out.append(Sum)
Note that 1j is the imaginary number (sqrt(-1)) in Python.
1.5.6