carl
24.04
Computer ARithmetic Library
|
This class provides a convenient way to enumerate primes. More...
#include <PrimeFactory.h>
Public Member Functions | |
std::size_t | size () const |
Returns the number of already computed primes. More... | |
const T & | operator[] (std::size_t id) const |
Provides const access to the computed primes. Asserts that id is smaller than size(). More... | |
const T & | operator[] (std::size_t id) |
Provides access to the computed primes. If id is at least size(), the missing primes are computed on-the-fly. More... | |
const T & | next_prime () |
Computed the next prime and returns it. More... | |
Private Attributes | |
std::size_t | mNext = 0 |
Static Private Attributes | |
static std::vector< T > | mPrimes |
This class provides a convenient way to enumerate primes.
Definition at line 13 of file PrimeFactory.h.
const T & carl::PrimeFactory< T >::next_prime |
Computed the next prime and returns it.
Definition at line 74 of file PrimeFactory.h.
|
inline |
Provides access to the computed primes. If id is at least size(), the missing primes are computed on-the-fly.
Definition at line 31 of file PrimeFactory.h.
|
inline |
Provides const access to the computed primes. Asserts that id is smaller than size().
Definition at line 26 of file PrimeFactory.h.
|
inline |
Returns the number of already computed primes.
Definition at line 22 of file PrimeFactory.h.
|
private |
Definition at line 19 of file PrimeFactory.h.
|
staticprivate |
Definition at line 15 of file PrimeFactory.h.