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

Random Prime Generator. More...

#include <random-integer.h>

Public Member Functions

 RandomIntegerIterator (unsigned int bits=30, unsigned long seed=0)
 Constructor.
RandomIntegerIteratoroperator++ ()
 operator++() creates a new random integer.
const Integer_Type & operator* () const
 get the random integer.
const Integer_Type & randomInteger () const
 get the random integer.

Static Public Member Functions

static void setSeed (unsigned long ul)
 Sets the seed.

Detailed Description

Random Prime Generator.

Generates integers of specified length.

Template Parameters:
_Unsignedif true, then only non negative integers are generated, if false, their sign is random.

Constructor & Destructor Documentation

RandomIntegerIterator ( unsigned int  bits = 30,
unsigned long  seed = 0 
) [inline]

Constructor.

Parameters:
bitssize of integers (in bits)
seedif 0 a seed will be generated, otherwise, the provided seed will be use.

Member Function Documentation

const Integer_Type& operator* ( ) const [inline]

get the random integer.

returns the actual integer.

const Integer_Type& randomInteger ( ) const [inline]

get the random integer.

returns the actual integer.

Warning:
a new integer is not generated.
static void setSeed ( unsigned long  ul) [inline, static]

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: