Ssht  1.3.3
Fast and exact spin spherical harmonic transforms
Enumerations | Functions
ssht_dl.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  ssht_dl_size_t { SSHT_DL_QUARTER = 0, SSHT_DL_QUARTER_EXTENDED, SSHT_DL_HALF, SSHT_DL_FULL }
 
enum  ssht_dl_method_t { SSHT_DL_RISBO = 0, SSHT_DL_TRAPANI }
 

Functions

double * ssht_dl_calloc (int L, ssht_dl_size_t dl_size)
 
int ssht_dl_get_offset (int L, ssht_dl_size_t dl_size)
 
int ssht_dl_get_stride (int L, ssht_dl_size_t dl_size)
 
void ssht_dl_beta_risbo_full_table (double *dl, double beta, int L, ssht_dl_size_t dl_size, int el, double *sqrt_tbl)
 
void ssht_dl_beta_risbo_half_table (double *dl, double beta, int L, ssht_dl_size_t dl_size, int el, double *sqrt_tbl, double *signs)
 
void ssht_dl_beta_risbo_eighth_table (double *dl, double beta, int L, ssht_dl_size_t dl_size, int el, double *sqrt_tbl, double *signs)
 
void ssht_dl_beta_risbo_fill_eighth2quarter_table (double *dl, double *dl8, int L, ssht_dl_size_t dl_size, ssht_dl_size_t dl8_size, int el, double *signs)
 
void ssht_dl_beta_kostelec_full_table (double *dlm1p1, double *dl, double beta, int L, ssht_dl_size_t dl_size, int el, double *sqrt_tbl, double *signs)
 
void ssht_dl_beta_kostelec_line_table (double *dlm1p1_line, double *dl_line, double beta, int L, int mm, int el, double *sqrt_tbl, double *signs)
 
void ssht_dl_beta_kostelec_halfline_table (double *dlm1p1_line, double *dl_line, double beta, int L, int mm, int el, double *sqrt_tbl, double *signs)
 
void ssht_dl_halfpi_trapani_eighth_table (double *dl, int L, ssht_dl_size_t dl_size, int el, double *sqrt_tbl)
 
void ssht_dl_halfpi_trapani_quarter_table (double *dl, int L, ssht_dl_size_t dl_size, int el, double *sqrt_tbl)
 
void ssht_dl_halfpi_trapani_fill_eighth2righthalf_table (double *dl, int L, ssht_dl_size_t dl_size, int el, double *signs)
 
void ssht_dl_halfpi_trapani_fill_eighth2quarter_table (double *dl, int L, ssht_dl_size_t dl_size, int el, double *signs)
 

Enumeration Type Documentation

◆ ssht_dl_method_t

Recursion to use to compute dl plane for MW methods.

Enumerator
SSHT_DL_RISBO 
SSHT_DL_TRAPANI 

◆ ssht_dl_size_t

Size of dl plane required (for memory access).

Enumerator
SSHT_DL_QUARTER 
SSHT_DL_QUARTER_EXTENDED 
SSHT_DL_HALF 
SSHT_DL_FULL 

Function Documentation

◆ ssht_dl_beta_kostelec_full_table()

void ssht_dl_beta_kostelec_full_table ( double *  dlm1p1,
double *  dl,
double  beta,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  sqrt_tbl,
double *  signs 
)

Calculates (for m = -l:l and mm = -l:l) lth plane of a d-matrix for argument beta using the recursion method given in Kostelec and Rockmore (2010) (see equations (4.5)-(4.9)). For l>1, require the dl plane to be computed already with values for l-1 and l-2. Also takes a table of precomputed square roots of integers and signs to avoid recomputing them.

Parameters
[in,out]dlm1p1Wigner plane. On input this should be initialised to the plane computed for el-2. On output this will be replaced with the computed plane for el.
[in]dlWigner plane already computed for el-1.
[in]betaAngle to compute Wigner plan for.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el must be precomputed (i.e. sqrt_tbl should contian 2*el+1 elements).
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_beta_kostelec_halfline_table()

void ssht_dl_beta_kostelec_halfline_table ( double *  dlm1p1_line,
double *  dl_line,
double  beta,
int  L,
int  mm,
int  el,
double *  sqrt_tbl,
double *  signs 
)

Calculates half line of d-matrix for all m = 0:l and given mm = -l:l for argument beta using the recursion method given in Kostelec and Rockmore (2010) (see equations (4.5)-(4.9)). For l>abs(mm), require the dl plane to be computed already with values for l-1 and l-2. Also takes a table of precomputed square roots of integers and signs to avoid recomputing them.

Parameters
[in,out]dlm1p1_lineWigner line. On input this should be initialised to the line computed for el-2. On output this will be replaced with the computed line for el.
[in]dlWigner plane already computed for el-1.
[in]betaAngle to compute Wigner line for.
[in]LHarmonic band-limit.
[in]mmAzimuthal harmonic index to compute Wigner line for.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el must be precomputed (i.e. sqrt_tbl should contian 2*el+1 elements).
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_beta_kostelec_line_table()

void ssht_dl_beta_kostelec_line_table ( double *  dlm1p1_line,
double *  dl_line,
double  beta,
int  L,
int  mm,
int  el,
double *  sqrt_tbl,
double *  signs 
)

Calculates line of d-matrix for all m = -l:l and given mm = -l:l for argument beta using the recursion method given in Kostelec and Rockmore (2010) (see equations (4.5)-(4.9)). For l>abs(mm), require the dl plane to be computed already with values for l-1 and l-2. Also takes a table of precomputed square roots of integers and signs to avoid recomputing them.

Parameters
[in,out]dlm1p1_lineWigner line. On input this should be initialised to the line computed for el-2. On output this will be replaced with the computed line for el.
[in]dlWigner plane already computed for el-1.
[in]betaAngle to compute Wigner line for.
[in]LHarmonic band-limit.
[in]mmAzimuthal harmonic index to compute Wigner line for.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el must be precomputed (i.e. sqrt_tbl should contian 2*el+1 elements).
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_beta_risbo_eighth_table()

void ssht_dl_beta_risbo_eighth_table ( double *  dl,
double  beta,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  sqrt_tbl,
double *  signs 
)

Calculates (for m = -l:0 and mm = -l:m) lth plane of a d-matrix for argument beta using Risbo's recursion method. For l>0, require the dl plane to be computed already with values for l-1. Also takes a table of precomputed square roots of integers and signs to avoid recomputing them.

Note
Risbo's recursion requires the boundaries of the eighth of the Wigner plane to be extended slightly. Consequently, this routine should only be used with dl_size either SSHT_DL_QUARTER_EXTENDED or SSHT_DL_FULL.
Parameters
[in,out]dlWigner plane. On input this should be initialised to the plane computed for el-1. On output this will be replaced with the computed plane for el.
[in]betaAngle to compute Wigner line for.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el must be precomputed (i.e. sqrt_tbl should contian 2*el+1 elements).
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_beta_risbo_fill_eighth2quarter_table()

void ssht_dl_beta_risbo_fill_eighth2quarter_table ( double *  dl,
double *  dl8,
int  L,
ssht_dl_size_t  dl_size,
ssht_dl_size_t  dl8_size,
int  el,
double *  signs 
)

Fill in quarter Wigner plane for m = 0:l and mm = 0:l from the eighth m = -l:0 and mm = -l:m. Takes a table of precomputed signs to avoid recomputing them.

Note
It is necessary to fill the quarter Wigner plane in separate memory since the eighth plane for m = -l:0 and mm = -l:m with be required in subsequent recursions.
Parameters
[out]dlQuarter Wigner plane, computed by copying dl8 and extending with symmetries.
[in]dl8Eighth Wigner plane.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the dl memory.
[in]dl8_sizeSize type of the dl8 memory.
[in]elHarmonic index to compute Wigner plane for.
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_beta_risbo_full_table()

void ssht_dl_beta_risbo_full_table ( double *  dl,
double  beta,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  sqrt_tbl 
)

Calculates (for m = -l:l and mm = -l:l) lth plane of a d-matrix for argument beta using Risbo's recursion method. For l>0, require the dl plane to be computed already with values for l-1. Also takes a table of precomputed square roots of integers to avoid recomputing them.

Parameters
[in,out]dlWigner plane. On input this should be initialised to the plane computed for el-1. On output this will be replaced with the computed plane for el.
[in]betaAngle to compute Wigner line for.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el must be precomputed (i.e. sqrt_tbl should contian 2*el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_beta_risbo_half_table()

void ssht_dl_beta_risbo_half_table ( double *  dl,
double  beta,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  sqrt_tbl,
double *  signs 
)

Calculates (for m = -l:l and mm = -l:l) lth plane of a d-matrix for argument beta using Risbo's recursion method. Only half of the plane is computed by recusion and symmetry is used to fill the remaining plane. For l>0, require the dl plane to be computed already with values for l-1. Also takes a table of precomputed square roots of integers and signs to avoid recomputing them.

Parameters
[in,out]dlWigner plane. On input this should be initialised to the plane computed for el-1. On output this will be replaced with the computed plane for el.
[in]betaAngle to compute Wigner line for.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el must be precomputed (i.e. sqrt_tbl should contian 2*el+1 elements).
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_calloc()

double* ssht_dl_calloc ( int  L,
ssht_dl_size_t  dl_size 
)

Allocate memory to store dl plane.

Note
See file note regarding storage and access of dl memory.
Parameters
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate (specifying whether will need half or quarted dl plane, for example).
Return values
dlPointer to dl array with memory allocated.
Author
Jason McEwen

◆ ssht_dl_get_offset()

int ssht_dl_get_offset ( int  L,
ssht_dl_size_t  dl_size 
)

Compute the offset used for accessing dl memory.

Note
See file note regarding storage and access of dl memory.
Parameters
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate (specifying whether will need half or quarted dl plane, for example).
Return values
offsetThe offset to be used to access dl memory.
Author
Jason McEwen

◆ ssht_dl_get_stride()

int ssht_dl_get_stride ( int  L,
ssht_dl_size_t  dl_size 
)

Compute the stride used for accessing dl memory.

Note
See file note regarding storage and access of dl memory.
Parameters
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate (specifying whether will need half or quarted dl plane, for example).
Return values
strideThe stride to be used to access dl memory.
Author
Jason McEwen

◆ ssht_dl_halfpi_trapani_eighth_table()

void ssht_dl_halfpi_trapani_eighth_table ( double *  dl,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  sqrt_tbl 
)

Calculates eighth (for m = 0:l and mm = 0:m) of lth plane of a d-matrix for PI/2 using Trapani & Navaza's recursion method. For l>0, require the dl plane to be computed already with values for l-1. Also takes a table of precomputed square roots of integers to avoid recomputing them.

Parameters
[in,out]dlWigner plane. On input this should be initialised to the plane computed for el-1. On output this will be replaced with the computed plane for el.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el+1 must be precomputed (i.e. sqrt_tbl should contian 2*el+2 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_halfpi_trapani_fill_eighth2quarter_table()

void ssht_dl_halfpi_trapani_fill_eighth2quarter_table ( double *  dl,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  signs 
)

Fill in quarter Wigner plane for m = 0:l and mm = 0:l from the eighth m = 0:l and mm = 0:m. Takes a table of precomputed signs to avoid recomputing them.

Parameters
[in,out]dlWigner plane. On input should contain values computed for one eighth of plane. On output will contain values computed for quarter of plane, using symmetries to fill in these values.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_halfpi_trapani_fill_eighth2righthalf_table()

void ssht_dl_halfpi_trapani_fill_eighth2righthalf_table ( double *  dl,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  signs 
)

Fill in half Wigner plane for m = 0:l and mm = -l:l from the eighth m = 0:l and mm = 0:m. Takes a table of precomputed signs to avoid recomputing them.

Parameters
[in,out]dlWigner plane. On input should contain values computed for one eighth of plane. On output will contain values computed for right half of plane, using symmetries to fill in these values.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]signsPrecomputed array of signs. The array element at index i should contain the value (-1)^i. Values from 0 to el must be precomputed (i.e. signs should contian el+1 elements).
Return values
none
Author
Jason McEwen

◆ ssht_dl_halfpi_trapani_quarter_table()

void ssht_dl_halfpi_trapani_quarter_table ( double *  dl,
int  L,
ssht_dl_size_t  dl_size,
int  el,
double *  sqrt_tbl 
)

Calculates quarter (for m = 0:l and mm = 0:l) of lth plane of a d-matrix for PI/2 using Trapani & Navaza's recursion method. For l>0, require the dl plane to be computed already with values for l-1. Also takes a table of precomputed square roots of integers to avoid recomputing them.

Warning
THIS GOES UNSTABLE SOMEWHERE ABOVE A BAND-LIMIT OF 1024. Best to compute eighth of plane and then extend to quarter using symmetry (see ssht_dl_halfpi_trapani_eighth_table and ssht_dl_halfpi_trapani_fill_eighth2quarter_table).
Parameters
[in,out]dlWigner plane. On input this should be initialised to the plane computed for el-1. On output this will be replaced with the computed plane for el.
[in]LHarmonic band-limit.
[in]dl_sizeSize type of the memory to allocate.
[in]elHarmonic index to compute Wigner plane for.
[in]sqrt_tblPrecomputed array of square roots. The table element at index i should contain the value sqrt(i). Values from 0 to 2*el+1 must be precomputed (i.e. sqrt_tbl should contian 2*el+2 elements).
Return values
none
Author
Jason McEwen