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

This manual is preliminary and incomplete.
While our Core implementation implements all functions given in the standard we are still working on completing this documentation.

Please refer to the VSIPL standard for a complete function reference of the Core profile until we have completed work on this documentation.

3.1.1 vsip_randcreate - Create a Random Number Generator State

vsip_randstate *vsip_randcreate(vsip_index seed, vsip_index numprocs, 
                                vsip_index id, vsip_rng portable);
Description

This function creates and initializes a random number generator state. The function allows for parallel random number generation by specifying the number of processes (numprocs) and the process ID (id). The portable parameter specifies the type of random number generator to use.

Parameters
Return Value
Example

vsip_randstate *rand_state; 
vsip_index seed = 42; 
vsip_index numprocs = 1; 
vsip_index id = 0; 
 
// Create a random number generator state 
rand_state = vsip_randcreate(seed, numprocs, id, VSIP_PRNG); 
 
if (rand_state == NULL) { 
    // Handle error 
}