Panda3D
direct
src
dcparser
primeNumberGenerator.h
Go to the documentation of this file.
1
/**
2
* PANDA 3D SOFTWARE
3
* Copyright (c) Carnegie Mellon University. All rights reserved.
4
*
5
* All use of this software is subject to the terms of the revised BSD
6
* license. You should have received a copy of this license along
7
* with this source code in a file named "LICENSE."
8
*
9
* @file primeNumberGenerator.h
10
* @author drose
11
* @date 2001-03-22
12
*/
13
14
#ifndef PRIMENUMBERGENERATOR_H
15
#define PRIMENUMBERGENERATOR_H
16
17
#include "
dcbase.h
"
18
19
#ifdef WITHIN_PANDA
20
// We only have the vector_int header file if we're compiling this package
21
// within the normal Panda environment.
22
#include "
vector_int.h
"
23
24
#else
25
typedef
std::vector<int> vector_int;
26
#endif
27
28
/**
29
* This class generates a table of prime numbers, up to the limit of an int.
30
* For a given integer n, it will return the nth prime number. This will
31
* involve a recompute step only if n is greater than any previous n.
32
*/
33
class
EXPCL_DIRECT_DCPARSER
PrimeNumberGenerator
{
34
public
:
35
PrimeNumberGenerator
();
36
37
int
operator [] (
int
n);
38
39
private
:
40
typedef
vector_int Primes;
41
Primes _primes;
42
};
43
44
#endif
vector_int.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PrimeNumberGenerator
This class generates a table of prime numbers, up to the limit of an int.
Definition:
primeNumberGenerator.h:33
dcbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Generated on Sun Dec 27 2020 13:22:44 for Panda3D by
1.8.20