arma_hot inline void butterfly_N(cx_type* Y, const uword stride, const uword m, const uword r) { arma_extra_debug_sigprint(); const cx_type* coeffs = coeffs_ptr(); tmp_array.set_min_size(r); cx_type* tmp = tmp_array.memptr(); for(uword u=0; u < m; ++u) { uword k = u; for(uword v=0; v < r; ++v) { tmp[v] = Y[k]; k += m; } k = u; for(uword v=0; v < r; ++v) { Y[k] = tmp[0]; uword j = 0; for(uword w=1; w < r; ++w) { j += stride * k; if(j >= N) { j -= N; } Y[k] += tmp[w] * coeffs[j]; } k += m; } } }
inline podarray<eT>::podarray(const podarray& x) : n_elem(x.n_elem) { arma_extra_debug_sigprint(); const uword x_n_elem = x.n_elem; init_cold(x_n_elem); arrayops::copy( memptr(), x.memptr(), x_n_elem ); }
inline fft_engine(const uword in_N) : store< cx_type, fixed_N, (fixed_N > 0) >(in_N) { arma_extra_debug_sigprint(); const uword len = calc_radix<false>(); residue.set_size(len); radix.set_size(len); calc_radix<true>(); // calculate the constant coefficients cx_type* coeffs = coeffs_ptr(); const T k = T( (inverse) ? +2 : -2 ) * std::acos( T(-1) ) / T(N); for(uword i=0; i < N; ++i) { coeffs[i] = std::exp( cx_type(T(0), i*k) ); } }
inline const podarray<eT>& podarray<eT>::operator=(const podarray& x) { arma_extra_debug_sigprint(); if(this != &x) { const uword x_n_elem = x.n_elem; init_warm(x_n_elem); arrayops::copy( memptr(), x.memptr(), x_n_elem ); } return *this; }
arma_inline cx_type* coeffs_ptr() { return coeffs_array.memptr(); }
inline store(uword in_N) : N(in_N) { coeffs_array.set_size(N); }