algebramix_doc 0.3
fft_triadic_threads_transformer< C, FFTER, thr > Class Template Reference

#include <fft_triadic_threads.hpp>

List of all members.

Classes

Public Types

Public Member Functions

Static Public Member Functions

Public Attributes

Static Public Attributes


Detailed Description

template<typename C, typename FFTER = fft_triadic_naive_transformer<C>, nat thr = 9>
class mmx::fft_triadic_threads_transformer< C, FFTER, thr >

Examples:

fft_triadic_test.cpp.

Definition at line 26 of file fft_triadic_threads.hpp.


Member Typedef Documentation

typedef implementation<vector_linear,vector_naive> NVec

Definition at line 28 of file fft_triadic_threads.hpp.

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

Definition at line 30 of file fft_triadic_threads.hpp.

typedef R::U U

Definition at line 31 of file fft_triadic_threads.hpp.

typedef FFTER::V V

Definition at line 29 of file fft_triadic_threads.hpp.


Constructor & Destructor Documentation

fft_triadic_threads_transformer ( nat  n) [inline]

Definition at line 41 of file fft_triadic_threads.hpp.

                                                :
    ffter (new FFTER (n)),
    depth (ffter->depth), len (ffter->len),
    roots (ffter->roots), stoor (ffter->stoor) {}

Member Function Documentation

static void copy ( CC *  d,
nat  drs,
nat  dcs,
CC *  s,
nat  srs,
nat  scs,
nat  r,
nat  c 
) [inline, static]

Definition at line 48 of file fft_triadic_threads.hpp.

Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::outer_fft_triadic_task_rep< CC >::execute().

                                                                        {
    for (nat j=0; j<c; j++, d+=dcs, s+=scs) {
      CC* dd= d; CC* ss= s;
      for (nat i=0; i<r; i++, dd+=drs, ss+=srs)
        *dd= *ss;
    }
  }
void dfft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps,
nat  step1,
nat  step2 
) [inline]

Definition at line 186 of file fft_triadic_threads.hpp.

References fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ffter.

                                      {
    if (step1 == 0 && step2 == steps && steps > thr)
      fft_triadic (true, c, stride, shift, steps);
    else ffter->dfft_triadic (c, stride, shift, steps, step1, step2);
  }
void dfft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps 
) [inline]
void direct_transform_triadic ( C c) [inline]
void fft_triadic ( bool  direct,
CC *  c,
nat  stride,
nat  shift,
nat  steps 
) [inline]

Definition at line 122 of file fft_triadic_threads.hpp.

References fft_triadic_threads_transformer< C, FFTER, thr >::ffter, and fft_triadic_threads_transformer< C, FFTER, thr >::min_reps.

Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::dfft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ifft_triadic().

                                                                     {
    nat nt= threads_number;
    nat half1= steps >> 1;
    nat half2= steps - half1;
    nat len1= binpow ((nat) 3, half1);
    nat len2= binpow ((nat) 3, half2);
    if (steps <= thr || len2 <= min_reps || nt == 1) {
      if (direct) ffter->dfft_triadic (c, stride, shift, steps);
      else ffter->ifft_triadic (c, stride, shift, steps);
    }
    else {
      for (nat stage=0; stage<2; stage++) {
        if ((stage == 0) ^ (!direct)) {
          // Below is multi-threaded the following loop:
          // C*  cc1  = c;
          // for (nat i=0; i< len2; i++, cc1 += stride)
          //   if (direct)
          //     ffter->dfft_triadic (cc1, stride * len2, shift, half1);
          //   else
          //     ffter->ifft_triadic (cc1, stride * len2, shift, half1);
          nat bsz= min_reps * len1; // Recall min_reps < len2
          CC* buf= mmx_new<CC> (nt * bsz);
          task tasks[nt];
          for (nat i=0; i<nt; i++) {
            nat sta= min_reps * ((  i   * len2) / (min_reps * nt));
            nat end= min_reps * (((i+1) * len2) / (min_reps * nt));
            tasks[i]= new outer_fft_triadic_task_rep<CC>
              (ffter, direct, buf + i*bsz, end-sta, len2,
               c + sta*stride, stride, shift / len2, half1);
          }
          threads_execute (tasks, nt);
          mmx_delete<CC> (buf, nt * bsz);
        }
        else {
          // Below is multi-threaded the following loop:
          // CC* cc2= c;
          // for (nat i=0; i<len1; i++, cc2 += stride*len2)
          //   if (direct)
          //     ffter->dfft_triadic (cc2, stride, shift + i*len2, half2);
          //   else
          //     ffter->ifft_triadic (cc2, stride, shift + i*len2, half2);
          task tasks[nt];
          for (nat i=0; i<nt; i++)
            tasks[i]= new inner_fft_triadic_task_rep<CC>
              (ffter, direct, i, nt, len1, c, stride, shift, half2);
          threads_execute (tasks, nt);
        }
      }
    }
  }
void ifft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps 
) [inline]
void ifft_triadic ( CC *  c,
nat  stride,
nat  shift,
nat  steps,
nat  step1,
nat  step2 
) [inline]

Definition at line 194 of file fft_triadic_threads.hpp.

References fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::ffter.

                                      {
    if (step1 == 0 && step2 == steps && steps > thr)
      fft_triadic (false, c, stride, shift, steps);
    else ffter->ifft_triadic (c, stride, shift, steps, step1, step2);
  }

Member Data Documentation

U* roots

Definition at line 37 of file fft_triadic_threads.hpp.

U* stoor

Definition at line 38 of file fft_triadic_threads.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines