| 1044 | } |
| 1045 | |
| 1046 | static cfftp_plan make_cfftp_plan (size_t length) |
| 1047 | { |
| 1048 | if (length==0) return NULL; |
| 1049 | cfftp_plan plan = RALLOC(cfftp_plan_i,1); |
| 1050 | if (!plan) return NULL; |
| 1051 | plan->length=length; |
| 1052 | plan->nfct=0; |
| 1053 | for (size_t i=0; i<NFCT; ++i) |
| 1054 | plan->fct[i]=(cfftp_fctdata){0,0,0}; |
| 1055 | plan->mem=0; |
| 1056 | if (length==1) return plan; |
| 1057 | if (cfftp_factorize(plan)!=0) { DEALLOC(plan); return NULL; } |
| 1058 | size_t tws=cfftp_twsize(plan); |
| 1059 | if (tws != 0) { |
| 1060 | plan->mem=RALLOC(cmplx,tws); |
| 1061 | if (!plan->mem) { DEALLOC(plan); return NULL; } |
| 1062 | } |
| 1063 | if (cfftp_comp_twiddle(plan)!=0) |
| 1064 | { DEALLOC(plan->mem); DEALLOC(plan); return NULL; } |
| 1065 | return plan; |
| 1066 | } |
| 1067 | |
| 1068 | static void destroy_cfftp_plan (cfftp_plan plan) |
| 1069 | { |
no test coverage detected