S3L_setup_rand_fib initializes the Lagged-Fibonacci random number generator's (LFG's) state table with the fixed parameters: l = 17, k = 5, m = 32.
The state table is initialized in a manner that ensures that the random numbers generated for each node are from a different period of the LFG. A Linear Multiplicative Generator (LMG) is used to initialize the noncritical elements of the state table.
Use S3L_free_rand_fib to deallocate an LFG setup.
The C and Fortran syntax for S3L_setup_rand_fib are shown below.
#include <s3l/s3l-c.h> #include <s3l/s3l_errno-c.h> int S3L_setup_rand_fib(setup_id, seed) int *setup_id int seed |
include `s3l/s3l-f.h' include `s3l/s3l_errno-f.h' subroutine S3L_setup_rand_fib(setup_id, seed, ier) integer*4 setup_id integer*4 seed integer*4 ier |
setup_id - Integer index used to access the state table associated with a particular LFG.
seed - An integer value used to initialize the LMG that initializes the noncritical elements of the LFG's state table.
This function uses the following argument for output:
setup_id - On output, setup_id contains an index that can be used as input to S3L_rand_fib.
ier (Fortran only) - When called from a Fortran program, this function returns error status in ier.
On success, S3L_setup_rand_fib returns S3L_SUCCESS.
../examples/s3l/rand_fib/rand_fib.c ../examples/s3l/rand_fib-f/rand_fib.f
S3L_free_rand_fib(3) S3L_rand_fib(3)