Adelsbach/VSIPL
Core Programming Reference Guide
DD-00016-015
Core

3.1.4 vsip_dvrandn_p - Fill Vector with Normally Distributed Random Numbers

void vsip_vrandn_f(vsip_randstate *state, const vsip_vview_f *r); 
void vsip_cvrandn_f(vsip_randstate *state, const vsip_cvview_f *r);
Description

This function fills a vector with random numbers drawn from a standard normal distribution (mean = 0, standard deviation = 1) using the specified random number generator state. The random numbers are generated according to the normal (Gaussian) probability density function:

       1  -x2
f(x)=⎷2-πe  2
Parameters
Example

vsip_randstate *rand_state; 
vsip_vview_f *random_vector; 
 
// Initialize random number generator state 
rand_state = vsip_randcreate(42, 0, 1, VSIP_PRNG); 
 
// Assuming random_vector has been properly initialized 
vsip_vrandn_f(rand_state, random_vector); 
 
// Clean up 
vsip_randdestroy(rand_state);