MCPcopy Create free account
hub / github.com/numpy/numpy / make_rfft_plan

Function make_rfft_plan

numpy/fft/_pocketfft.c:2141–2168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2139 } rfft_plan_i;
2140
2141static rfft_plan make_rfft_plan (size_t length)
2142 {
2143 if (length==0) return NULL;
2144 rfft_plan plan = RALLOC(rfft_plan_i,1);
2145 if (!plan) return NULL;
2146 plan->blueplan=0;
2147 plan->packplan=0;
2148 if ((length<50) || (largest_prime_factor(length)<=sqrt(length)))
2149 {
2150 plan->packplan=make_rfftp_plan(length);
2151 if (!plan->packplan) { DEALLOC(plan); return NULL; }
2152 return plan;
2153 }
2154 double comp1 = 0.5*cost_guess(length);
2155 double comp2 = 2*cost_guess(good_size(2*length-1));
2156 comp2*=1.5; /* fudge factor that appears to give good overall performance */
2157 if (comp2<comp1) // use Bluestein
2158 {
2159 plan->blueplan=make_fftblue_plan(length);
2160 if (!plan->blueplan) { DEALLOC(plan); return NULL; }
2161 }
2162 else
2163 {
2164 plan->packplan=make_rfftp_plan(length);
2165 if (!plan->packplan) { DEALLOC(plan); return NULL; }
2166 }
2167 return plan;
2168 }
2169
2170static void destroy_rfft_plan (rfft_plan plan)
2171 {

Callers 2

execute_real_forwardFunction · 0.85
execute_real_backwardFunction · 0.85

Calls 6

largest_prime_factorFunction · 0.85
make_rfftp_planFunction · 0.85
cost_guessFunction · 0.85
good_sizeFunction · 0.85
make_fftblue_planFunction · 0.85
sqrtFunction · 0.50

Tested by

no test coverage detected