linbox
Public Member Functions | Static Public Member Functions
RandomIntegerIterator< _Unsigned > Class Template Reference

Random Prime Generator. More...

#include <random-integer.h>

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

template<bool _Unsigned = true>
class LinBox::RandomIntegerIterator< _Unsigned >

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)
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: