Lines Matching defs:primes
1 /* List and count primes.
26 * Do not fill primes[] with real primes when the range [fr,to] is small,
27 when fr,to are relatively large. Fill primes[] with odd numbers instead.
28 [Probably a bad idea, since the primes[] array would become very large.]
29 * Separate small primes and large primes when sieving. Either the Montgomery
31 separate loops for primes <= S and primes > S. The latter primes do not
34 then omit 3 from primes array. (May require similar special handling of 3
37 to the sieving array in make_primelist, but also because of the primes[]
39 to build primes[]. Make report() a function pointer, as part of achieving
41 * Store primes[] as two arrays, one array with primes represented as delta
42 values using just 8 bits (if gaps are too big, store bogus primes!)
45 * Improve command line syntax and versatility. "primes -f FROM -t TO",
47 "primes -c -f FROM" since that would be infinity.) Allow printing a
48 limited *number* of primes using syntax like "primes -f FROM -n NUMBER".
55 struct primes
61 struct primes *primes;
194 primes = malloc (est_n_primes * sizeof primes[0]);
201 n_primes, primes[n_primes - 1].prime);
237 /* Find primes in region [fr,fr+rsize). Requires that fr is odd and that
265 prime = primes[i].prime;
267 if (primes[i].rem >= 0)
269 start2 = primes[i].rem;
294 primes[i].rem = ii - ssize;
301 primes[i].rem = k;
308 /* Find primes in region [fr,fr+rsize), using the previously sieved s[]. */
339 /* Generate a list of primes and store in the global array primes[]. */
356 continue; /* only sieve with primes */
365 primes[n_primes].prime = j * 2 + 3;
366 primes[n_primes].rem = -1;
371 if (primes[n_primes - 1].prime > maxprime)
381 primes[n_primes].prime = i;
382 primes[n_primes].rem = -1;