BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FourierTransform::Workspace Class Reference
Collaboration diagram for FourierTransform::Workspace:

Public Member Functions

 Workspace ()
 
 ~Workspace ()
 
void clear ()
 

Private Attributes

int h_src
 
int w_src
 
int h_fftw
 
int w_fftw
 
double * in_src
 
double * out_fftw
 
fftw_plan p_forw_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 69 of file FourierTransform.h.

Constructor & Destructor Documentation

◆ Workspace()

FourierTransform::Workspace::Workspace ( )

Definition at line 26 of file FourierTransform.cpp.

27  : h_src(0), w_src(0), h_fftw(0), w_fftw(0), in_src(0), out_fftw(0), p_forw_src(nullptr)
28 {
29 }
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 31 of file FourierTransform.cpp.

32 {
33  clear();
34 }

Member Function Documentation

◆ clear()

void FourierTransform::Workspace::clear ( )

Definition at line 36 of file FourierTransform.cpp.

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

Referenced by FourierTransform::init().

Friends And Related Function Documentation

◆ FourierTransform

friend class FourierTransform
friend

Definition at line 75 of file FourierTransform.h.

Member Data Documentation

◆ h_src

int FourierTransform::Workspace::h_src
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().

◆ w_src

int FourierTransform::Workspace::w_src
private

Definition at line 79 of file FourierTransform.h.

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

◆ h_fftw

int FourierTransform::Workspace::h_fftw
private

◆ w_fftw

int FourierTransform::Workspace::w_fftw
private

◆ in_src

double* FourierTransform::Workspace::in_src
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
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
private

Definition at line 87 of file FourierTransform.h.

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


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