Prime Iterator.
More...
#include <random-prime.h>
|
|
typedef UniqueSamplingTrait< Trait > | UniqueSamplingTag |
| | whether a prime can be picked more than once
|
| |
|
| | PrimeIterator (uint64_t bits=23, uint64_t seed=0) |
| | Constructor.
|
| |
|
PrimeIterator< Trait > & | operator++ () |
| | operator++() (prefix ++ operator) creates a new random prime.
|
| |
| const Prime_Type & | operator* () const |
| | get the random prime.
|
| |
| void | setBits (uint64_t bits) |
| | Sets the bit size.
|
| |
|
| static void | setSeed (uint64_t ul) |
| | Sets the seed.
|
| |
|
|
uint64_t | _bits |
| | common lenght of all primes
|
| |
|
integer | _prime |
| | the generated prime.
|
| |
|
Givaro::IntPrimeDom | _IPD |
| | empty struct dealing with primality.
|
| |
template<class Trait = IteratorCategories::HeuristicTag>
class LinBox::PrimeIterator< Trait >
Prime Iterator.
Generates prime of specified length using a heuristically random distribution (no guarantee whatsoever).
- Examples
- examples/dixonsolve.C.
◆ PrimeIterator()
template<class Trait = IteratorCategories::HeuristicTag>
Constructor.
- Parameters
-
| bits | size of primes (in bits). Default is 23 so it can fit in a Linbox::Modular<double>. |
| seed | if 0 a seed will be generated, otherwise, the provided seed will be use. |
◆ operator*()
template<class Trait = IteratorCategories::HeuristicTag>
| const Prime_Type & operator* |
( |
| ) |
const |
|
inline |
get the random prime.
returns the actual prime.
- Warning
- a new prime is not generated.
◆ setSeed()
template<class Trait = IteratorCategories::HeuristicTag>
| static void setSeed |
( |
uint64_t | ul | ) |
|
|
inlinestatic |
Sets the seed.
Set the random seed to be ul.
- Parameters
-
◆ setBits()
template<class Trait = IteratorCategories::HeuristicTag>
| void setBits |
( |
uint64_t | bits | ) |
|
|
inline |
Sets the bit size.
- Parameters
-
The documentation for this class was generated from the following file: