BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
FourierTransform::Workspace Class Reference

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 70 of file FourierTransform.h.

Public Member Functions

 Workspace ()=default
 
 ~Workspace ()
 
void clear ()
 

Private Attributes

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

Friends

class FourierTransform
 

Constructor & Destructor Documentation

◆ Workspace()

FourierTransform::Workspace::Workspace ( )
default

◆ ~Workspace()

FourierTransform::Workspace::~Workspace ( )

Definition at line 22 of file FourierTransform.cpp.

23 {
24  clear();
25 }

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void FourierTransform::Workspace::clear ( )

Definition at line 27 of file FourierTransform.cpp.

28 {
29  // rows (h) and columns (w) of the input 'source'
30  h_src = 0;
31  w_src = 0;
32 
33  delete[] in_src;
34  in_src = nullptr;
35 
36  if (out_fftw)
37  fftw_free((fftw_complex*)out_fftw);
38  out_fftw = nullptr;
39 
40  if (p_forw_src != nullptr)
41  fftw_destroy_plan(p_forw_src);
42 
43  fftw_cleanup();
44 }
double * out_fftw
result of Fourier transformation of source
int h_src
Here, h = height (# rows), w = width (# columns)

Referenced by ~Workspace(), and FourierTransform::init().

Friends And Related Function Documentation

◆ FourierTransform

friend class FourierTransform
friend

Definition at line 75 of file FourierTransform.h.

Member Data Documentation

◆ h_fftw

int FourierTransform::Workspace::h_fftw {0}
private

◆ h_src

int FourierTransform::Workspace::h_src {0}
private

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

Definition at line 79 of file FourierTransform.h.

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

◆ in_src

double* FourierTransform::Workspace::in_src {nullptr}
private

Definition at line 82 of file FourierTransform.h.

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

◆ out_fftw

double* FourierTransform::Workspace::out_fftw {nullptr}
private

result of Fourier transformation of source

Definition at line 85 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 {nullptr}
private

Definition at line 87 of file FourierTransform.h.

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

◆ w_fftw

int FourierTransform::Workspace::w_fftw {0}
private

◆ w_src

int FourierTransform::Workspace::w_src {0}
private

Definition at line 79 of file FourierTransform.h.

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


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