From 1cf70144154578df06c6f9f226654efa747b3e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 13 May 2018 07:02:18 +0000 Subject: [PATCH] Making reserve in bessel buffers (TODO check the actual size needed later.) Former-commit-id: d062dbb2a6cda23678b4557ce510aa0426a2f73a --- qpms/translations.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qpms/translations.c b/qpms/translations.c index 7f0945f..4d741a5 100644 --- a/qpms/translations.c +++ b/qpms/translations.c @@ -1054,8 +1054,6 @@ int qpms_trans_calculator_get_AB_buf_p(const qpms_trans_calculator *c, } - - int qpms_trans_calculator_get_AB_arrays_buf(const qpms_trans_calculator *c, complex double *Adest, complex double *Bdest, size_t deststride, size_t srcstride, @@ -1071,8 +1069,10 @@ int qpms_trans_calculator_get_AB_arrays_buf(const qpms_trans_calculator *c, // TODO warn? different return value? return 0; } - switch(c->normalisation) { + switch(qpms_normalisation_t_normonly(c->normalisation)) { case QPMS_NORMALISATION_TAYLOR: + case QPMS_NORMALISATION_POWER: + case QPMS_NORMALISATION_NONE: { double costheta = cos(kdlj.theta); if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,2*c->lMax+1, @@ -1126,7 +1126,7 @@ int qpms_trans_calculator_get_AB_p(const qpms_trans_calculator *c, int m, int n, int mu, int nu, sph_t kdlj, bool r_ge_d, qpms_bessel_t J) { double leg[gsl_sf_legendre_array_n(2*c->lMax+1)]; - complex double bes[2*c->lMax+2]; + complex double bes[2*c->lMax+3]; // TODO check lMax return qpms_trans_calculator_get_AB_buf_p(c,Adest, Bdest,m,n,mu,nu,kdlj,r_ge_d,J, bes,leg); } @@ -1136,7 +1136,7 @@ int qpms_trans_calculator_get_AB_arrays(const qpms_trans_calculator *c, size_t deststride, size_t srcstride, sph_t kdlj, bool r_ge_d, qpms_bessel_t J) { double leg[gsl_sf_legendre_array_n(c->lMax+c->lMax+1)]; - complex double bes[c->lMax+c->lMax+2]; + complex double bes[2*c->lMax+3]; // TODO check lMax return qpms_trans_calculator_get_AB_arrays_buf(c, Adest, Bdest, deststride, srcstride, kdlj, r_ge_d, J,