|
CLASS moRandom
NAME
Constuctor - initialize a random object
VERSION
Version: 1.2.0
SYNOPSIS
moRandom(void);
DESCRIPTION
This function initialize a random object so it can be used
right away.
These random values are only pseudo random, not pure random
values.
SEE ALSO
Destructor
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moRandom
NAME
Destructor - clean up a random object
VERSION
Version: 1.2.0
SYNOPSIS
~moRandom();
DESCRIPTION
This function cleans up a random object.
SEE ALSO
Constructor
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moRandom
NAME
SetSeed - set seeds to user defined values
VERSION
Version: 1.2.0
SYNOPSIS
void SetSeed(const void *seed);
PARAMETERS
seed - a pointer to MO_RANDOM_SEED_N unsigned longs
DESCRIPTION
This function can be used to modify the seeds to a
set of values which are determined by the caller.
The pointer is expected to be of the proper size
(i.e. MO_RANDOM_SEED_N).
This function has the side effect of reseting the
seed index.
NOTES
The first MO_RANDOM_SEED_N values are equal to the
seed. Only the following values will be a mixed
set of the original seed value. In order to avoid
reading the same values as the seeds, it is advice
to use the Random() call with a count value of
one hunder or more.
SEE ALSO
GetSeed
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moRandom
NAME
GetSeed - copy current seeds in a user buffer
VERSION
Version: 1.2.0
SYNOPSIS
void GetSeed(void *seed) const;
PARAMETERS
seed - a pointer to MO_RANDOM_SEED_N unsigned longs
DESCRIPTION
This function copies the current seeds from the random
object to the user specified buffer. The user buffer
data are lost.
Note that the seed pointer is expected to be large
enough to support all the seeds (i.e. MO_RANDOM_SEED_N
unsigned longs).
SEE ALSO
SetSeed
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moRandom
NAME
Random - generates the next random value
VERSION
Version: 1.2.0
SYNOPSIS
unsigned long Random(unsigned int count = 0);
PARAMETERS
count - skip count values first
DESCRIPTION
This function computes the next value and returns it. Note
that the value of 'count' can be set to any number of values
to be skipped before to return the next long in order to
make the value even more random.
It is important to understand that it is better to use the
higher bits of the returned value rather than the lower ones.
These are more randomized than the lower bits. Thus, a function
which uses this Random() function to use 8 bits should use
only the top 8 bits by shifting the result by 24 as following:
my_byte = Random() >> 24;
NOTES
This function isn't a constant function because it modifies
the current state of the random seeds.
The use of the 'count' parameter is to be avoided if you want
the function to really return values which are uniformly
distributed.
SEE ALSO
SetSeed, GetSeed
COPYRIGHTS
This function is fully based on some work by M. Matsumoto
in 1994 & 1996. (email: matumoto@math.keio.ac.jp) It comes
from his source named tt800.c. Special thanks.
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
Links:
molib
the sandbox
|