Multiple Streams Generator APIs#

Multiple Streams Generator Functions#

randskipahead()#

void SRANDSKIPAHEAD(rng_int_t *n, rng_int_t *state, rng_int_t *info)#
void DRANDSKIPAHEAD(rng_int_t *n, rng_int_t *state, rng_int_t *info)#
void srandskipahead_(rng_int_t *n, rng_int_t *state, rng_int_t *info)#
void drandskipahead_(rng_int_t *n, rng_int_t *state, rng_int_t *info)#
void srandskipahead(rng_int_t n, rng_int_t *state, rng_int_t *info)#
void drandskipahead(rng_int_t n, rng_int_t *state, rng_int_t *info)#

Advance the generator defined by state so that the next call generates a number n- places after the previous number.

Allows multiple streams using the Skip Ahead method.

Parameters:
  • n – [in] Number of places to skip ahead, n >= 0

  • state – [inout]

    On Entry: state array generated by one of the initialisation routines

    On Exit : The entry stream, advanced n- places and set to return every Nth value

  • info – [out]

    Error code:

    0 = Everything OK

    -1 to -2 = Error in parameter, abs(info) If the generator defined by state can not be multithreaded using the skipahead method then routine returns -2

randleapfrog()#

void SRANDLEAPFROG(rng_int_t *n, rng_int_t *k, rng_int_t *state, rng_int_t *info)#
void DRANDLEAPFROG(rng_int_t *n, rng_int_t *k, rng_int_t *state, rng_int_t *info)#
void srandleapfrog_(rng_int_t *n, rng_int_t *k, rng_int_t *state, rng_int_t *info)#
void drandleapfrog_(rng_int_t *n, rng_int_t *k, rng_int_t *state, rng_int_t *info)#
void srandleapfrog(rng_int_t n, rng_int_t k, rng_int_t *state, rng_int_t *info)#
void drandleapfrog(rng_int_t n, rng_int_t k, rng_int_t *state, rng_int_t *info)#

Adjust the generator defined by state so it can be used to generate the Kth stream out of n- multiple streams, using the Leap Frog method.

Parameters:
  • n – [in] Total number of streams, n > 0

  • k – [in] Number of current stream, 0 < k <= n

  • state – [inout]

    On Entry: state array generated by one of the initialisation routines

    On Exit: The entry stream, advanced k-1 places and set to return every Nth value

  • info – [out]

    Error code

    0 = Everything OK

    -1 to -3 = Error in parameter, abs(info) If the generator defined by state can not be multithreaded using the leapfrog method then routine returns with info = -3