DSPF_sp_erand
[Math]

Collaboration diagram for DSPF_sp_erand:


Detailed Description

void DSPF_sp_erand (int size, void *vector, void *state)


Function Documentation

void DSPF_sp_erand ( int  size,
void *  vector,
void *  state 
)

This function is used to fill an array with exponentially distributed random numbers.These numbers are distributed assuming a rate parameter (lambda) = 1;

The output vector can be modified for an arbitrary lambda by dividing its contents by the desired value of lambda (or, preferably for speed, multiplying its contents by the precomputed value of 1/lambda) as shown in the histogram below.

Parameters:
size = The size of the array to be filled.
vector = The array which the user wants to fill with random values. Again, it should be of type float.
state = The array which was initialized with the "DSP_urand32_init" function and maintained (but NEVER modified) by the user between subsequent calls to this function.
Algorithm:
The RNG utilizes the Tiny Mersene Twister (TinyMT) as its underlying RNG and an optimized version of George Marsaglia's Ziggurat algorithm as a wrapper RNG to generate an exponential distribution from the uniformly distributed TinyMT.
Assumptions:
The user has previously called the "DSP_urand32_init" function at least once, has maintained the state array, and allocated an array of float types of the desired width.
Implementation notes:
Endian Support: The code supports both big and little endian modes.
Interruptibility: The code is not interruptible.
DSPF_sp_erand_histogram.png


Copyright 2014, Texas Instruments Incorporated