ndarray
NumPy-friendly multidimensional arrays in C++
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ndarray::FourierTransform< T, N > Class Template Reference

A wrapper for FFTW plans for fast Fourier transforms. More...

#include <FourierTransform.h>

Inheritance diagram for ndarray::FourierTransform< T, N >:

Public Types

typedef boost::shared_ptr< FourierTransformPtr
 
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.
 

Detailed Description

template<typename T, int N>
class ndarray::FourierTransform< T, N >

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.

Member Function Documentation

◆ initialize()

template<typename T , int N>
template<int M>
static void ndarray::FourierTransform< T, N >::initialize ( Vector< Size, M > const &  shape,
Array< ElementX, M, M > &  x,
Array< ElementK, M, M > &  k 
)
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.

◆ planForward()

template<typename T , int N>
static Ptr ndarray::FourierTransform< T, N >::planForward ( Index const &  shape,
ArrayX x,
ArrayK k 
)
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.

Parameters
shapeShape of the real-space array.
xInput real-space array.
kOutput Fourier-space array.

◆ planInverse()

template<typename T , int N>
static Ptr ndarray::FourierTransform< T, N >::planInverse ( Index const &  shape,
ArrayK k,
ArrayX x 
)
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.

Parameters
shapeShape of the real-space array.
kInput Fourier-space array.
xOutput real-space array.

◆ planMultiplexForward()

template<typename T , int N>
static Ptr ndarray::FourierTransform< T, N >::planMultiplexForward ( MultiplexIndex const &  shape,
MultiplexArrayX x,
MultiplexArrayK k 
)
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.

Parameters
shapeShape of the real-space array. First dimension is multiplexed.
xInput real-space array.
kOutput Fourier-space array.

◆ planMultiplexInverse()

template<typename T , int N>
static Ptr ndarray::FourierTransform< T, N >::planMultiplexInverse ( MultiplexIndex const &  shape,
MultiplexArrayK k,
MultiplexArrayX x 
)
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.

Parameters
shapeShape of the real-space array. First dimension is multiplexed.
kInput Fourier-space array.
xOutput real-space array.

The documentation for this class was generated from the following file: