| 1009 | } |
| 1010 | |
| 1011 | NOINLINE WARN_UNUSED_RESULT static int cfftp_comp_twiddle (cfftp_plan plan) |
| 1012 | { |
| 1013 | size_t length=plan->length; |
| 1014 | double *twid = RALLOC(double, 2*length); |
| 1015 | if (!twid) return -1; |
| 1016 | sincos_2pibyn(length, twid); |
| 1017 | size_t l1=1; |
| 1018 | size_t memofs=0; |
| 1019 | for (size_t k=0; k<plan->nfct; ++k) |
| 1020 | { |
| 1021 | size_t ip=plan->fct[k].fct, ido= length/(l1*ip); |
| 1022 | plan->fct[k].tw=plan->mem+memofs; |
| 1023 | memofs+=(ip-1)*(ido-1); |
| 1024 | for (size_t j=1; j<ip; ++j) |
| 1025 | for (size_t i=1; i<ido; ++i) |
| 1026 | { |
| 1027 | plan->fct[k].tw[(j-1)*(ido-1)+i-1].r = twid[2*j*l1*i]; |
| 1028 | plan->fct[k].tw[(j-1)*(ido-1)+i-1].i = twid[2*j*l1*i+1]; |
| 1029 | } |
| 1030 | if (ip>11) |
| 1031 | { |
| 1032 | plan->fct[k].tws=plan->mem+memofs; |
| 1033 | memofs+=ip; |
| 1034 | for (size_t j=0; j<ip; ++j) |
| 1035 | { |
| 1036 | plan->fct[k].tws[j].r = twid[2*j*l1*ido]; |
| 1037 | plan->fct[k].tws[j].i = twid[2*j*l1*ido+1]; |
| 1038 | } |
| 1039 | } |
| 1040 | l1*=ip; |
| 1041 | } |
| 1042 | DEALLOC(twid); |
| 1043 | return 0; |
| 1044 | } |
| 1045 | |
| 1046 | static cfftp_plan make_cfftp_plan (size_t length) |
| 1047 | { |
no test coverage detected