My Project
Macros | Functions
ssht_test.c File Reference
#include <complex.h>
#include <fftw3.h>
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "ssht.h"

Go to the source code of this file.

Macros

#define NREPEAT   5
 
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 

Functions

double ran2_dp (int idum)
 
void ssht_test_gen_flm_complex (complex double *flm, int L, int spin, int seed)
 
void ssht_test_gen_flm_real (complex double *flm, int L, int seed)
 
void ssht_test_gen_lb_flm_complex (complex double *flm, int L_zero, int L, int spin, int seed)
 
void ssht_test_gen_lb_flm_real (complex double *flm, int L0, int L, int seed)
 
int null_test (const complex double *X, int n)
 
int nan_test (const complex double *X, int n)
 
int main (int argc, char *argv[])
 

Detailed Description

Applies SSHT algorithms to perform inverse and forward spherical harmonic transforms (respectively) to check that the original signal is reconstructed exactly (to numerical precision). Test is performed on a random signal with harmonic coefficients uniformly sampled from (-1,1).

Usage: ssht_test B spin [B0], e.g. ssht_test 64 2 32

Author
Jason McEwen

Definition in file ssht_test.c.

Macro Definition Documentation

◆ MAX

#define MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 28 of file ssht_test.c.

◆ NREPEAT

#define NREPEAT   5

Definition at line 27 of file ssht_test.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Definition at line 68 of file ssht_test.c.

References MAX, nan_test(), NREPEAT, null_test(), ssht_core_dh_forward_sov(), ssht_core_dh_forward_sov_real(), ssht_core_dh_inverse_sov(), ssht_core_dh_inverse_sov_real(), ssht_core_gl_forward_sov(), ssht_core_gl_forward_sov_real(), ssht_core_gl_inverse_sov(), ssht_core_gl_inverse_sov_real(), ssht_core_mw_forward_sov_conv_sym(), ssht_core_mw_forward_sov_conv_sym_pole(), ssht_core_mw_forward_sov_conv_sym_real(), ssht_core_mw_forward_sov_conv_sym_real_pole(), ssht_core_mw_forward_sov_conv_sym_ss(), ssht_core_mw_forward_sov_conv_sym_ss_pole(), ssht_core_mw_forward_sov_conv_sym_ss_real(), ssht_core_mw_forward_sov_conv_sym_ss_real_pole(), ssht_core_mw_inverse_sov_sym(), ssht_core_mw_inverse_sov_sym_pole(), ssht_core_mw_inverse_sov_sym_real(), ssht_core_mw_inverse_sov_sym_real_pole(), ssht_core_mw_inverse_sov_sym_ss(), ssht_core_mw_inverse_sov_sym_ss_pole(), ssht_core_mw_inverse_sov_sym_ss_real(), ssht_core_mw_inverse_sov_sym_ss_real_pole(), ssht_core_mw_lb_forward_sov_conv_sym(), ssht_core_mw_lb_forward_sov_conv_sym_real(), ssht_core_mw_lb_forward_sov_conv_sym_ss(), ssht_core_mw_lb_forward_sov_conv_sym_ss_real(), ssht_core_mw_lb_inverse_sov_sym(), ssht_core_mw_lb_inverse_sov_sym_real(), ssht_core_mw_lb_inverse_sov_sym_ss(), ssht_core_mw_lb_inverse_sov_sym_ss_real(), SSHT_DL_RISBO, SSHT_ERROR_MEM_ALLOC_CHECK, ssht_test_gen_flm_complex(), ssht_test_gen_flm_real(), ssht_test_gen_lb_flm_complex(), and ssht_test_gen_lb_flm_real().

◆ nan_test()

int nan_test ( const complex double *  X,
int  n 
)

Test for nan vector

Parameters
[in]Xvector of complex double
[in]nlength of X.
Return values
Yreturns int 1 if no nans, 0 if nan entires exist. i.e. 0 = fail, 1 = pass.

Definition at line 61 of file ssht_test.c.

Referenced by main().

◆ null_test()

int null_test ( const complex double *  X,
int  n 
)

Test for null vector

Parameters
[in]Xvector of complex double
[in]nlength of X.
Return values
Yreturns int 0 if all zeros, 1 if non-zero i.e. 0 = fail, 1 = pass.

Definition at line 45 of file ssht_test.c.

Referenced by main().

◆ ran2_dp()

double ran2_dp ( int  idum)

Generate uniform deviate in range [0,1) given seed. (Using double precision.)

Note
Uniform deviate (Num rec 1992, chap 7.1), original routine said to be 'perfect'.
Parameters
[in]idumSeed.
Return values
ran_dpGenerated uniform deviate.
Author
Jason McEwen

Definition at line 1128 of file ssht_test.c.

◆ ssht_test_gen_flm_complex()

void ssht_test_gen_flm_complex ( complex double *  flm,
int  L,
int  spin,
int  seed 
)

Generate random spherical harmonic coefficients of a complex signal.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]LHarmonic band-limit.
[in]spinSpin number.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen

Definition at line 1082 of file ssht_test.c.

Referenced by main().

◆ ssht_test_gen_flm_real()

void ssht_test_gen_flm_real ( complex double *  flm,
int  L,
int  seed 
)

Generate random spherical harmonic coefficients of a real spin=0 signal.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]LHarmonic band-limit.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen

Definition at line 1006 of file ssht_test.c.

Referenced by main().

◆ ssht_test_gen_lb_flm_complex()

void ssht_test_gen_lb_flm_complex ( complex double *  flm,
int  L0,
int  L,
int  spin,
int  seed 
)

Generate random spherical harmonic coefficients of a complex signal with lower band-limit.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]L0Lower harmonic band-limit.
[in]LUpper harmonic band-limit.
[in]spinSpin number.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen

Definition at line 1105 of file ssht_test.c.

Referenced by main().

◆ ssht_test_gen_lb_flm_real()

void ssht_test_gen_lb_flm_real ( complex double *  flm,
int  L0,
int  L,
int  seed 
)

Generate random spherical harmonic coefficients of a real spin=0 signal with lower band-limit.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]L0Lower harmonic band-limit.
[in]LUpper harmonic band-limit.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen

Definition at line 1038 of file ssht_test.c.

Referenced by main().