SourceXtractorPlusPlus  0.8
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Member Functions | List of all members
SourceXtractor::FFT< T > Class Template Reference

Wraps the FFTW API with a more C++ like one. More...

#include <FFT.h>

Public Types

typedef FFTTraits< T > fftw_traits
 
typedef std::shared_ptr
< typename fftw_traits::plan_t > 
plan_ptr_t
 
typedef std::complex< T > complex_t
 

Static Public Member Functions

static plan_ptr_t createForwardPlan (int howmany, int width, int height, std::vector< T > &in, std::vector< complex_t > &out)
 
static plan_ptr_t createInversePlan (int howmany, int width, int height, std::vector< complex_t > &in, std::vector< T > &out)
 
static void executeForward (plan_ptr_t &plan, std::vector< T > &in, std::vector< complex_t > &out)
 
static void executeInverse (plan_ptr_t &plan, std::vector< complex_t > &in, std::vector< T > &out)
 

Detailed Description

template<typename T>
class SourceXtractor::FFT< T >

Wraps the FFTW API with a more C++ like one.

It builds on top of the FFTTraits as defined previously

Template Parameters
TA floating point type

Definition at line 87 of file FFT.h.

Member Typedef Documentation

template<typename T>
typedef std::complex<T> SourceXtractor::FFT< T >::complex_t

Definition at line 93 of file FFT.h.

template<typename T>
typedef FFTTraits<T> SourceXtractor::FFT< T >::fftw_traits

Definition at line 88 of file FFT.h.

template<typename T>
typedef std::shared_ptr<typename fftw_traits::plan_t> SourceXtractor::FFT< T >::plan_ptr_t

Definition at line 92 of file FFT.h.

Member Function Documentation

template<typename T>
auto SourceXtractor::FFT< T >::createForwardPlan ( int  howmany,
int  width,
int  height,
std::vector< T > &  in,
std::vector< complex_t > &  out 
)
static

Create, or reuses if already exists, a 2D FFTW forward plan.

Parameters
howmanyHow many transforms to compute in one shot.
widthThe width of the 2D original data
heightThe height of the 2D original data
inA buffer in row major order, with width*height*howmany positions. This buffer is passed to FFTW to perform its planning, and will be overwritten
outA buffer in row major order, width width*height*howmany positions. This buffer is passed to FFTW to perform its planning, and will be overwritten
Returns
A pointer to a plan fit to the given dimensions. It can be safely reused between threads.

Definition at line 155 of file FFT.cpp.

References std::map< K, T >::emplace(), std::map< K, T >::end(), SourceXtractor::fftw_global_plan_mutex, std::map< K, T >::find(), std::make_tuple(), and pi.

Referenced by SourceXtractor::DFTConvolution< DetectionImage::PixelType, PaddedType >::prepare().

Here is the call graph for this function:

template<typename T>
auto SourceXtractor::FFT< T >::createInversePlan ( int  howmany,
int  width,
int  height,
std::vector< complex_t > &  in,
std::vector< T > &  out 
)
static

Create, or reuses if already exists, a 2D FFTW inverse plan.

Parameters
howmanyHow many inverse transforms to compute in one shot.
widthThe width of the 2D original data
heightThe height of the 2D original data
inA buffer in row major order, with width*height*howmany positions. This buffer is passed to FFTW to perform its planning, and will be overwritten
outA buffer in row major order, width width*height*howmany positions. This buffer is passed to FFTW to perform its planning, and will be overwritten
Returns
A pointer to a plan fit to the given dimensions. It can be safely reused between threads.

Definition at line 199 of file FFT.cpp.

References std::map< K, T >::emplace(), std::map< K, T >::end(), SourceXtractor::fftw_global_plan_mutex, std::map< K, T >::find(), std::make_tuple(), and pi.

Referenced by SourceXtractor::DFTConvolution< DetectionImage::PixelType, PaddedType >::prepare().

Here is the call graph for this function:

template<typename T>
void SourceXtractor::FFT< T >::executeForward ( plan_ptr_t plan,
std::vector< T > &  in,
std::vector< complex_t > &  out 
)
static

Execute a forward Fourier Transform

Parameters
planA plan as created by createForwardPlan
inA buffer in row major order with the input data.
outA buffer in row major order where the transform will be stored.

Definition at line 244 of file FFT.cpp.

References std::vector< T >::data(), and std::shared_ptr::get().

Referenced by SourceXtractor::DFTConvolution< DetectionImage::PixelType, PaddedType >::convolve(), and SourceXtractor::DFTConvolution< DetectionImage::PixelType, PaddedType >::prepare().

Here is the call graph for this function:

template<typename T>
void SourceXtractor::FFT< T >::executeInverse ( plan_ptr_t plan,
std::vector< complex_t > &  in,
std::vector< T > &  out 
)
static

Execute an inverse Fourier Transform

Parameters
planA plan as created by createInversePlan
inA buffer in row major order with the input data.
outA buffer in row major order where the transform will be stored.

Definition at line 250 of file FFT.cpp.

References std::vector< T >::data(), and std::shared_ptr::get().

Referenced by SourceXtractor::DFTConvolution< DetectionImage::PixelType, PaddedType >::convolve().

Here is the call graph for this function:


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