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

Function good_size

numpy/fft/_pocketfft.c:260–272  ·  view source on GitHub ↗

returns the smallest composite of 2, 3, 5, 7 and 11 which is >= n */

Source from the content-addressed store, hash-verified

258
259/* returns the smallest composite of 2, 3, 5, 7 and 11 which is >= n */
260NOINLINE static size_t good_size(size_t n)
261 {
262 if (n<=6) return n;
263
264 size_t bestfac=2*n;
265 for (size_t f2=1; f2<bestfac; f2*=2)
266 for (size_t f23=f2; f23<bestfac; f23*=3)
267 for (size_t f235=f23; f235<bestfac; f235*=5)
268 for (size_t f2357=f235; f2357<bestfac; f2357*=7)
269 for (size_t f235711=f2357; f235711<bestfac; f235711*=11)
270 if (f235711>=n) bestfac=f235711;
271 return bestfac;
272 }
273
274typedef struct cmplx {
275 double r,i;

Callers 3

make_fftblue_planFunction · 0.85
make_cfft_planFunction · 0.85
make_rfft_planFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected