20 PrimeNumberGenerator::
21 PrimeNumberGenerator() {
35 int candidate = _primes.back() + 1;
36 while ((
int)_primes.size() <= n) {
39 bool maybe_prime =
true;
41 while (maybe_prime && _primes[j] * _primes[j] <= candidate) {
42 if ((_primes[j] * (candidate / _primes[j])) == candidate) {
47 nassertr(j < (
int)_primes.size(), 0);
51 _primes.push_back(candidate);