fft_triadic_naive_transformer< C, VV > Class Template Reference

#include <fft_triadic_naive.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<typename C, typename VV = std_roots_triadic>
class mmx::fft_triadic_naive_transformer< C, VV >

Definition at line 82 of file fft_triadic_naive.hpp.


Member Typedef Documentation

typedef V::template helper<C>::roots_type R

Definition at line 85 of file fft_triadic_naive.hpp.

typedef R::S S

Definition at line 87 of file fft_triadic_naive.hpp.

typedef R::U U

Definition at line 86 of file fft_triadic_naive.hpp.

typedef VV V

Definition at line 84 of file fft_triadic_naive.hpp.


Constructor & Destructor Documentation

fft_triadic_naive_transformer ( nat  n,
const format< C > &  fm2 
) [inline]

Definition at line 96 of file fft_triadic_naive.hpp.

References binpow(), and fft_triadic_naive_transformer< C, VV >::depth.

00096                                                                     :
00097     fm (fm2),
00098     depth (log_3 (n)), len (n), roots (R::create_roots (n, fm)),
00099                                 stoor (R::create_stoor (n, fm)) {
00100     VERIFY (n == binpow ((nat) 3, depth), "power of three expected"); }
  inline ~fft_triadic_naive_transformer () {

~fft_triadic_naive_transformer (  )  [inline]

Definition at line 101 of file fft_triadic_naive.hpp.

References fft_triadic_naive_transformer< C, VV >::len, fft_triadic_naive_transformer< C, VV >::roots, and fft_triadic_naive_transformer< C, VV >::stoor.

00101                                            {
00102     R::destroy_roots (roots, len);
00103     R::destroy_roots (stoor, len); }


Member Function Documentation

void dfft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps 
) [inline]

Definition at line 156 of file fft_triadic_naive.hpp.

References fft_triadic_naive_transformer< C, VV >::dfft_triadic().

00156                                                          {
00157     dfft_triadic (c, stride, shift, steps, 0, steps);
00158   }

void dfft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps,
nat  step1,
nat  step2 
) [inline]

Definition at line 106 of file fft_triadic_naive.hpp.

References binpow(), and fft_triadic_naive_transformer< C, VV >::roots.

Referenced by fft_triadic_naive_transformer< C, VV >::dfft_triadic(), and fft_triadic_naive_transformer< C, VV >::direct_transform_triadic().

00107                                                  {
00108     // In place direct triadic fft of
00109     // c[0], c[stride], ..., c[(3^steps-1) stride]
00110     // Only performs steps from step1 until step2-1
00111     // Roots start at roots + shift
00112     typedef typename V::template helper<CC>::roots_type RR;
00113     for (nat step= step1; step < step2; step++) {
00114       //mmout << "step " << step << ": " << flush_now;
00115       nat todo= binpow (3, steps - 1 - step);
00116       CC* cc  = c;
00117       U * uu  = roots + (shift / todo);
00118       for (nat j= 0; j < (nat) binpow (3, step); j++) {
00119         for (nat k= 0; k < todo; k++) {
00120           RR::dfft_cross (cc, cc + stride * todo,
00121                           cc + ((stride * todo) << 1), uu, uu+1, uu+2);
00122           cc += stride;
00123         }
00124         cc += (stride * todo) << 1;
00125         uu += 3;
00126       }
00127     }
00128   }

void direct_transform_triadic ( C c  )  [inline]
void ifft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps 
) [inline]

Definition at line 161 of file fft_triadic_naive.hpp.

References fft_triadic_naive_transformer< C, VV >::ifft_triadic().

00161                                                          {
00162     ifft_triadic (c, stride, shift, steps, 0, steps);
00163   }

void ifft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps,
nat  step1,
nat  step2 
) [inline]

Definition at line 131 of file fft_triadic_naive.hpp.

References binpow(), and fft_triadic_naive_transformer< C, VV >::stoor.

Referenced by fft_triadic_naive_transformer< C, VV >::ifft_triadic(), and fft_triadic_naive_transformer< C, VV >::inverse_transform_triadic().

00132                                                  {
00133     // In place inverse triadic fft of
00134     // c[0], c[stride], ..., c[(3^steps-1) stride]
00135     // Only performs steps from step2-1 until step1
00136     // Roots start at roots + shift
00137     typedef typename V::template helper<CC>::roots_type RR;
00138     for (int step= step2-1; step >= ((int) step1); step--) {
00139       //mmout << "step " << step << ": " << flush_now;
00140       nat todo= binpow (3, steps - 1 - step);
00141       CC* cc  = c;
00142       U * uu  = stoor + (shift / todo);
00143       for (nat j= 0; j < (nat) binpow (3, step); j++) {
00144         for (nat k= 0; k < todo; k++) {
00145           RR::ifft_cross (cc, cc + stride * todo,
00146                           cc + ((stride * todo) << 1), uu, uu+1, uu+2);
00147           cc += stride;
00148         }
00149         cc += (stride * todo) << 1;
00150         uu += 3;
00151       }
00152     }
00153   }

void inverse_transform_triadic ( C c,
bool  shift = true 
) [inline]

Member Data Documentation

nat depth
format<C> fm

Definition at line 89 of file fft_triadic_naive.hpp.

nat len
U* roots
U* stoor

The documentation for this class was generated from the following file:

Generated on 6 Dec 2012 for algebramix by  doxygen 1.6.1