diff --git a/kissfft.hh b/kissfft.hh index 4f6ac92..3ad8554 100644 --- a/kissfft.hh +++ b/kissfft.hh @@ -49,7 +49,7 @@ struct traits std::vector _twiddles; - const cpx_type twiddle(int i) { return _twiddles[i]; } + const cpx_type twiddle(int i) const { return _twiddles[i]; } }; } @@ -70,13 +70,13 @@ class kissfft _traits.prepare(_twiddles, _nfft,_inverse ,_stageRadix, _stageRemainder); } - void transform(const cpx_type * src , cpx_type * dst) + void transform(const cpx_type * src , cpx_type * dst) const { kf_work(0, dst, src, 1,1); } private: - void kf_work( int stage,cpx_type * Fout, const cpx_type * f, size_t fstride,size_t in_stride) + void kf_work( int stage,cpx_type * Fout, const cpx_type * f, size_t fstride,size_t in_stride) const { int p = _stageRadix[stage]; int m = _stageRemainder[stage]; @@ -112,16 +112,16 @@ class kissfft } // these were #define macros in the original kiss_fft - void C_ADD( cpx_type & c,const cpx_type & a,const cpx_type & b) { c=a+b;} - void C_MUL( cpx_type & c,const cpx_type & a,const cpx_type & b) { c=a*b;} - void C_SUB( cpx_type & c,const cpx_type & a,const cpx_type & b) { c=a-b;} - void C_ADDTO( cpx_type & c,const cpx_type & a) { c+=a;} - void C_FIXDIV( cpx_type & ,int ) {} // NO-OP for float types - scalar_type S_MUL( const scalar_type & a,const scalar_type & b) { return a*b;} - scalar_type HALF_OF( const scalar_type & a) { return a*.5;} - void C_MULBYSCALAR(cpx_type & c,const scalar_type & a) {c*=a;} + static void C_ADD( cpx_type & c,const cpx_type & a,const cpx_type & b) { c=a+b;} + static void C_MUL( cpx_type & c,const cpx_type & a,const cpx_type & b) { c=a*b;} + static void C_SUB( cpx_type & c,const cpx_type & a,const cpx_type & b) { c=a-b;} + static void C_ADDTO( cpx_type & c,const cpx_type & a) { c+=a;} + static void C_FIXDIV( cpx_type & ,int ) {} // NO-OP for float types + static scalar_type S_MUL( const scalar_type & a,const scalar_type & b) { return a*b;} + static scalar_type HALF_OF( const scalar_type & a) { return a*.5;} + static void C_MULBYSCALAR(cpx_type & c,const scalar_type & a) {c*=a;} - void kf_bfly2( cpx_type * Fout, const size_t fstride, int m) + void kf_bfly2( cpx_type * Fout, const size_t fstride, int m) const { for (int k=0;k