Primes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sieve.h 336B

12345678910111213141516171819202122
  1. #ifndef SIEVE_H
  2. #define SIEVE_H
  3. #include <stdint.h>
  4. typedef struct sieve
  5. {
  6. unsigned char *bytes;
  7. int nbytes;
  8. int64_t maxNum;
  9. int64_t *primes;
  10. int nprimes;
  11. } sieve;
  12. void sieve_init(sieve *s, int64_t max);
  13. void sieve_free(sieve *s);
  14. void sieve_generate(sieve *s);
  15. void sieve_factor(sieve *s, int64_t num, int64_t *buf);
  16. #endif