File: getprime_r.h

package info (click to toggle)
gmp-ecm 7.0.4%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 4,728 kB
  • sloc: asm: 36,431; ansic: 34,057; xml: 885; python: 799; sh: 698; makefile: 348
file content (30 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef GETPRIME_R_H_
#define GETPRIME_R_H_

#include "ecm_int.h"

struct prime_info_s {
  ecm_uint offset;  /* offset for current primes */
  ecm_int current;          /* index of previous prime */
  ecm_uint *primes;  /* small primes up to sqrt(p) */
  ecm_uint nprimes; /* length of primes[] */
  unsigned char *sieve;  /* sieving table */
  ecm_int len;              /* length of sieving table */
  ecm_uint *moduli;  /* offset for small primes */
};
typedef struct prime_info_s prime_info_t[1];

#ifdef __cplusplus
extern "C" {
#endif

/* The getprime_mt function returns successive odd primes, starting with 3. */
void prime_info_init (prime_info_t);
void prime_info_clear (prime_info_t);
ecm_uint getprime_mt (prime_info_t);

#ifdef __cplusplus
}
#endif

#endif	/* GETPRIME_R_H_ */