From 83253bfc0cb497195c0c2126c3420e0287954233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 2 Sep 2018 06:19:50 +0300 Subject: [PATCH] Dudom Former-commit-id: ce1f24b4b792b797985113d2c76f2191847c91ac --- qpms/qpms_types.h | 3 ++- qpms/translations.c | 4 ++-- qpms/translations.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qpms/qpms_types.h b/qpms/qpms_types.h index ce47c94..f45a83a 100644 --- a/qpms/qpms_types.h +++ b/qpms/qpms_types.h @@ -19,7 +19,8 @@ typedef size_t qpms_y_t; typedef enum { QPMS_SUCCESS = 0, - QPMS_ERROR = 1 + QPMS_ERROR = 1, + QPMS_ENOMEM = 8 } qpms_errno_t; // Normalisations diff --git a/qpms/translations.c b/qpms/translations.c index a1ebf70..423c200 100644 --- a/qpms/translations.c +++ b/qpms/translations.c @@ -495,8 +495,8 @@ void qpms_trans_calculator_free(qpms_trans_calculator *c) { free(c->B_multipliers); #ifdef LATTICESUMS_OLD free(c->hct); - free(c->legendre0); #endif + free(c->legendre0); free(c); } @@ -907,10 +907,10 @@ qpms_trans_calculator free(qmaxes); #ifdef LATTICESUMS_OLD c->hct = hankelcoefftable_init(2*lMax+1); +#endif c->legendre0 = malloc(gsl_sf_legendre_array_n(2*lMax+1) * sizeof(double)); if (gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE,2*lMax+1, 0,-1,c->legendre0)) abort(); // TODO maybe use some "precise" analytical formula instead? -#endif return c; } diff --git a/qpms/translations.h b/qpms/translations.h index 4dd4709..672d530 100644 --- a/qpms/translations.h +++ b/qpms/translations.h @@ -47,8 +47,8 @@ typedef struct qpms_trans_calculator { #endif #ifdef LATTICESUMS_OLD complex double *hct; // Hankel function coefficient table - double *legendre0; // Zero-argument Legendre functions – this might go outside #ifdef in the end... #endif + double *legendre0; // Zero-argument Legendre functions – this might go outside #ifdef in the end... } qpms_trans_calculator;