NFFT  3.5.3
Macros | Functions
NFSOFT - Nonequispaced fast SO(3) Fourier transform

This module implements nonuniform fast SO(3) Fourier transforms. More...

Macros

#define NFSOFT_NORMALIZED   (1U << 0)
 
#define NFSOFT_USE_NDFT   (1U << 1)
 
#define NFSOFT_USE_DPT   (1U << 2)
 
#define NFSOFT_MALLOC_X   (1U << 3)
 
#define NFSOFT_REPRESENT   (1U << 4)
 
#define NFSOFT_MALLOC_F_HAT   (1U << 5)
 
#define NFSOFT_MALLOC_F   (1U << 6)
 
#define NFSOFT_PRESERVE_F_HAT   (1U << 7)
 
#define NFSOFT_PRESERVE_X   (1U << 8)
 
#define NFSOFT_PRESERVE_F   (1U << 9)
 
#define NFSOFT_DESTROY_F_HAT   (1U << 10)
 
#define NFSOFT_DESTROY_X   (1U << 11)
 
#define NFSOFT_DESTROY_F   (1U << 12)
 
#define NFSOFT_NO_STABILIZATION   (1U << 13)
 
#define NFSOFT_CHOOSE_DPT   (1U << 14)
 
#define NFSOFT_SOFT   (1U << 15)
 
#define NFSOFT_ZERO_F_HAT   (1U << 16)
 
#define NFSOFT_INDEX(m, n, l, B)   (((l)+((B)+1))+(2*(B)+2)*(((n)+((B)+1))+(2*(B)+2)*((m)+((B)+1))))
 
#define NFSOFT_F_HAT_SIZE(B)   (((B)+1)*(4*((B)+1)*((B)+1)-1)/3)
 

Functions

void nfsoft_precompute (nfsoft_plan *plan3D)
 
void nfsoft_init (nfsoft_plan *plan, int N, int M)
 
void nfsoft_init_advanced (nfsoft_plan *plan, int N, int M, unsigned int nfsoft_flags)
 
void nfsoft_init_guru (nfsoft_plan *plan, int B, int M, unsigned int nfsoft_flags, unsigned int nfft_flags, int nfft_cutoff, int fpt_kappa)
 
void nfsoft_init_guru_advanced (nfsoft_plan *plan, int B, int M, unsigned int nfsoft_flags, unsigned int nfft_flags, int nfft_cutoff, int fpt_kappa, int nn_oversampled)
 
void nfsoft_trafo (nfsoft_plan *plan3D)
 
void nfsoft_adjoint (nfsoft_plan *plan3D)
 
void nfsoft_finalize (nfsoft_plan *plan)
 

Detailed Description

This module implements nonuniform fast SO(3) Fourier transforms.

In the following, we abbreviate the term "nonuniform fast SO(3) Fourier transform" by NFSOFT.

Macro Definition Documentation

◆ NFSOFT_NORMALIZED

#define NFSOFT_NORMALIZED   (1U << 0)

By default, all computations are performed with respect to the unnormalized basis functions

\[ D_{mn}^l(\alpha,\beta,\gamma) = d^{mn}_{l}(\cos\beta) \mathrm{e}^{-\mathrm{i} m \alpha}\mathrm{e}^{-\mathrm{i} n \gamma}. \]

If this flag is set, all computations are carried out using the $L_2$- normalized basis functions

\[ \tilde D_{mn}^l(\alpha,\beta,\gamma) = \sqrt{\frac{2l+1}{8\pi^2}}d^{mn}_{l}(\cos\beta) \mathrm{e}^{-\mathrm{i} m \alpha}\mathrm{e}^{-\mathrm{i} n \gamma} \]

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 673 of file nfft3.h.

◆ NFSOFT_USE_NDFT

#define NFSOFT_USE_NDFT   (1U << 1)

If this flag is set, the fast NFSOFT algorithms (see nfsoft_trafo, nfsoft_adjoint) will use internally the exact but usually slower direct NDFT algorithm in favor of fast but approximative NFFT algorithm.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 674 of file nfft3.h.

◆ NFSOFT_USE_DPT

#define NFSOFT_USE_DPT   (1U << 2)

If this flag is set, the fast NFSOFT algorithms (see nfsoft_trafo, nfsoft_adjoint) will use internally the usually slower direct DPT algorithm in favor of the fast FPT algorithm.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 675 of file nfft3.h.

◆ NFSOFT_MALLOC_X

#define NFSOFT_MALLOC_X   (1U << 3)

If this flag is set, the init methods (see nfsoft_init , nfsoft_init_advanced , and nfsoft_init_guru) will allocate memory and the method nfsoft_finalize will free the array x for you. Otherwise, you have to assure by yourself that x points to an array of proper size before excuting a transform and you are responsible for freeing the corresponding memory before program termination.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 676 of file nfft3.h.

◆ NFSOFT_REPRESENT

#define NFSOFT_REPRESENT   (1U << 4)

If this flag is set, the Wigner-D functions will be normed such that they satisfy the representation property of the spherical harmonics as defined in the NFFT software package, i.e. for every rotation matrix A with Euler angles $\alpha, \beta, \gamma$ and every unit vector x the Wigner-D functions will be normed such that

\[ \sum_{m=-l}^l D_{mn}^l(\alpha,\beta,\gamma) Y_m^l(x) = Y_n^l(A^{-1} x) \]

Author
Antje Vollrath

Definition at line 677 of file nfft3.h.

◆ NFSOFT_MALLOC_F_HAT

#define NFSOFT_MALLOC_F_HAT   (1U << 5)

If this flag is set, the init methods (see nfsoft_init , nfsoft_init_advanced , and nfsoft_init_guru) will allocate memory and the method nfsoft_finalize will free the array f_hat for you. Otherwise, you have to assure by yourself that f_hat points to an array of proper size before excuting a transform and you are responsible for freeing the corresponding memory before program termination.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 678 of file nfft3.h.

◆ NFSOFT_MALLOC_F

#define NFSOFT_MALLOC_F   (1U << 6)

If this flag is set, the init methods (see nfsoft_init , nfsoft_init_advanced , and nfsoft_init_guru) will allocate memory and the method nfsoft_finalize will free the array f for you. Otherwise, you have to assure by yourself that f points to an array of proper size before excuting a transform and you are responsible for freeing the corresponding memory before program termination.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 679 of file nfft3.h.

◆ NFSOFT_PRESERVE_F_HAT

#define NFSOFT_PRESERVE_F_HAT   (1U << 7)

If this flag is set, it is guaranteed that during an execution of nfsoft_trafo the content of f_hat remains unchanged.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 680 of file nfft3.h.

◆ NFSOFT_PRESERVE_X

#define NFSOFT_PRESERVE_X   (1U << 8)

If this flag is set, it is guaranteed that during an execution of nfsoft_trafo or nfsoft_adjoint the content of x remains unchanged.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 681 of file nfft3.h.

◆ NFSOFT_PRESERVE_F

#define NFSOFT_PRESERVE_F   (1U << 9)

If this flag is set, it is guaranteed that during an execution of ndsoft_adjoint or nfsoft_adjoint the content of f remains unchanged.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 682 of file nfft3.h.

◆ NFSOFT_DESTROY_F_HAT

#define NFSOFT_DESTROY_F_HAT   (1U << 10)

If this flag is set, it is explicitely allowed that during an execution of nfsoft_trafo the content of f_hat may be changed.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 683 of file nfft3.h.

◆ NFSOFT_DESTROY_X

#define NFSOFT_DESTROY_X   (1U << 11)

If this flag is set, it is explicitely allowed that during an execution of nfsoft_trafo or nfsoft_adjoint the content of x may be changed.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 684 of file nfft3.h.

◆ NFSOFT_DESTROY_F

#define NFSOFT_DESTROY_F   (1U << 12)

If this flag is set, it is explicitely allowed that during an execution of ndsoft_adjoint or nfsoft_adjoint the content of f may be changed.

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 685 of file nfft3.h.

◆ NFSOFT_NO_STABILIZATION

#define NFSOFT_NO_STABILIZATION   (1U << 13)

If this flag is set, the fast NFSOFT algorithms (see nfsoft_trafo, nfsoft_adjoint) will use internally the FPT algorithm without the stabilization scheme and thus making bigger errors for higher bandwidth but becoming significantly faster

Author
Antje Vollrath

Definition at line 688 of file nfft3.h.

◆ NFSOFT_CHOOSE_DPT

#define NFSOFT_CHOOSE_DPT   (1U << 14)

If this flag is set, the fast NFSOFT algorithms (see nfsoft_trafo, nfsoft_adjoint) will decide whether to use the DPT or FPT algorithm depending on which is faster for the chosen orders.

not yet included in the checked-in version

Author
Antje Vollrath

Definition at line 689 of file nfft3.h.

◆ NFSOFT_SOFT

#define NFSOFT_SOFT   (1U << 15)

If this flag is set, the fast NFSOFT algorithms (see nfsoft_trafo, nfsoft_adjoint) becomes a SOFT, i.e., we use equispaced nodes. The FFTW will be used instead of the NFFT.-->not included yet

See also
nfsoft_init
nfsoft_init_advanced
nfsoft_init_guru
Author
Antje Vollrath

Definition at line 690 of file nfft3.h.

◆ NFSOFT_ZERO_F_HAT

#define NFSOFT_ZERO_F_HAT   (1U << 16)

If this flag is set, the transform nfsoft_adjoint sets all unused entries in f_hat not corresponding to SO(3) Fourier coefficients to zero.

Author
Antje Vollrath

Definition at line 691 of file nfft3.h.

◆ NFSOFT_INDEX

#define NFSOFT_INDEX (   m,
  n,
  l,
 
)    (((l)+((B)+1))+(2*(B)+2)*(((n)+((B)+1))+(2*(B)+2)*((m)+((B)+1))))

This macro expands to the index $i$ corresponding to the SO(3) Fourier coefficient $\hat f^{mn}_l$ for $l=0,...,B$, $m,n =-l,...,l$ with

Definition at line 694 of file nfft3.h.

◆ NFSOFT_F_HAT_SIZE

#define NFSOFT_F_HAT_SIZE (   B)    (((B)+1)*(4*((B)+1)*((B)+1)-1)/3)

This macro expands to the logical size of a SO(3) Fourier coefficients array for a bandwidth B.

Definition at line 695 of file nfft3.h.

Function Documentation

◆ nfsoft_precompute()

void nfsoft_precompute ( nfsoft_plan *  plan)

Does all node-dependent and node-independent precomputations needed for the NFSOFT.

  • plan a pointer to a nfsoft_plan structure

Definition at line 382 of file nfsoft.c.

◆ nfsoft_init()

void nfsoft_init ( nfsoft_plan *  plan,
int  N,
int  M 
)

Creates a NFSOFT transform plan.

  • plan a pointer to a nfsoft_plan structure
  • N the bandwidth $N \in \mathbb{N}_0$
  • M the number of nodes $M \in \mathbb{N}$
Author
Antje Vollrath

Definition at line 45 of file nfsoft.c.

References nfsoft_init_advanced(), NFSOFT_MALLOC_F, NFSOFT_MALLOC_F_HAT, and NFSOFT_MALLOC_X.

◆ nfsoft_init_advanced()

void nfsoft_init_advanced ( nfsoft_plan *  plan,
int  N,
int  M,
unsigned int  nfsoft_flags 
)

Creates a NFSOFT transform plan.

  • plan a pointer to a nfsoft_plan structure
  • N the bandwidth $N \in \mathbb{N}_0$
  • M the number of nodes $M \in \mathbb{N}$
  • nfsoft_flags the NFSOFT flags
Author
Antje Vollrath

Definition at line 51 of file nfsoft.c.

References MALLOC_X, nfsoft_init_guru(), PRE_PHI_HUT, and PRE_PSI.

Referenced by nfsoft_init().

◆ nfsoft_init_guru()

void nfsoft_init_guru ( nfsoft_plan *  plan,
int  N,
int  M,
unsigned int  nfsoft_flags,
unsigned int  nfft_flags,
int  nfft_cutoff,
int  fpt_kappa 
)

Creates a NFSOFT transform plan.

  • plan a pointer to a nfsoft_plan structure
  • N the bandwidth $N \in \mathbb{N}_0$
  • M the number of nodes $M \in \mathbb{N}$
  • nfsoft_flags the NFSFT flags
  • nfft_flags the NFFT flags
  • fpt_kappa a parameter contolling the accuracy of the FPT
  • nfft_cutoff the NFFT cutoff parameter
Author
Antje Vollrath

Definition at line 59 of file nfsoft.c.

References nfsoft_init_guru_advanced().

Referenced by nfsoft_init_advanced().

◆ nfsoft_init_guru_advanced()

void nfsoft_init_guru_advanced ( nfsoft_plan *  plan,
int  N,
int  M,
unsigned int  nfsoft_flags,
unsigned int  nfft_flags,
int  nfft_cutoff,
int  fpt_kappa,
int  fftw_size 
)

Creates a NFSOFT transform plan.

  • plan a pointer to a nfsoft_plan structure
  • N the bandwidth $N \in \mathbb{N}_0$
  • M the number of nodes $M \in \mathbb{N}$
  • nfsoft_flags the NFSFT flags
  • nfft_flags the NFFT flags
  • fpt_kappa a parameter contolling the accuracy of the FPT
  • nfft_cutoff the NFFT cutoff parameter
  • fftw_size the size of the 3D FFTW transform inside the NFFT ( fftw_size $= (2N+2)\,\sigma$, where $\sigma\ge1$ is the oversampling factor)

Definition at line 66 of file nfsoft.c.

References nfsoft_adjoint(), NFSOFT_MALLOC_F, NFSOFT_MALLOC_F_HAT, NFSOFT_MALLOC_X, nfsoft_trafo(), and PRE_LIN_PSI.

Referenced by nfsoft_init_guru().

◆ nfsoft_trafo()

void nfsoft_trafo ( nfsoft_plan *  plan_nfsoft)

Executes a NFSOFT, i.e. computes for $m = 0,\ldots,M-1$

\[ f(g_m) = \sum_{l=0}^B \sum_{m=-l}^l \sum_{n=-l}^l \hat{f}^{mn}_l D_l^{mn}\left( \alpha_m,\beta_m,\gamma_m\right). \]

  • plan_nfsoft the plan
Author
Antje Vollrath

Definition at line 416 of file nfsoft.c.

References X.

Referenced by nfsoft_init_guru_advanced().

◆ nfsoft_adjoint()

void nfsoft_adjoint ( nfsoft_plan *  plan_nfsoft)

Executes an adjoint NFSOFT, i.e. computes for $l=0,\ldots,B; m,n=-l,\ldots,l$

\[ \hat{f}^{mn}_l = \sum_{m = 0}^{M-1} f(g_m) D_l^{mn}\left( \alpha_m,\beta_m,\gamma_m\right) \]

  • plan_nfsoft the plan
Author
Antje Vollrath

Definition at line 545 of file nfsoft.c.

References NFSOFT_USE_NDFT, and X.

Referenced by nfsoft_init_guru_advanced().

◆ nfsoft_finalize()

void nfsoft_finalize ( nfsoft_plan *  plan)

Destroys a plan.

  • plan the plan to be destroyed
Author
Antje Vollrath

Definition at line 645 of file nfsoft.c.