LRandSource

Description Random Number generator
Header file LRandSource.h
Author Stefano Emiliozzi, Camil Demetrescu
Created Nov 29, 2001
Last updated Sep 25, 2003

 

Contents


Introduction

The component LRandSource provides a pseudo-random number generator. This is an implementation of the Steve Park & Dave Geyer work, based on: Steve Park and Keith Miller, "Random Number Generators: Good Ones Are Hard To Find". Communications of the ACM, October 1988. This method proved to be more accurate than the standard ANSI C rand() function.


Interface

Constants

LRandSource_ID

Types

struct LRandSource

Functions

LRandSource* LRandSource_New        (i4 inSeed)
void         LRandSource_Delete     (LRandSource** ThisA)
ui4          LRandSource_GetRandUI4 (LRandSource* This, ui4 inMin, ui4 inMax)
f8           LRandSource_GetRandF8  (LRandSource* This)
i4           LRandSource_GetSeed    (LRandSource* This)


API Reference

Function Arguments Description Returns Throws
New i4 inSeed Creates a new LRandSource Caller is responsible of dellocating the created object using LRandSource_Delete.

LRandSource*

pointer to newly created object

-
Delete LRandSource** ThisA Releases object *ThisA. *ThisA is set to NULL. void -
GetRandUI4 ui4 inMin
ui4 inMax
Returns a random number in the range [inMin, inMax]. ui4 -
GetRandF8 LRandSource* This Returns a random number in the range [0, 1]. f8 -
Get_Seed LRandSource* This Returns the Seed of the generator. i4 -


Revision history