Split Xu and None.

Former-commit-id: 3a7198907df8d1cbcb41ad7f0923bc8757183d83
This commit is contained in:
Marek Nečada 2018-05-07 03:46:55 +00:00
parent 0b4044f267
commit 45edb30a62
2 changed files with 10 additions and 10 deletions

View File

@ -27,8 +27,8 @@ typedef enum {
#define QPMS_NORMALISATION_T_CSBIT 128 #define QPMS_NORMALISATION_T_CSBIT 128
typedef enum { typedef enum {
// As in TODO // As in TODO
QPMS_NORMALISATION_XU = 3, QPMS_NORMALISATION_XU = 4, // such that the numerical values in Xu's tables match
QPMS_NORMALISATION_NONE = QPMS_NORMALISATION_XU, QPMS_NORMALISATION_NONE = 3, // genuine unnormalised waves (with unnormalised Legendre polynomials)
// As in http://www.eit.lth.se/fileadmin/eit/courses/eit080f/Literature/book.pdf, power-normalised // As in http://www.eit.lth.se/fileadmin/eit/courses/eit080f/Literature/book.pdf, power-normalised
QPMS_NORMALISATION_KRISTENSSON = 2, QPMS_NORMALISATION_KRISTENSSON = 2,
QPMS_NORMALISATION_POWER = QPMS_NORMALISATION_KRISTENSSON, QPMS_NORMALISATION_POWER = QPMS_NORMALISATION_KRISTENSSON,
@ -37,7 +37,7 @@ typedef enum {
QPMS_NORMALISATION_SPHARM = QPMS_NORMALISATION_TAYLOR, QPMS_NORMALISATION_SPHARM = QPMS_NORMALISATION_TAYLOR,
// Variants with Condon-Shortley phase // Variants with Condon-Shortley phase
QPMS_NORMALISATION_XU_CS = QPMS_NORMALISATION_XU | QPMS_NORMALISATION_T_CSBIT, QPMS_NORMALISATION_XU_CS = QPMS_NORMALISATION_XU | QPMS_NORMALISATION_T_CSBIT,
QPMS_NORMALISATION_NONE_CS = QPMS_NORMALISATION_XU_CS, QPMS_NORMALISATION_NONE_CS = QPMS_NORMALISATION_NONE | QPMS_NORMALISATION_T_CSBIT,
QPMS_NORMALISATION_KRISTENSSON_CS = QPMS_NORMALISATION_KRISTENSSON | QPMS_NORMALISATION_T_CSBIT, QPMS_NORMALISATION_KRISTENSSON_CS = QPMS_NORMALISATION_KRISTENSSON | QPMS_NORMALISATION_T_CSBIT,
QPMS_NORMALISATION_POWER_CS = QPMS_NORMALISATION_KRISTENSSON_CS, QPMS_NORMALISATION_POWER_CS = QPMS_NORMALISATION_KRISTENSSON_CS,
QPMS_NORMALISATION_TAYLOR_CS = QPMS_NORMALISATION_TAYLOR | QPMS_NORMALISATION_T_CSBIT, QPMS_NORMALISATION_TAYLOR_CS = QPMS_NORMALISATION_TAYLOR | QPMS_NORMALISATION_T_CSBIT,
@ -73,7 +73,7 @@ static inline double qpms_normalisation_t_factor(qpms_normalisation_t norm, qpms
case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_TAYLOR:
factor = sqrt(l*(l+1)); factor = sqrt(l*(l+1));
break; break;
case QPMS_NORMALISATION_XU: case QPMS_NORMALISATION_NONE:
factor = sqrt(l*(l+1) * 4 * M_PI / (2*l+1) * exp(lgamma(l+m+1)-lgamma(l-m+1))); factor = sqrt(l*(l+1) * 4 * M_PI / (2*l+1) * exp(lgamma(l+m+1)-lgamma(l-m+1)));
break; break;
default: default:
@ -94,7 +94,7 @@ static inline double qpms_normalisation_t_factor_abssquare(qpms_normalisation_t
case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_TAYLOR:
return l*(l+1); return l*(l+1);
break; break;
case QPMS_NORMALISATION_XU: case QPMS_NORMALISATION_NONE:
return l*(l+1) * 4 * M_PI / (2*l+1) * exp(lgamma(l+m+1)-lgamma(l-m+1)); return l*(l+1) * 4 * M_PI / (2*l+1) * exp(lgamma(l+m+1)-lgamma(l-m+1));
break; break;
default: default:

View File

@ -790,7 +790,7 @@ int qpms_trans_calculator_multipliers_A(qpms_normalisation_t norm, complex doubl
return 0; return 0;
break; break;
#endif #endif
case QPMS_NORMALISATION_XU: case QPMS_NORMALISATION_NONE:
case QPMS_NORMALISATION_KRISTENSSON: case QPMS_NORMALISATION_KRISTENSSON:
qpms_trans_calculator_multipliers_A_general(norm, dest, m, n, mu, nu, qmax); qpms_trans_calculator_multipliers_A_general(norm, dest, m, n, mu, nu, qmax);
return 0; return 0;
@ -809,7 +809,7 @@ int qpms_trans_calculator_multipliers_B(qpms_normalisation_t norm, complex doubl
return 0; return 0;
break; break;
#endif #endif
case QPMS_NORMALISATION_XU: case QPMS_NORMALISATION_NONE:
case QPMS_NORMALISATION_KRISTENSSON: case QPMS_NORMALISATION_KRISTENSSON:
qpms_trans_calculator_multipliers_B_general(norm, dest, m, n, mu, nu, Qmax); qpms_trans_calculator_multipliers_B_general(norm, dest, m, n, mu, nu, Qmax);
return 0; return 0;
@ -918,7 +918,7 @@ complex double qpms_trans_calculator_get_A_buf(const qpms_trans_calculator *c,
// TODO use normalised legendre functions for Taylor and Kristensson // TODO use normalised legendre functions for Taylor and Kristensson
case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_TAYLOR:
case QPMS_NORMALISATION_KRISTENSSON: case QPMS_NORMALISATION_KRISTENSSON:
case QPMS_NORMALISATION_XU: case QPMS_NORMALISATION_NONE:
{ {
double costheta = cos(kdlj.theta); double costheta = cos(kdlj.theta);
if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,n+nu, if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,n+nu,
@ -967,7 +967,7 @@ complex double qpms_trans_calculator_get_B_buf(const qpms_trans_calculator *c,
switch(c->normalisation) { switch(c->normalisation) {
case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_TAYLOR:
case QPMS_NORMALISATION_KRISTENSSON: case QPMS_NORMALISATION_KRISTENSSON:
case QPMS_NORMALISATION_XU: case QPMS_NORMALISATION_NONE:
{ {
double costheta = cos(kdlj.theta); double costheta = cos(kdlj.theta);
if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,n+nu+1, if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,n+nu+1,
@ -998,7 +998,7 @@ int qpms_trans_calculator_get_AB_buf_p(const qpms_trans_calculator *c,
switch(qpms_normalisation_t_normonly(c->normalisation)) { switch(qpms_normalisation_t_normonly(c->normalisation)) {
case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_TAYLOR:
case QPMS_NORMALISATION_KRISTENSSON: case QPMS_NORMALISATION_KRISTENSSON:
case QPMS_NORMALISATION_XU: case QPMS_NORMALISATION_NONE:
{ {
double costheta = cos(kdlj.theta); double costheta = cos(kdlj.theta);
if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,n+nu+1, if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,n+nu+1,