ndarray
NumPy-friendly multidimensional arrays in C++
|
A wrapper for FFTW plans for fast Fourier transforms. More...
#include <FourierTransform.h>
Public Types | |
typedef boost::shared_ptr< FourierTransform > | Ptr |
typedef detail::FourierTraits< T >::ElementX | ElementX |
Real-space array data type;. | |
typedef detail::FourierTraits< T >::ElementK | ElementK |
Fourier-space array data type;. | |
typedef Vector< Size, N > | Index |
Shape type for arrays. | |
typedef Array< ElementX, N, N > | ArrayX |
Real-space array type. | |
typedef Array< ElementK, N, N > | ArrayK |
Fourier-space array type. | |
typedef Vector< Size, N+1 > | MultiplexIndex |
Shape type for multiplexed arrays. | |
typedef Array< ElementX, N+1, N+1 > | MultiplexArrayX |
Real-space multiplexed array type. | |
typedef Array< ElementK, N+1, N+1 > | MultiplexArrayK |
Fourier-space multiplexed array type. | |
Public Member Functions | |
void | execute () |
Execute the FFTW plan. | |
Static Public Member Functions | |
static Ptr | planForward (Index const &shape, ArrayX &x, ArrayK &k) |
Create a plan for forward-transforming a single N-dimensional array. | |
static Ptr | planInverse (Index const &shape, ArrayK &k, ArrayX &x) |
Create a plan for inverse-transforming a single N-dimensional array. | |
static Ptr | planMultiplexForward (MultiplexIndex const &shape, MultiplexArrayX &x, MultiplexArrayK &k) |
Create a plan for forward-transforming a sequence of nested N-dimensional arrays. | |
static Ptr | planMultiplexInverse (MultiplexIndex const &shape, MultiplexArrayK &k, MultiplexArrayX &x) |
Create a plan for inverse-transforming a sequence of nested N-dimensional arrays. | |
template<int M> | |
static Array< ElementX, M, M > | initializeX (Vector< Size, M > const &shape) |
Create a new real-space array with the given real-space shape. | |
template<int M> | |
static Array< ElementK, M, M > | initializeK (Vector< Size, M > const &shape) |
Create a new Fourier-space array with the given real-space shape. | |
template<int M> | |
static void | initialize (Vector< Size, M > const &shape, Array< ElementX, M, M > &x, Array< ElementK, M, M > &k) |
Initialize, as necessary, a pair of arrays with the given real-space shape. | |
A wrapper for FFTW plans for fast Fourier transforms.
An instance of FourierTransform holds an FFTW "plan", providing repeated forward or inverse FFTs of predetermined arrays.
Multiplex plans can also be generated to perform an N-dimensional FFT on the nested arrays of an (N+1)-dimensional array.
Static member functions of FourierTransform are used to create instances, and optionally initialize the involved arrays.
|
static |
Initialize, as necessary, a pair of arrays with the given real-space shape.
If either array is not empty, it must be consistent with the given shape.
|
static |
Create a plan for forward-transforming a single N-dimensional array.
Arrays will be initialized with new memory if empty. If they are not empty, existing data may be overwritten when the plan is created.
shape | Shape of the real-space array. |
x | Input real-space array. |
k | Output Fourier-space array. |
|
static |
Create a plan for inverse-transforming a single N-dimensional array.
Arrays will be initialized with new memory if empty. If they are not empty, existing data may be overwritten when the plan is created.
shape | Shape of the real-space array. |
k | Input Fourier-space array. |
x | Output real-space array. |
|
static |
Create a plan for forward-transforming a sequence of nested N-dimensional arrays.
Arrays will be initialized with new memory if empty. If they are not empty, existing data may be overwritten when the plan is created.
shape | Shape of the real-space array. First dimension is multiplexed. |
x | Input real-space array. |
k | Output Fourier-space array. |
|
static |
Create a plan for inverse-transforming a sequence of nested N-dimensional arrays.
Arrays will be initialized with new memory if empty. If they are not empty, existing data may be overwritten when the plan is created.
shape | Shape of the real-space array. First dimension is multiplexed. |
k | Input Fourier-space array. |
x | Output real-space array. |