class RandomA

A randomgenerator

Public Methods

virtual operator DataType ()
Getting a random number
virtual DataType operator) ( DataType iRange )
Getting a random number in a range
virtual void SetSeed ( DataType const & iSeed )
Providing a seed

Protected Methods

virtual void DoSeed ( DataType const & iSeed )
Initializing the random-generator

Documentation

This interface for a random-generator is included because of the fixed datatype used in the library. It has the basic functions of a random-generator, such as setting the seed and getting numbers within a range.

virtual void SetSeed( DataType const & iSeed )
This function sets the seeds and then reseeds the generator.

Returns:
Nothing.
Parameters:
iSeed - The seed for the random-generator.
Author:
J.I. van Hemert
Version:
0.1

virtual operator DataType ()
Example:
void ShowRandomNumber(RandomA const & random)
{
unsigned int r = random;
cout << r << endl;
}
This function gets a random number. The range of this number depends on the datatype defined in the library.

Returns:
A random number.
Author:
J.I. van Hemert
Version:
0.1

virtual DataType operator) ( DataType iRange )
Example:
void ShowRandomNumberUnderTen(RandomA const & random)
{
unsigned int r = random(10);
cout << r << endl;
}
This function gets a random number within the range zero to the number provided.

Returns:
Random number.
Parameters:
iRange - Size of range where the random number should be from, range will be $0\ldots(\texttt{iRange}-1)$.
Author:
J.I. van Hemert
Version:
0.1

virtual void DoSeed( DataType const & iSeed )
Provided with a seed, this function should initialize the random-generator.

Returns:
Nothing.
Parameters:
iSeed - Seed used for initializing the random-generator.
Author:
J.I. van Hemert
Version:
0.1


This class has no child classes.
Author:
J.I. van Hemert
Version:
0.1

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de