|
linbox
|
Random Prime Generator. More...
#include <random-prime.h>
Public Member Functions | |
| RandomPrimeIterator (unsigned int bits=30, unsigned long seed=0) | |
| Constructor. | |
| RandomPrimeIterator & | operator++ () |
| operator++() creates a new random prime. | |
| const Prime_Type & | operator* () const |
| get the random prime. | |
| const Prime_Type & | randomPrime () const |
| get the random prime. | |
Static Public Member Functions | |
| static void | setSeed (unsigned long ul) |
| Sets the seed. | |
Random Prime Generator.
Generates prime of specified length.
| RandomPrimeIterator | ( | unsigned int | bits = 30, |
| unsigned long | seed = 0 |
||
| ) | [inline] |
Constructor.
| bits | size of primes (in bits). Default is 30 so it can fit in a Linbox::Modular<double>. |
| seed | if 0 a seed will be generated, otherwise, the provided seed will be use. |
| const Prime_Type& operator* | ( | ) | const [inline] |
get the random prime.
returns the actual prime.
| const Prime_Type& randomPrime | ( | ) | const [inline] |
get the random prime.
returns the actual prime.
| static void setSeed | ( | unsigned long | ul | ) | [inline, static] |
Sets the seed.
Set the random seed to be ul.
| ul | the new seed. |
1.7.4