Previous: Blum-Blum-Shub Generator, Up: Base Generators


6.1.8 User Supplied Generators

All of the distributional generators described in Distribution Generators require a base generator which returns a uniformly distributed value in the open interval (0,1) and ACML includes several such generators (as detailed in Base Generators). However, for greater flexibility, the ACML routines allow the user to register their own base generator function. This user-supplied generator then becomes the base generator for all of the distribution generators.

A user supplied generator comes in the form of two routines, one to initialize the generator and one to generate a set of uniformly distributed values in the open interval (0, 1). These two routines can be named anything, but are referred to as UINI for the initialization routine and UGEN for the generation routine in the following documentation.

In order to register a user supplied generator a call to DRANDINITIALIZEUSER must be made. Once registered the generator can be accessed and used in the same manner as the ACML supplied base generators. The specifications for DRANDINTIALIZEUSER, UINI and UGEN are given below. See the ACML example programs drandinitializeuser_example.f and drandinitializeuser_c_example.c (Examples) to understand how to use these routines in ACML.