From fbbebc90f9590b0110c95747fcab5a25e9910627 Mon Sep 17 00:00:00 2001 From: Ivan Krylov Date: Fri, 14 Dec 2018 13:04:07 +0300 Subject: [PATCH] Partially revert "const-correct cwt.c:cwavelet" This reverts commit 0b5777fc4aa12d7c019cd01aa3f5885c47c0cae2. > In cwt.h and cwt.c , s0 and dj are needed for reconstruction. > Both of these variables may be needed if we are to add more wavelets. --- src/cwt.c | 6 ++++-- src/cwt.h | 2 +- src/wavelib.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cwt.c b/src/cwt.c index ac33fd8..1695e5a 100755 --- a/src/cwt.c +++ b/src/cwt.c @@ -118,7 +118,7 @@ static void wave_function(int nk, double dt,int mother, double param,double scal } } -void cwavelet(const double *y, int N, double dt, int mother, double param, int jtot, int npad, +void cwavelet(const double *y, int N, double dt, int mother, double param, double s0, double dj, int jtot, int npad, double *wave, double *scale, double *period, double *coi) { int i, j, k, iter; @@ -129,6 +129,8 @@ void cwavelet(const double *y, int N, double dt, int mother, double param, int j fft_object obj, iobj; fft_data *ypad, *yfft,*daughter; + (void)s0; (void)dj; /* yes, we need these parameters unused */ + pi = 4.0 * atan(1.0); if (npad < N) { @@ -342,7 +344,7 @@ double cdelta(int mother, double param, double psi0 ) { scale[i] = s0*pow(2.0, (double)(i)*dj); } - cwavelet(delta, N, dt, mother, param, jtot, N, wave, scale, period, coi); + cwavelet(delta, N, dt, mother, param, s0, dj, jtot, N, wave, scale, period, coi); for (i = 0; i < N; ++i) { mval[i] = 0; diff --git a/src/cwt.h b/src/cwt.h index e9a80dc..d1e4a03 100755 --- a/src/cwt.h +++ b/src/cwt.h @@ -7,7 +7,7 @@ extern "C" { #endif -void cwavelet(const double *y, int N, double dt, int mother, double param, int jtot, int npad, +void cwavelet(const double *y, int N, double dt, int mother, double param, double s0, double dj, int jtot, int npad, double *wave, double *scale, double *period, double *coi); void psi0(int mother, double param, double *val, int *real); diff --git a/src/wavelib.c b/src/wavelib.c index 9deb9ea..65a69c0 100644 --- a/src/wavelib.c +++ b/src/wavelib.c @@ -1413,7 +1413,7 @@ void cwt(cwt_object wt, const double *inp) { } wt->smean /= N; - cwavelet(inp, N, wt->dt, wt->mother, wt->m, wt->J,npad,wt->params, wt->params+nj2, wt->params+nj2+j, wt->params+nj2+j2); + cwavelet(inp, N, wt->dt, wt->mother, wt->m, wt->s0,wt->dj,wt->J,npad,wt->params, wt->params+nj2, wt->params+nj2+j, wt->params+nj2+j2); }