linbox
Public Member Functions | Static Public Member Functions
RandomPrimeIterator Class Reference

Random Prime Generator. More...

#include <random-prime.h>

Public Member Functions

 RandomPrimeIterator (uint64_t bits=27, uint64_t seed=0)
 Constructor. More...
 
RandomPrimeIteratoroperator++ ()
 operator++() creates a new random prime.
 
const Prime_Type & operator* () const
 get the random prime. More...
 
const Prime_Type & randomPrime () const
 get the random prime. More...
 

Static Public Member Functions

static void setSeed (uint64_t ul)
 Sets the seed. More...
 

Detailed Description

Random Prime Generator.

Generates prime of specified length.

Examples:
examples/qchar.C.

Constructor & Destructor Documentation

RandomPrimeIterator ( uint64_t  bits = 27,
uint64_t  seed = 0 
)
inline

Constructor.

Parameters
bitssize of primes (in bits). Default is 27 so it can fit in a Linbox::Modular<double>.
seedif 0 a seed will be generated, otherwise, the provided seed will be use.

Member Function Documentation

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.

Warning
a new prime is not generated.
static void setSeed ( uint64_t  ul)
inlinestatic

Sets the seed.

Set the random seed to be ul.

Parameters
ulthe new seed.

The documentation for this class was generated from the following file: