NFFT Logo 3.0 API Reference
Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

Util - Auxilliary functions

This module implements frequently used utility functions. More...

Defines

#define NFFT_SWAP_complex(x, y)   {double complex* temp; temp=(x); (x)=(y); (y)=temp;}
 Swapping of two vectors.
#define NFFT_SWAP_double(x, y)   {double* temp; temp=(x); (x)=(y); (y)=temp;}
 Swapping of two vectors.
#define PI   3.1415926535897932384
 Formerly known to be an irrational number.
#define NFFT_MAX(a, b)   ((a)>(b)? (a) : (b))
 Maximum of its two arguments.
#define NFFT_MIN(a, b)   ((a)<(b)? (a) : (b))
 Mimimum of its two arguments.

Functions

double nfft_second ()
 Actual used CPU time in seconds; calls getrusage, limited accuracy.
int nfft_total_used_memory ()
 Actual used memory in bytes; calls mallinfo if define HAVE_MALLOC_H.
int nfft_ld (int m)
 Integer logarithm of 2.
int nfft_int_2_pow (int a)
 Integer power of 2.
int nfft_next_power_of_2 (int N)
 Computes $n\ge N$ such that $n=2^j,\, j\in\mathbb{N}_0$ .
void nfft_next_power_of_2_exp (int N, int *N2, int *t)
 Computes ?
double nfft_sinc (double x)
 Computes the sinus cardinalis $\frac{sin\left(x\right)}{x}$ .
double nfft_bspline_old (int k, double x, double *A)
 To test the new one.
double nfft_bspline (int k, double x, double *scratch)
 Computes the B-spline $M_{k,0}\left(x\right)$ , scratch is used for de Boor's scheme.
double nfft_i0 (double x)
 Modified Bessel function of order zero; adapted from Stephen Moshier's Cephes Math Library Release 2.8.
int nfft_prod_int (int *vec, int d)
 Computes integer $\prod_{t=0}^{d-1} v_t$ .
int nfct_prod_int (int *vec, int d)
 Computes integer $\prod_{t=0}^{d-1} v_t$ .
int nfst_prod_minus_a_int (int *vec, int a, int d)
 Computes integer $\prod_{t=0}^{d-1} v_t-a$ .
int nfft_plain_loop (int *idx, int *N, int d)
 Computes $\sum_{t=0}^{d-1} i_t \prod_{t'=t+1}^{d-1} N_{t'}$ .
double nfft_prod_real (double *vec, int d)
 Computes double $\prod_{t=0}^{d-1} v_t$ .
double nfft_dot_complex (double complex *x, int n)
 Computes the inner/dot product $x^H x$ .
double nfft_dot_double (double *x, int n)
 Computes the inner/dot product $x^H x$ .
double nfft_dot_w_complex (double complex *x, double *w, int n)
 Computes the weighted inner/dot product $x^H (w \odot x)$ .
double nfft_dot_w_double (double *x, double *w, int n)
 Computes the weighted inner/dot product $x^H (w \odot x)$ .
double nfft_dot_w_w2_complex (double complex *x, double *w, double *w2, int n)
 Computes the weighted inner/dot product $x^H (w1\odot w2\odot w2 \odot x)$ .
double nfft_dot_w2_complex (double complex *x, double *w2, int n)
 Computes the weighted inner/dot product $x^H (w2\odot w2 \odot x)$ .
void nfft_cp_complex (double complex *x, double complex *y, int n)
 Copies $x \leftarrow y$ .
void nfft_cp_double (double *x, double *y, int n)
 Copies $x \leftarrow y$ .
void nfft_cp_a_complex (double complex *x, double a, double complex *y, int n)
 Copies $x \leftarrow a y$ .
void nfft_cp_w_complex (double complex *x, double *w, double complex *y, int n)
 Copies $x \leftarrow w\odot y$ .
void nfft_cp_w_double (double *x, double *w, double *y, int n)
 Copies $x \leftarrow w\odot y$ .
void nfft_upd_axpy_complex (double complex *x, double a, double complex *y, int n)
 Updates $x \leftarrow a x + y$ .
void nfft_upd_axpy_double (double *x, double a, double *y, int n)
 Updates $x \leftarrow a x + y$ .
void nfft_upd_xpay_complex (double complex *x, double a, double complex *y, int n)
 Updates $x \leftarrow x + a y$ .
void nfft_upd_xpay_double (double *x, double a, double *y, int n)
 Updates $x \leftarrow x + a y$ .
void nfft_upd_axpby_complex (double complex *x, double a, double complex *y, double b, int n)
 Updates $x \leftarrow a x + b y$ .
void nfft_upd_axpby_double (double *x, double a, double *y, double b, int n)
 Updates $x \leftarrow a x + b y$ .
void nfft_upd_xpawy_complex (double complex *x, double a, double *w, double complex *y, int n)
 Updates $x \leftarrow x + a w\odot y$ .
void nfft_upd_xpawy_double (double *x, double a, double *w, double *y, int n)
 Updates $x \leftarrow x + a w\odot y$ .
void nfft_upd_axpwy_complex (double complex *x, double a, double *w, double complex *y, int n)
 Updates $x \leftarrow a x + w\odot y$ .
void nfft_upd_axpwy_double (double *x, double a, double *w, double *y, int n)
 Updates $x \leftarrow a x + w\odot y$ .
void nfft_fftshift_complex (double complex *x, int d, int *N)
 Swaps each half over N[d]/2.
double nfft_error_l_infty_complex (double complex *x, double complex *y, int n)
 Computes $\frac{\|x-y\|_{\infty}}{\|x\|_{\infty}} $.
double nfft_error_l_infty_double (double *x, double *y, int n)
 Computes $\frac{\|x-y\|_{\infty}}{\|x\|_{\infty}} $.
double nfft_error_l_infty_1_complex (double complex *x, double complex *y, int n, double complex *z, int m)
 Computes $\frac{\|x-y\|_{\infty}}{\|z\|_1} $.
double nfft_error_l_infty_1_double (double *x, double *y, int n, double *z, int m)
 Computes $\frac{\|x-y\|_{\infty}}{\|z\|_1} $.
double nfft_error_l_2_complex (double complex *x, double complex *y, int n)
 Computes $\frac{\|x-y\|_2}{\|x\|_2} $.
double nfft_error_l_2_double (double *x, double *y, int n)
 Computes $\frac{\|x-y\|_2}{\|x\|_2} $.
void nfft_vpr_int (int *x, int n, char *text)
 Prints a vector of integer numbers.
void nfft_vpr_double (double *x, int n, char *text)
 Prints a vector of doubles numbers.
void nfft_vpr_complex (double complex *x, int n, char *text)
 Prints a vector of complex numbers.
void nfft_vrand_unit_complex (double complex *x, int n)
 Inits a vector of random complex numbers in $[0,1]\times[0,1]{\rm i}$ .
void nfft_vrand_shifted_unit_double (double *x, int n)
 Inits a vector of random double numbers in $[-1/2,1/2]$ .
void nfft_voronoi_weights_1d (double *w, double *x, int M)
 Computes non periodic voronoi weights, assumes ordered nodes $x_j$.
double nfft_modified_fejer (int N, int kk)
 Computes the damping factor for the modified Fejer kernel, ie $\frac{2}{N}\left(1-\frac{\left|2k+1\right|}{N}\right)$.
double nfft_modified_jackson2 (int N, int kk)
 Computes the damping factor for the modified Jackson kernel.
double nfft_modified_jackson4 (int N, int kk)
 Computes the damping factor for the modified generalised Jackson kernel.
double nfft_modified_sobolev (double mu, int kk)
 Computes the damping factor for the modified Sobolev kernel.
double nfft_modified_multiquadric (double mu, double c, int kk)
 Computes the damping factor for the modified multiquadric kernel.

Detailed Description

This module implements frequently used utility functions.

In particular, this includes simple measurement of resources, evaluation of window functions, vector routines for basic linear algebra tasks, and computation of weights for the inverse transforms.


Function Documentation

double nfft_second  ) 
 

Actual used CPU time in seconds; calls getrusage, limited accuracy.

Calls getrusage, limited accuracy

Definition at line 25 of file util.c.

Referenced by comparison_fft(), fgt_test_measure_time(), inverse_linogram_fft(), inverse_mpolar_fft(), linogram_dft(), linogram_fft(), main(), mpolar_dft(), mpolar_fft(), ndft_time(), reconstruct(), taylor_time_accuracy(), and time_accuracy().

double nfft_bspline int  k,
double  x,
double *  scratch
 

Computes the B-spline $M_{k,0}\left(x\right)$ , scratch is used for de Boor's scheme.

< M_{k,0}(x)

< $x \in {\rm supp}(M_{0,r}) $

< boundaries

< indices

< alpha of the de Boor scheme

Definition at line 237 of file util.c.

double nfft_i0 double  x  ) 
 

Modified Bessel function of order zero; adapted from Stephen Moshier's Cephes Math Library Release 2.8.

Cephes Math Library Release 2.8: June, 2000 Copyright 1984, 1987, 2000 by Stephen L. Moshier

Definition at line 861 of file util.c.

double nfft_modified_fejer int  N,
int  kk
 

Computes the damping factor for the modified Fejer kernel, ie $\frac{2}{N}\left(1-\frac{\left|2k+1\right|}{N}\right)$.

/f${2}{N}(1-{|2k+1|}{N})/f$

Definition at line 1428 of file util.c.


Generated on 1 Nov 2006 by Doxygen 1.4.4