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

Random Prime Generator. More...

#include <random-prime.h>

Public Member Functions

 RandomPrimeIterator (unsigned int bits=30, unsigned long 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 (unsigned long ul)
 Sets the seed. More...
 

Detailed Description

Random Prime Generator.

Generates prime of specified length.

Constructor & Destructor Documentation

RandomPrimeIterator ( unsigned int  bits = 30,
unsigned long  seed = 0 
)
inline

Constructor.

Parameters
bitssize of primes (in bits). Default is 30 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 ( unsigned long  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: