From 45edb30a62fb3cdb8f42f0268896adf69a31cc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Mon, 7 May 2018 03:46:55 +0000 Subject: [PATCH] Split Xu and None. Former-commit-id: 3a7198907df8d1cbcb41ad7f0923bc8757183d83 --- qpms/qpms_types.h | 10 +++++----- qpms/translations.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qpms/qpms_types.h b/qpms/qpms_types.h index 44b29ac..707aee9 100644 --- a/qpms/qpms_types.h +++ b/qpms/qpms_types.h @@ -27,8 +27,8 @@ typedef enum { #define QPMS_NORMALISATION_T_CSBIT 128 typedef enum { // As in TODO - QPMS_NORMALISATION_XU = 3, - QPMS_NORMALISATION_NONE = QPMS_NORMALISATION_XU, + QPMS_NORMALISATION_XU = 4, // such that the numerical values in Xu's tables match + 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 QPMS_NORMALISATION_KRISTENSSON = 2, QPMS_NORMALISATION_POWER = QPMS_NORMALISATION_KRISTENSSON, @@ -37,7 +37,7 @@ typedef enum { QPMS_NORMALISATION_SPHARM = QPMS_NORMALISATION_TAYLOR, // Variants with Condon-Shortley phase 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_POWER_CS = QPMS_NORMALISATION_KRISTENSSON_CS, 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: factor = sqrt(l*(l+1)); 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))); break; default: @@ -94,7 +94,7 @@ static inline double qpms_normalisation_t_factor_abssquare(qpms_normalisation_t case QPMS_NORMALISATION_TAYLOR: return l*(l+1); 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)); break; default: diff --git a/qpms/translations.c b/qpms/translations.c index 37bf595..b7263f2 100644 --- a/qpms/translations.c +++ b/qpms/translations.c @@ -790,7 +790,7 @@ int qpms_trans_calculator_multipliers_A(qpms_normalisation_t norm, complex doubl return 0; break; #endif - case QPMS_NORMALISATION_XU: + case QPMS_NORMALISATION_NONE: case QPMS_NORMALISATION_KRISTENSSON: qpms_trans_calculator_multipliers_A_general(norm, dest, m, n, mu, nu, qmax); return 0; @@ -809,7 +809,7 @@ int qpms_trans_calculator_multipliers_B(qpms_normalisation_t norm, complex doubl return 0; break; #endif - case QPMS_NORMALISATION_XU: + case QPMS_NORMALISATION_NONE: case QPMS_NORMALISATION_KRISTENSSON: qpms_trans_calculator_multipliers_B_general(norm, dest, m, n, mu, nu, Qmax); 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 case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_KRISTENSSON: - case QPMS_NORMALISATION_XU: + case QPMS_NORMALISATION_NONE: { double costheta = cos(kdlj.theta); 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) { case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_KRISTENSSON: - case QPMS_NORMALISATION_XU: + case QPMS_NORMALISATION_NONE: { double costheta = cos(kdlj.theta); 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)) { case QPMS_NORMALISATION_TAYLOR: case QPMS_NORMALISATION_KRISTENSSON: - case QPMS_NORMALISATION_XU: + case QPMS_NORMALISATION_NONE: { double costheta = cos(kdlj.theta); if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,n+nu+1,