JayBeams  0.1
Another project to have fun coding.
Static Public Member Functions | List of all members
jb::fftw::traits< float > Struct Template Reference

Wrap the FFTW types and functions for single precision float point numbers. More...

#include <traits.hpp>

Public Types

type traits
typedef float precision_type
 The type used to represent floating point numbers. More...
 
typedef std::complex< float > std_complex_type
 The type used to represent complex numbers in the C++ standard library. More...
 
typedef ::fftwf_complex fftw_complex_type
 The type used to represent complex numbers in FFTW. More...
 
typedef ::fftwf_plan fftw_plan_type
 The type used to represent execution plans in FFTW. More...
 

Static Public Member Functions

static void * allocate (std::size_t n)
 Allocate a properly aligned (for SIMD acceleration) block of memory. More...
 
static void release (void *buffer)
 Release a block of memory allocated with allocate() More...
 
static void execute_plan (fftw_plan_type const p, fftw_complex_type const *in, fftw_complex_type *out)
 Execute an existing plan for a given input and output. More...
 
static void execute_plan (fftw_plan_type const p, precision_type const *in, fftw_complex_type *out)
 Execute an existing plan for a given input and output. More...
 
static void execute_plan (fftw_plan_type const p, fftw_complex_type const *in, precision_type *out)
 Execute an existing plan for a given input and output. More...
 
static fftw_plan_type create_forward_plan (std::size_t size, fftw_complex_type const *in, fftw_complex_type *out, int flags)
 Create an execution plan to compute the DFT based on the input and output exemplars. More...
 
static fftw_plan_type create_backward_plan (std::size_t size, fftw_complex_type const *in, fftw_complex_type *out, int flags)
 Create an execution to compute the inverse DFT based on the input and output exemplars. More...
 
static fftw_plan_type create_plan (std::size_t size, precision_type const *in, fftw_complex_type *out, int flags)
 Create an execution to compute the DFT based on the input and output exemplars. More...
 
static fftw_plan_type create_plan (std::size_t size, fftw_complex_type const *in, precision_type *out, int flags)
 Create an execution to compute the inverse DFT based on the input and output exemplars. More...
 
static fftw_plan_type create_forward_plan_many (int howmany, std::size_t size, fftw_complex_type const *in, fftw_complex_type *out, int flags)
 Create an execution to compute the DFT of many vectors based on the input and output exemplars. More...
 
static fftw_plan_type create_backward_plan_many (int howmany, std::size_t size, fftw_complex_type const *in, fftw_complex_type *out, int flags)
 Create an execution to compute the inverse DFT of many vectors based on the input and output exemplars. More...
 
static fftw_plan_type create_plan_many (int howmany, std::size_t size, precision_type const *in, fftw_complex_type *out, unsigned flags)
 Create an execution to compute the DFT of many vectors based on the input and output exemplars. More...
 
static fftw_plan_type create_plan_many (int howmany, std::size_t size, fftw_complex_type const *in, precision_type *out, int flags)
 Create an execution to compute the inverse DFT of many vectors based on the input and output exemplars. More...
 
static void destroy_plan (fftw_plan_type p)
 Destroy an execution plan. More...
 

Detailed Description

template<>
struct jb::fftw::traits< float >

Wrap the FFTW types and functions for single precision float point numbers.

Definition at line 300 of file traits.hpp.

Member Typedef Documentation

◆ fftw_complex_type

typedef ::fftwf_complex jb::fftw::traits< float >::fftw_complex_type

The type used to represent complex numbers in FFTW.

Definition at line 310 of file traits.hpp.

◆ fftw_plan_type

typedef ::fftwf_plan jb::fftw::traits< float >::fftw_plan_type

The type used to represent execution plans in FFTW.

Definition at line 312 of file traits.hpp.

◆ precision_type

typedef float jb::fftw::traits< float >::precision_type

The type used to represent floating point numbers.

Definition at line 306 of file traits.hpp.

◆ std_complex_type

typedef std::complex<float> jb::fftw::traits< float >::std_complex_type

The type used to represent complex numbers in the C++ standard library.

Definition at line 308 of file traits.hpp.

Member Function Documentation

◆ allocate()

static void* jb::fftw::traits< float >::allocate ( std::size_t  n)
inlinestatic

Allocate a properly aligned (for SIMD acceleration) block of memory.

Parameters
nthe number of bytes to allocate
Returns
a block for at least n bytes

Definition at line 321 of file traits.hpp.

◆ create_backward_plan()

static fftw_plan_type jb::fftw::traits< float >::create_backward_plan ( std::size_t  size,
fftw_complex_type const *  in,
fftw_complex_type out,
int  flags 
)
inlinestatic

Create an execution to compute the inverse DFT based on the input and output exemplars.

Returns
the execution plan
Parameters
sizethe size of the input and output vectors
inthe input vector
outthe output vector
flagscontrol the algorithm choices in FFTW

Definition at line 409 of file traits.hpp.

◆ create_backward_plan_many()

static fftw_plan_type jb::fftw::traits< float >::create_backward_plan_many ( int  howmany,
std::size_t  size,
fftw_complex_type const *  in,
fftw_complex_type out,
int  flags 
)
inlinestatic

Create an execution to compute the inverse DFT of many vectors based on the input and output exemplars.

Returns
the execution plan
Parameters
howmanyhow many timeseries in the arrays
sizethe size of the input and output vectors
inthe input array must be of size howmany*size
outthe output array must be of size howmany*size
flagscontrol the algorithm choices in FFTW

Definition at line 488 of file traits.hpp.

References jb::testing::defaults::size.

◆ create_forward_plan()

static fftw_plan_type jb::fftw::traits< float >::create_forward_plan ( std::size_t  size,
fftw_complex_type const *  in,
fftw_complex_type out,
int  flags 
)
inlinestatic

Create an execution plan to compute the DFT based on the input and output exemplars.

Returns
the execution plan
Parameters
sizethe size of the input and output vectors
inthe input vector
outthe output vector
flagscontrol the algorithm choices in FFTW

Definition at line 392 of file traits.hpp.

◆ create_forward_plan_many()

static fftw_plan_type jb::fftw::traits< float >::create_forward_plan_many ( int  howmany,
std::size_t  size,
fftw_complex_type const *  in,
fftw_complex_type out,
int  flags 
)
inlinestatic

Create an execution to compute the DFT of many vectors based on the input and output exemplars.

Returns
the execution plan
Parameters
howmanyhow many timeseries in the arrays
sizethe size of the input and output vectors
inthe input array must be of size howmany*size
outthe output array must be of size howmany*size
flagscontrol the algorithm choices in FFTW

Definition at line 461 of file traits.hpp.

References jb::testing::defaults::size.

◆ create_plan() [1/2]

static fftw_plan_type jb::fftw::traits< float >::create_plan ( std::size_t  size,
precision_type const *  in,
fftw_complex_type out,
int  flags 
)
inlinestatic

Create an execution to compute the DFT based on the input and output exemplars.

Returns
the execution plan
Parameters
sizethe size of the input and output vectors
inthe input vector
outthe output vector
flagscontrol the algorithm choices in FFTW

Definition at line 426 of file traits.hpp.

◆ create_plan() [2/2]

static fftw_plan_type jb::fftw::traits< float >::create_plan ( std::size_t  size,
fftw_complex_type const *  in,
precision_type out,
int  flags 
)
inlinestatic

Create an execution to compute the inverse DFT based on the input and output exemplars.

Returns
the execution plan
Parameters
sizethe size of the input and output vectors
inthe input vector
outthe output vector
flagscontrol the algorithm choices in FFTW

Definition at line 443 of file traits.hpp.

◆ create_plan_many() [1/2]

static fftw_plan_type jb::fftw::traits< float >::create_plan_many ( int  howmany,
std::size_t  size,
precision_type const *  in,
fftw_complex_type out,
unsigned  flags 
)
inlinestatic

Create an execution to compute the DFT of many vectors based on the input and output exemplars.

Returns
the execution plan
Parameters
howmanyhow many timeseries in the arrays
sizethe size of the input and output vectors
inthe input array must be of size howmany*size
outthe output array must be of size howmany*size
flagscontrol the algorithm choices in FFTW

Definition at line 515 of file traits.hpp.

References jb::testing::defaults::size.

◆ create_plan_many() [2/2]

static fftw_plan_type jb::fftw::traits< float >::create_plan_many ( int  howmany,
std::size_t  size,
fftw_complex_type const *  in,
precision_type out,
int  flags 
)
inlinestatic

Create an execution to compute the inverse DFT of many vectors based on the input and output exemplars.

Returns
the execution plan
Parameters
howmanyhow many timeseries in the arrays
sizethe size of the input and output vectors
inthe input array must be of size howmany*size
outthe output array must be of size howmany*size
flagscontrol the algorithm choices in FFTW

Definition at line 542 of file traits.hpp.

References jb::testing::defaults::size.

◆ destroy_plan()

static void jb::fftw::traits< float >::destroy_plan ( fftw_plan_type  p)
inlinestatic

Destroy an execution plan.

Parameters
pthe plan to destroy

Definition at line 563 of file traits.hpp.

◆ execute_plan() [1/3]

static void jb::fftw::traits< float >::execute_plan ( fftw_plan_type const  p,
fftw_complex_type const *  in,
fftw_complex_type out 
)
inlinestatic

Execute an existing plan for a given input and output.

FFTW requires, but does not check that the input and output have the same alignment and sizes defined in the original plan.

Parameters
pthe execution plan
inthe input vector (or array)
outthe output data (or array)

Definition at line 344 of file traits.hpp.

◆ execute_plan() [2/3]

static void jb::fftw::traits< float >::execute_plan ( fftw_plan_type const  p,
precision_type const *  in,
fftw_complex_type out 
)
inlinestatic

Execute an existing plan for a given input and output.

FFTW requires, but does not check that the input and output have the same alignment and sizes defined in the original plan.

Parameters
pthe execution plan
inthe input vector (or array)
outthe output vector (or array)

Definition at line 360 of file traits.hpp.

◆ execute_plan() [3/3]

static void jb::fftw::traits< float >::execute_plan ( fftw_plan_type const  p,
fftw_complex_type const *  in,
precision_type out 
)
inlinestatic

Execute an existing plan for a given input and output.

FFTW requires, but does not check that the input and output have the same alignment and sizes defined in the original plan.

Parameters
pthe execution plan
inthe input vector (or array)
outthe output vector (or array), can be the same as the input

Definition at line 376 of file traits.hpp.

◆ release()

static void jb::fftw::traits< float >::release ( void *  buffer)
inlinestatic

Release a block of memory allocated with allocate()

Parameters
bufferthe block to release

Definition at line 330 of file traits.hpp.


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