|
algebramix_doc 0.3
|
#include <fft_triadic_threads.hpp>
Definition at line 26 of file fft_triadic_threads.hpp.
| typedef implementation<vector_linear,vector_naive> NVec |
Definition at line 28 of file fft_triadic_threads.hpp.
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.
| fft_triadic_threads_transformer | ( | nat | n | ) | [inline] |
| ~fft_triadic_threads_transformer | ( | ) | [inline] |
Definition at line 45 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::ffter.
{ delete ffter; }
| 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] |
Definition at line 174 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.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::direct_transform_triadic().
{
if (steps <= thr) ffter->dfft_triadic (c, stride, shift, steps);
else fft_triadic (true, c, stride, shift, steps);
}
| void direct_transform_triadic | ( | C * | c | ) | [inline] |
Definition at line 202 of file fft_triadic_threads.hpp.
References fft_triadic_threads_transformer< C, FFTER, thr >::depth, and fft_triadic_threads_transformer< C, FFTER, thr >::dfft_triadic().
{
dfft_triadic (c, 1, 0, depth);
}
| 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] |
Definition at line 180 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.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::inverse_transform_triadic().
{
if (steps <= thr) ffter->ifft_triadic (c, stride, shift, steps);
else fft_triadic (false, c, stride, shift, steps);
}
| 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);
}
| void inverse_transform_triadic | ( | C * | c, |
| bool | shift = true |
||
| ) | [inline] |
| nat depth |
Definition at line 35 of file fft_triadic_threads.hpp.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::direct_transform_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::inverse_transform_triadic().
| FFTER* ffter |
Definition at line 34 of file fft_triadic_threads.hpp.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::dfft_triadic(), fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic(), fft_triadic_threads_transformer< C, FFTER, thr >::ifft_triadic(), and fft_triadic_threads_transformer< C, FFTER, thr >::~fft_triadic_threads_transformer().
| nat len |
Definition at line 36 of file fft_triadic_threads.hpp.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::inverse_transform_triadic().
const nat min_reps = 27 [static] |
Definition at line 32 of file fft_triadic_threads.hpp.
Referenced by fft_triadic_threads_transformer< C, FFTER, thr >::outer_fft_triadic_task_rep< CC >::execute(), and fft_triadic_threads_transformer< C, FFTER, thr >::fft_triadic().
Definition at line 37 of file fft_triadic_threads.hpp.
Definition at line 38 of file fft_triadic_threads.hpp.