BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FourierTransform::Workspace Class Reference

Workspace for Fourier Transform. More...

Public Member Functions

 Workspace ()
 
 ~Workspace ()
 
void clear ()
 

Private Attributes

int h_fftw
 
int h_src
 Here, h = height (# rows), w = width (# columns) More...
 
double * in_src
 
double * out_fftw
 result of Fourier transformation of source More...
 
fftw_plan p_forw_src
 
int w_fftw
 
int w_src
 

Friends

class FourierTransform
 

Detailed Description

Workspace for Fourier Transform.

Workspace contains input (src), intermediate and output (out) arrays to run FT via fft; 'source' is our signal Output arrays are allocated via fftw3 allocation for maximum performance.

Definition at line 73 of file FourierTransform.h.

Constructor & Destructor Documentation

◆ Workspace()

FourierTransform::Workspace::Workspace ( )

Definition at line 25 of file FourierTransform.cpp.

26  : h_src(0), w_src(0), h_fftw(0), w_fftw(0), in_src(0), out_fftw(0), p_forw_src(nullptr)
27 {
28 }
double * out_fftw
result of Fourier transformation of source
int h_src
Here, h = height (# rows), w = width (# columns)

◆ ~Workspace()

FourierTransform::Workspace::~Workspace ( )

Definition at line 30 of file FourierTransform.cpp.

31 {
32  clear();
33 }

Member Function Documentation

◆ clear()

void FourierTransform::Workspace::clear ( )

Definition at line 35 of file FourierTransform.cpp.

36 {
37  // rows (h) and columns (w) of the input 'source'
38  h_src = 0;
39  w_src = 0;
40 
41  if (in_src)
42  delete[] in_src;
43  in_src = 0;
44 
45  if (out_fftw)
46  fftw_free((fftw_complex*)out_fftw);
47  out_fftw = 0;
48 
49  if (p_forw_src != nullptr)
50  fftw_destroy_plan(p_forw_src);
51 
52  fftw_cleanup();
53 }

Referenced by FourierTransform::init().

Friends And Related Function Documentation

◆ FourierTransform

friend class FourierTransform
friend

Definition at line 78 of file FourierTransform.h.

Member Data Documentation

◆ h_fftw

int FourierTransform::Workspace::h_fftw
private

◆ h_src

int FourierTransform::Workspace::h_src
private

Here, h = height (# rows), w = width (# columns)

Definition at line 82 of file FourierTransform.h.

Referenced by FourierTransform::fftw_forward_FT(), and FourierTransform::init().

◆ in_src

double* FourierTransform::Workspace::in_src
private

Definition at line 85 of file FourierTransform.h.

Referenced by FourierTransform::fftw_forward_FT(), and FourierTransform::init().

◆ out_fftw

double* FourierTransform::Workspace::out_fftw
private

result of Fourier transformation of source

Definition at line 88 of file FourierTransform.h.

Referenced by FourierTransform::fft(), FourierTransform::fftw_forward_FT(), and FourierTransform::init().

◆ p_forw_src

fftw_plan FourierTransform::Workspace::p_forw_src
private

Definition at line 90 of file FourierTransform.h.

Referenced by FourierTransform::fftw_forward_FT(), and FourierTransform::init().

◆ w_fftw

int FourierTransform::Workspace::w_fftw
private

◆ w_src

int FourierTransform::Workspace::w_src
private

Definition at line 82 of file FourierTransform.h.

Referenced by FourierTransform::fftw_forward_FT(), and FourierTransform::init().


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