Ssht  1.3.3
Fast and exact spin spherical harmonic transforms
Functions
utilities.c File Reference
#include "ssht/ssht.h"
#include "utilities.h"
#include <complex.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Include dependency graph for utilities.c:

Functions

int null_test (const complex double *X, int n)
 
int nan_test (const complex double *X, int n)
 
void gen_flm_real (complex double *flm, int L, int seed)
 
void gen_lb_flm_real (complex double *flm, int L0, int L, int seed)
 
void gen_flm_complex (complex double *flm, int L, int spin, int seed)
 
int max (int a, int b)
 
void gen_lb_flm_complex (complex double *flm, int L0, int L, int spin, int seed)
 
double ran2_dp (int idum)
 

Function Documentation

◆ gen_flm_complex()

void 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

◆ gen_flm_real()

void 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

◆ gen_lb_flm_complex()

void 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

◆ gen_lb_flm_real()

void 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

◆ max()

int max ( int  a,
int  b 
)

◆ 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.

◆ 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.

◆ 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