|
Data Structures | |
struct | nfsft_plan |
Structure for a NFSFT transform plan. More... | |
struct | nfsft_wisdom |
Wisdom structure. More... | |
Defines | |
#define | NFSFT_NORMALIZED (1U << 0) |
By default, all computations are performed with respect to the unnormalized basis functions
If this flag is set, all computations are carried out using the - normalized basis functions
| |
#define | NFSFT_USE_NDFT (1U << 1) |
If this flag is set, the fast NFSFT algorithms (see nfsft_trafo, nfsft_adjoint) will use internally the exact but usually slower direct NDFT algorithm in favor of fast but approximative NFFT algorithm. | |
#define | NFSFT_USE_DPT (1U << 2) |
If this flag is set, the fast NFSFT algorithms (see nfsft_trafo, nfsft_adjoint) will use internally the usually slower direct DPT algorithm in favor of the fast FPT algorithm. | |
#define | NFSFT_MALLOC_X (1U << 3) |
If this flag is set, the init methods (see nfsft_init , nfsft_init_advanced , and nfsft_init_guru) will allocate memory and the method nfsft_finalize will free the array x for you. | |
#define | NFSFT_MALLOC_F_HAT (1U << 5) |
If this flag is set, the init methods (see nfsft_init , nfsft_init_advanced , and nfsft_init_guru) will allocate memory and the method nfsft_finalize will free the array f_hat for you. | |
#define | NFSFT_MALLOC_F (1U << 6) |
If this flag is set, the init methods (see nfsft_init , nfsft_init_advanced , and nfsft_init_guru) will allocate memory and the method nfsft_finalize will free the array f for you. | |
#define | NFSFT_PRESERVE_F_HAT (1U << 7) |
If this flag is set, it is guaranteed that during an execution of ndsft_trafo or nfsft_trafo the content of f_hat remains unchanged. | |
#define | NFSFT_PRESERVE_X (1U << 8) |
If this flag is set, it is guaranteed that during an execution of ndsft_trafo, nfsft_trafo or ndsft_adjoint, nfsft_adjoint the content of x remains unchanged. | |
#define | NFSFT_PRESERVE_F (1U << 9) |
If this flag is set, it is guaranteed that during an execution of ndsft_adjoint or nfsft_adjoint the content of f remains unchanged. | |
#define | NFSFT_DESTROY_F_HAT (1U << 10) |
If this flag is set, it is explicitely allowed that during an execution of ndsft_trafo or nfsft_trafo the content of f_hat may be changed. | |
#define | NFSFT_DESTROY_X (1U << 11) |
If this flag is set, it is explicitely allowed that during an execution of ndsft_trafo, nfsft_trafo or ndsft_adjoint, nfsft_adjoint the content of x may be changed. | |
#define | NFSFT_DESTROY_F (1U << 12) |
If this flag is set, it is explicitely allowed that during an execution of ndsft_adjoint or nfsft_adjoint the content of f may be changed. | |
#define | NFSFT_NO_DIRECT_ALGORITHM (1U << 13) |
If this flag is set, the transforms ndsft_trafo and ndsft_adjoint do not work. | |
#define | NFSFT_NO_FAST_ALGORITHM (1U << 14) |
If this flag is set, the transforms nfsft_trafo and nfsft_adjoint do not work. | |
#define | NFSFT_ZERO_F_HAT (1U << 16) |
If this flag is set, the transforms nfsft_adjoint and ndsft_adjoint set all unused entries in f_hat not corresponding to spherical Fourier coefficients to zero. | |
#define | NFSFT_INDEX(k, n, plan) ((2*(plan)->N+2)*((plan)->N-n+1)+(plan)->N+k+1) |
This helper macro expands to the index corresponding to the spherical Fourier coefficient for , with
. | |
#define | NFSFT_F_HAT_SIZE(N) ((2*N+2)*(2*N+2)) |
This helper macro expands to the logical size of a spherical Fourier coefficients array for a bandwidth N. | |
#define | BWEXP_MAX 10 |
#define | BW_MAX 1024 |
#define | ROW(k) (k*(wisdom.N_MAX+2)) |
#define | ROWK(k) (k*(wisdom.N_MAX+2)+k) |
#define | NFSFT_DEFAULT_NFFT_CUTOFF 6 |
The default NFFT cutoff parameter. | |
#define | NFSFT_DEFAULT_THRESHOLD 1000 |
The default threshold for the FPT. | |
#define | NFSFT_BREAK_EVEN 5 |
The break-even bandwidth . | |
Enumerations | |
enum | bool { false = 0, true = 1 } |
Functions | |
void | nfsft_init (nfsft_plan *plan, int N, int M) |
Creates a transform plan. | |
void | nfsft_init_advanced (nfsft_plan *plan, int N, int M, unsigned int nfsft_flags) |
Creates a transform plan. | |
void | nfsft_init_guru (nfsft_plan *plan, int N, int M, unsigned int nfsft_flags, int nfft_flags, int nfft_cutoff) |
Creates a transform plan. | |
void | nfsft_precompute (int N, double kappa, unsigned int nfsft_flags, unsigned int fpt_flags) |
Performes precomputation up to the next power of two with respect to a given bandwidth . | |
void | nfsft_forget () |
Forgets all precomputed data. | |
void | ndsft_trafo (nfsft_plan *plan) |
Executes a direct NDSFT, i.e. | |
void | ndsft_adjoint (nfsft_plan *plan) |
Executes a direct adjoint NDSFT, i.e. | |
void | nfsft_trafo (nfsft_plan *plan) |
Executes a NFSFT, i.e. | |
void | nfsft_adjoint (nfsft_plan *plan) |
Executes an adjoint NFSFT, i.e. | |
void | nfsft_finalize (nfsft_plan *plan) |
Destroys a plan. | |
void | nfsft_precompute_x (nfsft_plan *plan) |
double | alpha_al (int k, int n) |
Computes three-term recurrence coefficients of associated Legendre functions. | |
double | beta_al (int k, int n) |
Computes three-term recurrence coefficients of associated Legendre functions. | |
double | gamma_al (int k, int n) |
Computes three-term recurrence coefficients of associated Legendre functions. | |
void | alpha_al_row (double *alpha, int N, int n) |
void | beta_al_row (double *beta, int N, int n) |
void | gamma_al_row (double *gamma, int N, int n) |
void | alpha_al_all (double *alpha, int N) |
Compute three-term-recurrence coefficients of associated Legendre functions for . | |
void | beta_al_all (double *beta, int N) |
Compute three-term-recurrence coefficients of associated Legendre functions for . | |
void | gamma_al_all (double *gamma, int N) |
Compute three-term-recurrence coefficients of associated Legendre functions for . | |
void | eval_al (double *x, double *y, int size, int k, double *alpha, double *beta, double *gamma) |
Evaluates an associated Legendre polynomials using the Clenshaw-algorithm. | |
int | eval_al_thresh (double *x, double *y, int size, int k, double *alpha, double *beta, double *gamma, double threshold) |
Evaluates an associated Legendre polynomials using the Clenshaw-algorithm if it no exceeds a given threshold. | |
void | c2e (nfsft_plan *plan) |
Converts coefficients with , from a linear combination of Chebyshev polynomials
to coefficients matching the representation by complex exponentials
| |
void | c2e_transposed (nfsft_plan *plan) |
Transposed version of the function c2e. | |
Variables | |
static struct nfsft_wisdom | wisdom = {false,0U} |
The global wisdom structure for precomputed data. |
In the following, we abbreviate the term "nonuniform fast spherical Fourier transform" by NFSFT.
and identify a point from with the corresponding vector . The spherical coordinate system is illustrated in the following figure:
The corresponding three-term recurrence relation is
With
being the usual inner product, the Legendre polynomials obey the orthogonality condition
For , they coincide with the Legendre polynomials, i.e. . The associated Legendre functions obey the three-term recurrence relation
with , , and
For fixed , the set forms a complete set of orthogonal functions in with
with the usual inner product
The normalisation constant renders the scaled basis functions
orthonormal with respect to the induced norm
A function has the orthogonal expansion
where the coefficients are the spherical Fourier coefficients and the equivalence is understood in the -sense.
read
and write
. The public members are structured as follows: N_total
(read
) The total number of components in f_hat
. If the bandwidth is , the total number of components in f_hat
is N_total
. M_total
(read
) the total number of samples f_hat
(read-write
) The flattened array of spherical Fourier coefficents. The array has length such that valid indices for array access f_hat
[
] are . However, only read and write access to indices corresponding to spherical Fourier coefficients is defined. The index corresponding to the spherical Fourier coefficient with , is . For convenience, the helper macro NFSFT_INDEX(k,n) provides the necessary index calculations such that one can write f_hat
[ NFSFT_INDEX
(
)] =
... to access the component corresponding to . The data layout is due to implementation details. f
(read-write
) the array of coefficients for such that f
[
] = N
(read
) the bandwidth x
the array of nodes for such that f
[
] = and f
[
] = f_hat
while the input x
is preserved. On the contrary, the adjoint NDSFT transforms (see ndsft_adjoint, nfsft_adjoint) do not destroy the input f
and x
by default. The desired behaviour can be assured by using the NFSFT_PRESERVE_F_HAT, NFSFT_PRESERVE_X, NFSFT_PRESERVE_F and NFSFT_DESTROY_F_HAT, NFSFT_DESTROY_X, NFSFT_DESTROY_F flags.
|
By default, all computations are performed with respect to the unnormalized basis functions
If this flag is set, all computations are carried out using the - normalized basis functions
.
Definition at line 1718 of file nfft3.h. Referenced by main(), ndsft_adjoint(), ndsft_trafo(), nfsft_adjoint(), and nfsft_trafo(). |
|
If this flag is set, the fast NFSFT algorithms (see nfsft_trafo, nfsft_adjoint) will use internally the exact but usually slower direct NDFT algorithm in favor of fast but approximative NFFT algorithm.
Definition at line 1730 of file nfft3.h. Referenced by main(), nfsft_adjoint(), and nfsft_trafo(). |
|
If this flag is set, the fast NFSFT algorithms (see nfsft_trafo, nfsft_adjoint) will use internally the usually slower direct DPT algorithm in favor of the fast FPT algorithm.
Definition at line 1743 of file nfft3.h. Referenced by main(), nfsft_adjoint(), and nfsft_trafo(). |
|
If this flag is set, the init methods (see nfsft_init , nfsft_init_advanced , and nfsft_init_guru) will allocate memory and the method nfsft_finalize will free the array
Otherwise, you have to assure by yourself that
Definition at line 1758 of file nfft3.h. Referenced by nfsft_finalize(), nfsft_init(), and nfsft_init_guru(). |
|
If this flag is set, the init methods (see nfsft_init , nfsft_init_advanced , and nfsft_init_guru) will allocate memory and the method nfsft_finalize will free the array
Otherwise, you have to assure by yourself that
Definition at line 1773 of file nfft3.h. Referenced by nfsft_finalize(), nfsft_init(), and nfsft_init_guru(). |
|
If this flag is set, the init methods (see nfsft_init , nfsft_init_advanced , and nfsft_init_guru) will allocate memory and the method nfsft_finalize will free the array
Otherwise, you have to assure by yourself that
Definition at line 1788 of file nfft3.h. Referenced by nfsft_finalize(), nfsft_init(), and nfsft_init_guru(). |
|
If this flag is set, it is guaranteed that during an execution of ndsft_trafo or nfsft_trafo the content of
Definition at line 1800 of file nfft3.h. Referenced by ndsft_trafo(), nfsft_finalize(), nfsft_init_guru(), and nfsft_trafo(). |
|
If this flag is set, it is guaranteed that during an execution of ndsft_trafo, nfsft_trafo or ndsft_adjoint, nfsft_adjoint the content of
|
|
If this flag is set, it is guaranteed that during an execution of ndsft_adjoint or nfsft_adjoint the content of
|
|
If this flag is set, it is explicitely allowed that during an execution of ndsft_trafo or nfsft_trafo the content of
|
|
If this flag is set, it is explicitely allowed that during an execution of ndsft_trafo, nfsft_trafo or ndsft_adjoint, nfsft_adjoint the content of
|
|
If this flag is set, it is explicitely allowed that during an execution of ndsft_adjoint or nfsft_adjoint the content of
|
|
If this flag is set, the transforms ndsft_trafo and ndsft_adjoint do not work. Setting this flag saves some memory for precomputed data.
Definition at line 1872 of file nfft3.h. Referenced by ndsft_adjoint(), ndsft_trafo(), nfsft_forget(), and nfsft_precompute(). |
|
If this flag is set, the transforms nfsft_trafo and nfsft_adjoint do not work. Setting this flag saves memory for precomputed data.
Definition at line 1883 of file nfft3.h. Referenced by main(), nfsft_adjoint(), nfsft_forget(), nfsft_init_guru(), nfsft_precompute(), and nfsft_trafo(). |
|
If this flag is set, the transforms nfsft_adjoint and ndsft_adjoint set all unused entries in
Definition at line 1892 of file nfft3.h. Referenced by ndsft_adjoint(), and nfsft_adjoint(). |
|
The default NFFT cutoff parameter.
Definition at line 34 of file nfsft.c. Referenced by nfsft_init_advanced(). |
|
The default threshold for the FPT.
|
|
The break-even bandwidth .
Definition at line 48 of file nfsft.c. Referenced by nfsft_adjoint(), nfsft_forget(), nfsft_precompute(), and nfsft_trafo(). |
|
Creates a transform plan.
Definition at line 225 of file nfsft.c. References nfsft_init_advanced(), NFSFT_MALLOC_F, NFSFT_MALLOC_F_HAT, and NFSFT_MALLOC_X. |
|
Creates a transform plan.
Definition at line 232 of file nfsft.c. References FFT_OUT_OF_PLACE, FFTW_INIT, NFSFT_DEFAULT_NFFT_CUTOFF, nfsft_init_guru(), PRE_PHI_HUT, and PRE_PSI. Referenced by nfsft_init(). |
|
Creates a transform plan.
Definition at line 240 of file nfsft.c. References nfft_plan::f, nfsft_plan::f, nfft_plan::f_hat, nfsft_plan::f_hat, nfsft_plan::f_hat_intern, nfsft_plan::flags, nfsft_plan::M_total, nfsft_plan::N, nfsft_plan::N_total, nfft_init_guru(), NFSFT_MALLOC_F, NFSFT_MALLOC_F_HAT, NFSFT_MALLOC_X, NFSFT_NO_FAST_ALGORITHM, NFSFT_PRESERVE_F_HAT, nfsft_plan::plan_nfft, nfft_plan::x, and nfsft_plan::x. Referenced by main(), and nfsft_init_advanced(). |
|
Performes precomputation up to the next power of two with respect to a given bandwidth .
Definition at line 326 of file nfsft.c. References nfsft_wisdom::alpha, alpha_al_all(), alpha_al_row(), nfsft_wisdom::beta, beta_al_all(), beta_al_row(), nfsft_wisdom::flags, FPT_AL_SYMMETRY, fpt_init(), FPT_PERSISTENT_DATA, fpt_precompute(), nfsft_wisdom::gamma, gamma_al_all(), gamma_al_row(), nfsft_wisdom::initialized, nfsft_wisdom::N_MAX, nfft_next_power_of_2_exp(), NFSFT_BREAK_EVEN, NFSFT_NO_DIRECT_ALGORITHM, NFSFT_NO_FAST_ALGORITHM, ROW, nfsft_wisdom::set, and nfsft_wisdom::T_MAX. Referenced by main(). |
|
Forgets all precomputed data.
Definition at line 428 of file nfsft.c. References nfsft_wisdom::alpha, nfsft_wisdom::beta, nfsft_wisdom::flags, fpt_finalize(), nfsft_wisdom::gamma, nfsft_wisdom::initialized, nfsft_wisdom::N_MAX, NFSFT_BREAK_EVEN, NFSFT_NO_DIRECT_ALGORITHM, NFSFT_NO_FAST_ALGORITHM, and nfsft_wisdom::set. Referenced by main(). |
|
Executes a direct NDSFT, i.e. computes for
Definition at line 501 of file nfsft.c. References nfsft_wisdom::alpha, nfsft_plan::f, nfsft_plan::f_hat, nfsft_plan::f_hat_intern, nfsft_plan::flags, nfsft_wisdom::flags, nfsft_wisdom::gamma, nfsft_plan::N, nfsft_plan::N_total, NFSFT_INDEX, NFSFT_NO_DIRECT_ALGORITHM, NFSFT_NORMALIZED, NFSFT_PRESERVE_F_HAT, PI, ROW, ROWK, and nfsft_plan::x. Referenced by main(), and nfsft_trafo(). |
|
Executes a direct adjoint NDSFT, i.e. computes for
Definition at line 633 of file nfsft.c. References nfsft_wisdom::alpha, nfsft_plan::f, nfsft_plan::f_hat, nfsft_plan::flags, nfsft_wisdom::flags, nfsft_wisdom::gamma, nfsft_plan::N, nfsft_plan::N_total, NFSFT_INDEX, NFSFT_NO_DIRECT_ALGORITHM, NFSFT_NORMALIZED, NFSFT_ZERO_F_HAT, PI, ROW, ROWK, and nfsft_plan::x. Referenced by main(), and nfsft_adjoint(). |
|
Executes a NFSFT, i.e. computes for
Definition at line 745 of file nfsft.c. References c2e(), dpt_trafo(), nfsft_plan::f, nfft_plan::f, nfft_plan::f_hat, nfsft_plan::f_hat, nfsft_plan::f_hat_intern, nfsft_plan::flags, nfsft_wisdom::flags, fpt_trafo(), nfsft_wisdom::initialized, nfsft_plan::N, nfsft_wisdom::N_MAX, nfsft_plan::N_total, ndft_trafo(), ndsft_trafo(), nfft_trafo(), NFSFT_BREAK_EVEN, NFSFT_INDEX, NFSFT_NO_FAST_ALGORITHM, NFSFT_NORMALIZED, NFSFT_PRESERVE_F_HAT, NFSFT_USE_DPT, NFSFT_USE_NDFT, PI, nfsft_plan::plan_nfft, nfsft_wisdom::set, nfsft_plan::x, and nfft_plan::x. Referenced by main(). |
|
Executes an adjoint NFSFT, i.e. computes for
Definition at line 864 of file nfsft.c. References c2e_transposed(), dpt_transposed(), nfsft_plan::f, nfft_plan::f, nfsft_plan::f_hat, nfft_plan::f_hat, nfsft_plan::flags, nfsft_wisdom::flags, fpt_transposed(), nfsft_wisdom::initialized, nfsft_plan::N, nfsft_wisdom::N_MAX, ndft_adjoint(), ndsft_adjoint(), nfft_adjoint(), NFSFT_BREAK_EVEN, NFSFT_INDEX, NFSFT_NO_FAST_ALGORITHM, NFSFT_NORMALIZED, NFSFT_USE_DPT, NFSFT_USE_NDFT, NFSFT_ZERO_F_HAT, PI, nfsft_plan::plan_nfft, nfsft_wisdom::set, nfsft_plan::x, and nfft_plan::x. Referenced by main(). |
|
Destroys a plan.
Definition at line 467 of file nfsft.c. References nfsft_plan::f, nfsft_plan::f_hat, nfsft_plan::f_hat_intern, nfsft_plan::flags, nfft_finalize(), NFSFT_MALLOC_F, NFSFT_MALLOC_F_HAT, NFSFT_MALLOC_X, NFSFT_PRESERVE_F_HAT, nfsft_plan::plan_nfft, and nfsft_plan::x. Referenced by main(). |
|
Computes three-term recurrence coefficients of associated Legendre functions.
Definition at line 9 of file legendre.c. Referenced by alpha_al_all(), and alpha_al_row(). |
|
Computes three-term recurrence coefficients of associated Legendre functions.
Definition at line 36 of file legendre.c. Referenced by beta_al_all(), and beta_al_row(). |
|
Computes three-term recurrence coefficients of associated Legendre functions.
Definition at line 48 of file legendre.c. Referenced by gamma_al_all(), and gamma_al_row(). |
|
Compute three-term-recurrence coefficients of associated Legendre functions for .
Definition at line 106 of file legendre.c. References alpha_al(). Referenced by nfsft_precompute(). |
|
Compute three-term-recurrence coefficients of associated Legendre functions for .
Definition at line 120 of file legendre.c. References beta_al(). Referenced by nfsft_precompute(). |
|
Compute three-term-recurrence coefficients of associated Legendre functions for .
Definition at line 134 of file legendre.c. References gamma_al(). Referenced by nfsft_precompute(). |
|
Evaluates an associated Legendre polynomials using the Clenshaw-algorithm.
Definition at line 148 of file legendre.c. |
|
Evaluates an associated Legendre polynomials using the Clenshaw-algorithm if it no exceeds a given threshold.
Definition at line 193 of file legendre.c. |
|
Converts coefficients with , from a linear combination of Chebyshev polynomials
to coefficients matching the representation by complex exponentials
for each order .
< The order k < Stores temporary values < Stores temporary values < Auxilliary pointer < Auxilliary pointer < Lower loop bound < Upper loop bound < Lower loop bound for even terms < Upper loop bound for even terms Definition at line 80 of file nfsft.c. References nfsft_plan::f_hat_intern, nfsft_plan::N, and NFSFT_INDEX. Referenced by nfsft_trafo(). |
|
Transposed version of the function c2e.
< The order k < Stores temporary values < Stores temporary values < Auxilliary pointer < Auxilliary pointer < Lower loop bound < Upper loop bound < Lower loop bound for even terms < Upper loop bound for even terms Definition at line 158 of file nfsft.c. References nfsft_plan::f_hat, nfsft_plan::N, and NFSFT_INDEX. Referenced by nfsft_adjoint(). |
|
The global wisdom structure for precomputed data.
|