GaRandomDouble
class generates random double precision floating-point numbers. Class takes care about endianness of the architecture. Targeted architecture must support IEEE 754 standard. The class implements GaRandom interface. This class has no built-in synchronizator, so LOCK_OBJECT
and LOCK_THIS_OBJECT
macros cannot be used with instances of this class, but all public methods are thread-safe.
More...
#include <D:/Temp/vs/gal/source/Random.h>
Inherits Common::GaRandom< double >.
Public Member Functions | |
GaRandomDouble () | |
This constructor initializes random generator with current time as seed. | |
GaRandomDouble (unsigned long seed) | |
This constructor initialize random generator with user-defined seed. | |
virtual double GACALL | Generate () |
This method generates random values in interval(0, 1). | |
virtual double GACALL | Generate (const double &max) |
This method generates random values in interval(0, max ). | |
virtual double GACALL | Generate (const double &min, const double &max) |
This method generates random values in interval(min , max ). | |
Private Attributes | |
GaRandomGenerator | _generator |
Instance of algorithm for generating random numbers. |
GaRandomDouble
class generates random double precision floating-point numbers. Class takes care about endianness of the architecture. Targeted architecture must support IEEE 754 standard. The class implements GaRandom interface. This class has no built-in synchronizator, so LOCK_OBJECT
and LOCK_THIS_OBJECT
macros cannot be used with instances of this class, but all public methods are thread-safe.
Common::GaRandomDouble::GaRandomDouble | ( | ) | [inline] |
This constructor initializes random generator with current time as seed.
Common::GaRandomDouble::GaRandomDouble | ( | unsigned long | seed | ) | [inline] |
This constructor initialize random generator with user-defined seed.
seed | user-defined seed. |
virtual double GACALL Common::GaRandomDouble::Generate | ( | ) | [inline, virtual] |
This method generates random values in interval(0, 1).
This method is thread-safe.
Implements Common::GaRandom< double >.
virtual double GACALL Common::GaRandomDouble::Generate | ( | const double & | max | ) | [inline, virtual] |
This method generates random values in interval(0, max
).
This method is thread-safe.
max | maximal value which can be generated. |
Implements Common::GaRandom< double >.
virtual double GACALL Common::GaRandomDouble::Generate | ( | const double & | min, | |
const double & | max | |||
) | [inline, virtual] |
This method generates random values in interval(min
, max
).
This method is thread-safe.
min | minimal value which can be generated. | |
max | maximal value which can be generated. |
Implements Common::GaRandom< double >.
Instance of algorithm for generating random numbers.