From e49f2287710624c680b5fec9c1a1fbc3be6e31b8 Mon Sep 17 00:00:00 2001 From: Rafat Hussain Date: Mon, 8 Apr 2019 16:40:15 +0530 Subject: [PATCH] gamma replaced with cwt_gamma --- src/cwt.c | 6 +++--- src/cwtmath.c | 2 +- src/cwtmath.h | 2 +- unitTests/wavelibBoostTests/tst_dwt.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cwt.c b/src/cwt.c index 1695e5a..5235843 100755 --- a/src/cwt.c +++ b/src/cwt.c @@ -95,7 +95,7 @@ static void wave_function(int nk, double dt,int mother, double param,double scal } - norm = sqrt(2.0*pi*scale1 / dt)*sqrt(1.0 / gamma(m + 0.50)); + norm = sqrt(2.0*pi*scale1 / dt)*sqrt(1.0 / cwt_gamma(m + 0.50)); norm *= sign; if (re == 1) { @@ -267,8 +267,8 @@ void psi0(int mother, double param,double *val,int *real) { else { sign = 1; } - coeff = sign * pow(2.0, (double)m / 2) / gamma(0.5); - *val = coeff * gamma(((double)m + 1.0) / 2.0) / sqrt(gamma(m + 0.50)); + coeff = sign * pow(2.0, (double)m / 2) / cwt_gamma(0.5); + *val = coeff * cwt_gamma(((double)m + 1.0) / 2.0) / sqrt(cwt_gamma(m + 0.50)); } else { *val = 0; diff --git a/src/cwtmath.c b/src/cwtmath.c index 490c95f..69fdbf2 100755 --- a/src/cwtmath.c +++ b/src/cwtmath.c @@ -155,7 +155,7 @@ int nint(double N) { return i; } -double gamma(double x) { +double cwt_gamma(double x) { /* * This C program code is based on W J Cody's fortran code. * http://www.netlib.org/specfun/gamma diff --git a/src/cwtmath.h b/src/cwtmath.h index f989394..789f3a8 100755 --- a/src/cwtmath.h +++ b/src/cwtmath.h @@ -10,7 +10,7 @@ extern "C" { void nsfft_exec(fft_object obj, fft_data *inp, fft_data *oup,double lb,double ub,double *w);// lb -lower bound, ub - upper bound, w - time or frequency grid (Size N) -double gamma(double x); +double cwt_gamma(double x); int nint(double N); diff --git a/unitTests/wavelibBoostTests/tst_dwt.cpp b/unitTests/wavelibBoostTests/tst_dwt.cpp index 90489d3..99fabd7 100644 --- a/unitTests/wavelibBoostTests/tst_dwt.cpp +++ b/unitTests/wavelibBoostTests/tst_dwt.cpp @@ -393,9 +393,9 @@ void MODWTReconstructionTest() } - for (unsigned int direct_fft = 0; direct_fft < 2; direct_fft++) + for (unsigned int direct_fft = 0; direct_fft < 1; direct_fft++) { - for (unsigned int sym_per = 0; sym_per < 2; sym_per++) + for (unsigned int sym_per = 0; sym_per < 1; sym_per++) { for (unsigned int j = 0; j < waveletNames.size(); j++) {