跳到主要内容

muRAND Device API Reference

muRAND provides pseudorandom and quasirandom number generation for MUSA applications. Pseudorandom generators produce deterministic sequences for statistical simulation, while quasirandom generators produce low-discrepancy point sets for workloads that benefit from more even multidimensional coverage.

muRAND exposes two public programming models: a host-side library-call model and a device-side state-based model. This document describes the device-side model and points to the host reference when host-managed generation is the better fit.

1. Introduction

1.1 What Is the muRAND Device API

The device API is the in-kernel programming model in muRAND. It works through state objects that are initialized for a generator family, passed into device code, and advanced as generation routines return pseudorandom or quasirandom values.

Use this model when random values need to be produced and consumed directly inside kernels, without a separate host-managed generation pass through output buffers. Pseudorandom state families use seed, subsequence, and offset inputs, while quasirandom state families use direction vectors, optional scramble constants, and offsets supplied by host-side support routines. If you need host-managed generator creation, bulk generation, direction-vector retrieval, scramble constants, or host-side distribution setup, see the muRAND Host API Reference.

1.2 Document Scope in MUSA SDK 5.2

This reference describes the muRAND device APIs supported in MUSA SDK 5.2. Public declarations that exist in device headers but do not appear in this document are experimental in MUSA SDK 5.2 and are provided for reference only.

1.3 Device State and Distribution Model

The device API centers on generator state objects passed directly to inline routines. Initialization routines establish a starting point for a specific state family, generation routines return values and advance the state in place, and skipahead routines move supported states forward when intermediate values do not need to be generated. Sobol and scrambled Sobol workflows also depend on direction vectors and scramble constants prepared by host-side support routines before device initialization begins.

1.4 How to Use This Document

Read Chapter 2 first if you need the device-state workflow. Chapter 3 then groups the supported APIs by initialization, base generation, distributions, and skipahead routines.

2. Using the muRAND Device API

2.1 Core Device Model and Workflow

The device API is a state-object model for in-kernel generation. Each thread, work item, or persistent device task uses a state object that has been initialized for a specific generator family. Generation routines read and advance that state, so values can be produced and consumed without a separate host-managed output pass.

A normal device-side workflow is:

  1. Choose a state family that matches the algorithm.
  2. Initialize the state with the matching murand_init overload, or load an already initialized state object into the kernel.
  3. Call murand, murand_uniform, murand_normal, murand_log_normal, murand_poisson, or related routines inside the kernel.
  4. Preserve the updated state object for later generation, or advance it with skipahead, skipahead_subsequence, or skipahead_sequence when intermediate values do not need to be generated.

The next subsections explain the shared rules first and the family-specific exceptions afterward.

2.2 Common Initialization and Generation Rules

The device API includes pseudorandom state families for murandStateMRG32k3a_t, murandStatePhilox4_32_10_t, and murandStateXORWOW_t. These families use a seed, subsequence, and offset model.

The device API also includes quasirandom state families for murandStateSobol32_t, murandStateSobol64_t, murandStateScrambledSobol32_t, and murandStateScrambledSobol64_t. These families use direction vectors, optional scramble constants, and offsets rather than a seed or subsequence model.

Distribution routines consume these state objects and advance them as values are generated. Some signatures advance the state by one position, while vector-returning and distribution routines can advance it by more than one. Chapter 3 describes the advancement behavior for each signature.

murandStateMtgp32_t also appears in the generation signatures documented in Chapter 3, but it follows separate setup and execution rules rather than the murand_init overload set used by the other state families.

2.3 Host-Supplied Sobol Setup Data

For pseudorandom states, murand_init takes a seed, a subsequence, and an offset. For quasirandom states, murand_init takes direction vectors, an offset, and, for scrambled variants, a scramble constant.

Sobol32 and scrambled Sobol32 initializers take pointers to 32-bit direction-vector arrays. Sobol64 and scrambled Sobol64 initializers take pointers to 64-bit direction-vector arrays. The scrambled variants use scramble constants with the matching width.

The required direction vectors and scramble constants are provided by the host-side support routines documented in the muRAND Host API Reference. Because the device API does not generate these tables itself, Sobol and scrambled Sobol workflows depend on a host-side setup step before the device states are initialized.

2.4 State Persistence, Reproducibility, and Skipahead

Because generation routines advance the state object they consume, later uses of the same state continue from the updated position. If later device work needs to continue an existing sequence, it should preserve and reuse the updated state object. If it needs to restart from the same initial point, it should call the matching murand_init overload again with the same family-specific input values.

When intermediate values do not need to be materialized, skipahead, skipahead_subsequence, and skipahead_sequence move supported state families forward directly. Sobol state families use offset-based skipahead, while the seed-based pseudorandom families also expose subsequence or sequence forms as described in Section 3.7.

2.5 Family-Specific Notes

murandStateMRG32k3a_t, murandStatePhilox4_32_10_t, and murandStateXORWOW_t support seed, subsequence, and offset initialization plus the full skipahead family. In this release, the documented subsequence sizes are 2^76 for MRG32k3a, 4 * 2^64 for Philox4_32_10, and 2^67 for XORWOW. MRG32k3a also documents 2^127 sequence skips.

murandStateSobol32_t, murandStateSobol64_t, and the scrambled Sobol variants use host-provided direction vectors, and the scrambled variants also use scramble constants. Their documented state-advance form in this reference is offset-based skipahead.

murandStateMtgp32_t appears in generation signatures but is not initialized through the murand_init overloads documented in this reference. Its device-side generation rules are separate: the number of updated positions may not exceed 256, and a given state may not be updated by more than one thread block.

3. Device API Reference

3.1 State Initialization

3.1.1 murand_init

The following 7 signatures are supported in MUSA SDK 5.2.

Overload 1
void murand_init(const unsigned long long seed, const unsigned long long subsequence, const unsigned long long offset, murandStateMRG32k3a_t *state)

Description

  • Initializes MRG32K3A state.
  • Initializes the MRG32K3A generator state with the given seed, subsequence, and offset.

Parameters

  • seed (const unsigned long long): Value to use as a seed
  • subsequence (const unsigned long long): Subsequence to start at
  • offset (const unsigned long long): Absolute offset into subsequence
  • state (murandStateMRG32k3a_t *): Pointer to state to initialize

Returns

  • Returns no value.
Overload 2
void murand_init(const unsigned long long seed, const unsigned long long subsequence, const unsigned long long offset, murandStatePhilox4_32_10_t *state)

Description

  • Initializes Philox state.
  • Initializes the Philox generator state with the given seed, subsequence, and offset.

Parameters

  • seed (const unsigned long long): Value to use as a seed
  • subsequence (const unsigned long long): Subsequence to start at
  • offset (const unsigned long long): Absolute offset into subsequence
  • state (murandStatePhilox4_32_10_t *): Pointer to state to initialize

Returns

  • Returns no value.
Overload 3
void murand_init(const unsigned int *vectors, const unsigned int scramble_constant, const unsigned int offset, murandStateScrambledSobol32_t *state)

Description

  • Initializes scrambled Sobol32 state.
  • Initializes the scrambled Sobol32 generator state with the given direction vectors and offset.

Parameters

  • vectors (const unsigned int *): Direction vectors
  • scramble_constant (const unsigned int): Constant used for scrambling the sequence
  • offset (const unsigned int): Absolute offset into sequence
  • state (murandStateScrambledSobol32_t *): Pointer to state to initialize

Returns

  • Returns no value.
Overload 4
void murand_init(const unsigned long long int *vectors, const unsigned long long int scramble_constant, const unsigned int offset, murandStateScrambledSobol64_t *state)

Description

  • Initializes scrambled Sobol64 state.
  • Initializes the scrambled Sobol64 generator state with the given direction vectors and offset.

Parameters

  • vectors (const unsigned long long int *): Direction vectors
  • scramble_constant (const unsigned long long int): Constant used for scrambling the sequence
  • offset (const unsigned int): Absolute offset into sequence
  • state (murandStateScrambledSobol64_t *): Pointer to state to initialize

Returns

  • Returns no value.
Overload 5
void murand_init(const unsigned int *vectors, const unsigned int offset, murandStateSobol32_t *state)

Description

  • Initializes Sobol32 state.
  • Initializes the Sobol32 generator state with the given direction vectors and offset.

Parameters

  • vectors (const unsigned int *): Direction vectors
  • offset (const unsigned int): Absolute offset into sequence
  • state (murandStateSobol32_t *): Pointer to state to initialize

Returns

  • Returns no value.
Overload 6
void murand_init(const unsigned long long int *vectors, const unsigned int offset, murandStateSobol64_t *state)

Description

  • Initializes Sobol64 state.
  • Initializes the Sobol64 generator state with the given direction vectors and offset.

Parameters

  • vectors (const unsigned long long int *): Direction vectors
  • offset (const unsigned int): Absolute offset into sequence
  • state (murandStateSobol64_t *): Pointer to state to initialize

Returns

  • Returns no value.
Overload 7
void murand_init(const unsigned long long seed, const unsigned long long subsequence, const unsigned long long offset, murandStateXORWOW_t *state)

Description

  • Initializes XORWOW state.
  • Initializes the XORWOW generator state with the given seed, subsequence, and offset.

Parameters

  • seed (const unsigned long long): Value to use as a seed
  • subsequence (const unsigned long long): Subsequence to start at
  • offset (const unsigned long long): Absolute offset into subsequence
  • state (murandStateXORWOW_t *): Pointer to state to initialize

Returns

  • Returns no value.

3.2 Base Random Integer Generation

3.2.1 murand

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
unsigned int murand(murandStateMRG32k3a_t *state)

Description

  • Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
  • Generates and returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range using MRG32K3A generator in state. State is incremented by one position.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use

Returns

  • Pseudorandom value (32-bit) as an unsigned int
Overload 2
unsigned int murand(murandStatePhilox4_32_10_t *state)

Description

  • Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
  • Generates and returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range using Philox generator in state. State is incremented by one position.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Pseudorandom value (32-bit) as an unsigned int
Overload 3
unsigned int murand(murandStateScrambledSobol32_t *state)

Description

  • Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
  • Generates and returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range using scrambled_sobol32 generator in state. State is incremented by one position.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use

Returns

  • Quasirandom value (32-bit) as an unsigned int
Overload 4
unsigned long long int murand(murandStateScrambledSobol64_t *state)

Description

  • Returns uniformly distributed random unsigned int value from [0; 2^64 - 1] range.
  • Generates and returns uniformly distributed random unsigned int value from [0; 2^64 - 1] range using scrambled_sobol64 generator in state. State is incremented by one position.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use

Returns

  • Quasirandom value (64-bit) as an unsigned long long
Overload 5
unsigned int murand(murandStateSobol32_t *state)

Description

  • Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
  • Generates and returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range using Sobol32 generator in state. State is incremented by one position.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use

Returns

  • Quasirandom value (32-bit) as an unsigned int
Overload 6
unsigned long long int murand(murandStateSobol64_t *state)

Description

  • Returns uniformly distributed random unsigned int value from [0; 2^64 - 1] range.
  • Generates and returns uniformly distributed random unsigned int value from [0; 2^64 - 1] range using Sobol64 generator in state. State is incremented by one position.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use

Returns

  • Quasirandom value (64-bit) as an unsigned long long
Overload 7
unsigned int murand(murandStateMtgp32_t *state)

Description

  • Returns a uniformly distributed random unsigned int value from the [0, 2^32 - 1] range using the MTGP32 generator in state.
  • State is incremented by one position.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a MTGP32 state to use.

Returns

  • Pseudorandom value (32-bit) as an unsigned int.
Overload 8
unsigned int murand(murandStateXORWOW_t *state)

Description

  • Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
  • Generates and returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range using XORWOW generator in state. State is incremented by one position.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use

Returns

  • Pseudorandom value (32-bit) as an unsigned int

3.3 Uniform Distributions

3.3.1 murand_uniform

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
float murand_uniform(murandStatePhilox4_32_10_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0f, including 1.0f) using Philox generator in state, and increments position of the generator by one.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.
Overload 2
float murand_uniform(murandStateMRG32k3a_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0f, including 1.0f) using MRG32K3A generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.
Overload 3
float murand_uniform(murandStateXORWOW_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0f, including 1.0f) using XORWOW generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.
Overload 4
float murand_uniform(murandStateMtgp32_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0f, including 1.0f) using MTGP32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.
Overload 5
float murand_uniform(murandStateSobol32_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0f, including 1.0f) using SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.
Overload 6
float murand_uniform(murandStateScrambledSobol32_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0f, including 1.0f) using SCRAMBLED_SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.
Overload 7
float murand_uniform(murandStateSobol64_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0, including 1.0) using SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.
Overload 8
float murand_uniform(murandStateScrambledSobol64_t *state)

Description

  • Returns a uniformly distributed random float value from (0; 1] range.
  • Generates and returns a uniformly distributed float value from (0; 1] range (excluding 0.0, including 1.0) using SCRAMBLED_SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use

Returns

  • Uniformly distributed float value from (0; 1] range.

3.3.2 murand_uniform2_double

The following signature is supported in MUSA SDK 5.2.

Overload 1
double2 murand_uniform2_double(murandStatePhilox4_32_10_t *state)

Description

  • Returns two uniformly distributed random double values from (0; 1] range.
  • Generates and returns two uniformly distributed double values from (0; 1] range (excluding 0.0, including 1.0) using Philox generator in state, and increments position of the generator by four.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Two uniformly distributed double values from (0; 1] range as double2.

3.3.3 murand_uniform4

The following signature is supported in MUSA SDK 5.2.

Overload 1
float4 murand_uniform4(murandStatePhilox4_32_10_t *state)

Description

  • Returns four uniformly distributed random float values from (0; 1] range.
  • Generates and returns four uniformly distributed float values from (0; 1] range (excluding 0.0f, including 1.0f) using Philox generator in state, and increments position of the generator by four.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Four uniformly distributed float values from (0; 1] range as float4.

3.3.4 murand_uniform_double

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
double murand_uniform_double(murandStatePhilox4_32_10_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using Philox generator in state, and increments position of the generator by two.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.
Overload 2
double murand_uniform_double(murandStateMRG32k3a_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using MRG32K3A generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.
Overload 3
double murand_uniform_double(murandStateXORWOW_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using MRG32K3A generator in state, and increments position of the generator by two.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.
Overload 4
double murand_uniform_double(murandStateMtgp32_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using MTGP32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.
Overload 5
double murand_uniform_double(murandStateSobol32_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.
Overload 6
double murand_uniform_double(murandStateScrambledSobol32_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using SCRAMBLED_SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.
Overload 7
double murand_uniform_double(murandStateSobol64_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.
Overload 8
double murand_uniform_double(murandStateScrambledSobol64_t *state)

Description

  • Returns a uniformly distributed random double value from (0; 1] range.
  • Generates and returns a uniformly distributed double value from (0; 1] range (excluding 0.0, including 1.0) using SCRAMBLED_SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use

Returns

  • Uniformly distributed double value from (0; 1] range.

3.4 Normal Distributions

3.4.1 murand_normal

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
float murand_normal(murandStatePhilox4_32_10_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using Philox generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Normally distributed float value
Overload 2
float murand_normal(murandStateMRG32k3a_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using MRG32k3a generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use

Returns

  • Normally distributed float value
Overload 3
float murand_normal(murandStateXORWOW_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using XORWOW generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use

Returns

  • Normally distributed float value
Overload 4
float murand_normal(murandStateMtgp32_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using MTGP32 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a state to use

Returns

  • Normally distributed float value
Overload 5
float murand_normal(murandStateSobol32_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using SOBOL32 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use

Returns

  • Normally distributed float value
Overload 6
float murand_normal(murandStateScrambledSobol32_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using SCRAMBLED_SOBOL32 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use

Returns

  • Normally distributed float value
Overload 7
float murand_normal(murandStateSobol64_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using SOBOL64 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use

Returns

  • Normally distributed float value
Overload 8
float murand_normal(murandStateScrambledSobol64_t *state)

Description

  • Returns a normally distributed float value.
  • Generates and returns a normally distributed float value using SCRAMBLED_SOBOL64 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use

Returns

  • Normally distributed float value

3.4.2 murand_normal2

The following 3 signatures are supported in MUSA SDK 5.2.

Overload 1
float2 murand_normal2(murandStatePhilox4_32_10_t *state)

Description

  • Returns two normally distributed float values.
  • Generates and returns two normally distributed float values using Philox generator in state, and increments position of the generator by two. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, and returns both of them.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Two normally distributed float value as float2
Overload 2
float2 murand_normal2(murandStateMRG32k3a_t *state)

Description

  • Returns two normally distributed float values.
  • Generates and returns two normally distributed float values using MRG32k3a generator in state, and increments position of the generator by two. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, and returns both of them.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use

Returns

  • Two normally distributed float value as float2
Overload 3
float2 murand_normal2(murandStateXORWOW_t *state)

Description

  • Returns two normally distributed float values.
  • Generates and returns two normally distributed float values using XORWOW generator in state, and increments position of the generator by two. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, and returns both of them.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use

Returns

  • Two normally distributed float values as float2

3.4.3 murand_normal2_double

The following 3 signatures are supported in MUSA SDK 5.2.

Overload 1
double2 murand_normal2_double(murandStatePhilox4_32_10_t *state)

Description

  • Returns two normally distributed double values.
  • Generates and returns two normally distributed double values using Philox generator in state, and increments position of the generator by four. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, and returns both of them.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Two normally distributed double values as double2
Overload 2
double2 murand_normal2_double(murandStateMRG32k3a_t *state)

Description

  • Returns two normally distributed double values.
  • Generates and returns two normally distributed double values using MRG32k3a generator in state, and increments position of the generator by two. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, and returns both of them.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use

Returns

  • Two normally distributed double value as double2
Overload 3
double2 murand_normal2_double(murandStateXORWOW_t *state)

Description

  • Returns two normally distributed double values.
  • Generates and returns two normally distributed double values using XORWOW generator in state, and increments position of the generator by four. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, and returns both of them.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use

Returns

  • Two normally distributed double value as double2

3.4.4 murand_normal4

The following signature is supported in MUSA SDK 5.2.

Overload 1
float4 murand_normal4(murandStatePhilox4_32_10_t *state)

Description

  • Returns four normally distributed float values.
  • Generates and returns four normally distributed float values using Philox generator in state, and increments position of the generator by four. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate four normally distributed values, and returns them.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Four normally distributed float value as float4

3.4.5 murand_normal_double

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
double murand_normal_double(murandStatePhilox4_32_10_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using Philox generator in state, and increments position of the generator by two. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use

Returns

  • Normally distributed double value
Overload 2
double murand_normal_double(murandStateMRG32k3a_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using MRG32k3a generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use

Returns

  • Normally distributed double value
Overload 3
double murand_normal_double(murandStateXORWOW_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using XORWOW generator in state, and increments position of the generator by two. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f. The function uses the Box-Muller transform method to generate two normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use

Returns

  • Normally distributed double value
Overload 4
double murand_normal_double(murandStateMtgp32_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using MTGP32 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a state to use

Returns

  • Normally distributed double value
Overload 5
double murand_normal_double(murandStateSobol32_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using SOBOL32 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use

Returns

  • Normally distributed double value
Overload 6
double murand_normal_double(murandStateScrambledSobol32_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using SCRAMBLED_SOBOL32 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use

Returns

  • Normally distributed double value
Overload 7
double murand_normal_double(murandStateSobol64_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using SOBOL64 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use

Returns

  • Normally distributed double value
Overload 8
double murand_normal_double(murandStateScrambledSobol64_t *state)

Description

  • Returns a normally distributed double value.
  • Generates and returns a normally distributed double value using SCRAMBLED_SOBOL64 generator in state, and increments position of the generator by one. Used normal distribution has mean value equal to 0.0f, and standard deviation equal to 1.0f.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use

Returns

  • Normally distributed double value

3.5 Log-Normal Distributions

3.5.1 murand_log_normal

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
float murand_log_normal(murandStatePhilox4_32_10_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using Philox generator in state, and increments position of the generator by one. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value
Overload 2
float murand_log_normal(murandStateMRG32k3a_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using MRG32k3a generator in state, and increments position of the generator by one. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value
Overload 3
float murand_log_normal(murandStateXORWOW_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using XORWOW generator in state, and increments position of the generator by one. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value
Overload 4
float murand_log_normal(murandStateMtgp32_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using MTGP32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value
Overload 5
float murand_log_normal(murandStateSobol32_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value
Overload 6
float murand_log_normal(murandStateScrambledSobol32_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using SCRAMBLED_SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value
Overload 7
float murand_log_normal(murandStateSobol64_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value
Overload 8
float murand_log_normal(murandStateScrambledSobol64_t *state, float mean, float stddev)

Description

  • Returns a log-normally distributed float value.
  • Generates and returns a log-normally distributed float value using SCRAMBLED_SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed float value

3.5.2 murand_log_normal2

The following 3 signatures are supported in MUSA SDK 5.2.

Overload 1
float2 murand_log_normal2(murandStatePhilox4_32_10_t *state, float mean, float stddev)

Description

  • Returns two log-normally distributed float values.
  • Generates and returns two log-normally distributed float values using Philox generator in state, and increments position of the generator by two. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, and returns both.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Two log-normally distributed float value as float2
Overload 2
float2 murand_log_normal2(murandStateMRG32k3a_t *state, float mean, float stddev)

Description

  • Returns two log-normally distributed float values.
  • Generates and returns two log-normally distributed float values using MRG32k3a generator in state, and increments position of the generator by two. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, and returns both.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Two log-normally distributed float value as float2
Overload 3
float2 murand_log_normal2(murandStateXORWOW_t *state, float mean, float stddev)

Description

  • Returns two log-normally distributed float values.
  • Generates and returns two log-normally distributed float values using XORWOW generator in state, and increments position of the generator by two. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, and returns both.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Two log-normally distributed float value as float2

3.5.3 murand_log_normal2_double

The following 3 signatures are supported in MUSA SDK 5.2.

Overload 1
double2 murand_log_normal2_double(murandStatePhilox4_32_10_t *state, double mean, double stddev)

Description

  • Returns two log-normally distributed double values.
  • Generates and returns two log-normally distributed double values using Philox generator in state, and increments position of the generator by four. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, and returns both.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Two log-normally distributed double values as double2
Overload 2
double2 murand_log_normal2_double(murandStateMRG32k3a_t *state, double mean, double stddev)

Description

  • Returns two log-normally distributed double values.
  • Generates and returns two log-normally distributed double values using MRG32k3a generator in state, and increments position of the generator by two. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, and returns both.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Two log-normally distributed double values as double2
Overload 3
double2 murand_log_normal2_double(murandStateXORWOW_t *state, double mean, double stddev)

Description

  • Returns two log-normally distributed double values.
  • Generates and returns two log-normally distributed double values using XORWOW generator in state, and increments position of the generator by four. The function uses the Box-Muller transform method to generate two normally distributed values, transforms them to log-normally distributed values, and returns both.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Two log-normally distributed double values as double2

3.5.4 murand_log_normal4

The following signature is supported in MUSA SDK 5.2.

Overload 1
float4 murand_log_normal4(murandStatePhilox4_32_10_t *state, float mean, float stddev)

Description

  • Returns four log-normally distributed float values.
  • Generates and returns four log-normally distributed float values using Philox generator in state, and increments position of the generator by four. The function uses the Box-Muller transform method to generate four normally distributed values, transforms them to log-normally distributed values, and returns them.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use
  • mean (float): Mean of the related log-normal distribution
  • stddev (float): Standard deviation of the related log-normal distribution

Returns

  • Four log-normally distributed float value as float4

3.5.5 murand_log_normal_double

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
double murand_log_normal_double(murandStatePhilox4_32_10_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double values.
  • Generates and returns a log-normally distributed double value using Philox generator in state, and increments position of the generator by two. The function uses the Box-Muller transform method to generate two normally distributed double values, transforms them to log-normally distributed double values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value
Overload 2
double murand_log_normal_double(murandStateMRG32k3a_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double value.
  • Generates and returns a log-normally distributed double value using MRG32k3a generator in state, and increments position of the generator by one. The function uses the Box-Muller transform method to generate two normally distributed double values, transforms them to log-normally distributed double values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value
Overload 3
double murand_log_normal_double(murandStateXORWOW_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double value.
  • Generates and returns a log-normally distributed double value using XORWOW generator in state, and increments position of the generator by two. The function uses the Box-Muller transform method to generate two normally distributed double values, transforms them to log-normally distributed double values, returns first of them, and saves the second to be returned on the next call.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value
Overload 4
double murand_log_normal_double(murandStateMtgp32_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double value.
  • Generates and returns a log-normally distributed double value using MTGP32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value
Overload 5
double murand_log_normal_double(murandStateSobol32_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double value.
  • Generates and returns a log-normally distributed double value using SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value
Overload 6
double murand_log_normal_double(murandStateScrambledSobol32_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double value.
  • Generates and returns a log-normally distributed double value using SCRAMBLED_SOBOL32 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value
Overload 7
double murand_log_normal_double(murandStateSobol64_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double value.
  • Generates and returns a log-normally distributed double value using SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value
Overload 8
double murand_log_normal_double(murandStateScrambledSobol64_t *state, double mean, double stddev)

Description

  • Returns a log-normally distributed double value.
  • Generates and returns a log-normally distributed double value using SCRAMBLED_SOBOL64 generator in state, and increments position of the generator by one.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use
  • mean (double): Mean of the related log-normal distribution
  • stddev (double): Standard deviation of the related log-normal distribution

Returns

  • Log-normally distributed double value

3.6 Poisson Distributions

3.6.1 murand_poisson

The following 8 signatures are supported in MUSA SDK 5.2.

Overload 1
unsigned int murand_poisson(murandStatePhilox4_32_10_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned int using Philox generator.
  • Generates and returns Poisson-distributed random unsigned int values using Philox generator in state. State is incremented by a variable amount.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned int
Overload 2
unsigned int murand_poisson(murandStateMRG32k3a_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned int using MRG32k3a generator.
  • Generates and returns Poisson-distributed random unsigned int values using MRG32k3a generator in state. State is incremented by a variable amount.

Parameters

  • state (murandStateMRG32k3a_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned int
Overload 3
unsigned int murand_poisson(murandStateXORWOW_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned int using XORWOW generator.
  • Generates and returns Poisson-distributed random unsigned int values using XORWOW generator in state. State is incremented by a variable amount.

Parameters

  • state (murandStateXORWOW_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned int
Overload 4
unsigned int murand_poisson(murandStateMtgp32_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned int using MTGP32 generator.
  • Generates and returns Poisson-distributed random unsigned int values using MTGP32 generator in state. State is incremented by one position.

Parameters

  • state (murandStateMtgp32_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned int
Overload 5
unsigned int murand_poisson(murandStateSobol32_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned int using SOBOL32 generator.
  • Generates and returns Poisson-distributed random unsigned int values using SOBOL32 generator in state. State is incremented by one position.

Parameters

  • state (murandStateSobol32_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned int
Overload 6
unsigned int murand_poisson(murandStateScrambledSobol32_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned int using SCRAMBLED_SOBOL32 generator.
  • Generates and returns Poisson-distributed random unsigned int values using SCRAMBLED_SOBOL32 generator in state. State is incremented by one position.

Parameters

  • state (murandStateScrambledSobol32_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned int
Overload 7
unsigned long long int murand_poisson(murandStateSobol64_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned long long int using SOBOL64 generator.
  • Generates and returns Poisson-distributed random unsigned long long int values using SOBOL64 generator in state. State is incremented by one position.

Parameters

  • state (murandStateSobol64_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned long long int
Overload 8
unsigned long long int murand_poisson(murandStateScrambledSobol64_t *state, double lambda)

Description

  • Returns a Poisson-distributed unsigned long long int using SCRAMBLED_SOBOL64 generator.
  • Generates and returns Poisson-distributed random unsigned long long int values using SCRAMBLED_SOBOL64 generator in state. State is incremented by one position.

Parameters

  • state (murandStateScrambledSobol64_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Poisson-distributed unsigned long long int

3.6.2 murand_poisson4

The following signature is supported in MUSA SDK 5.2.

Overload 1
uint4 murand_poisson4(murandStatePhilox4_32_10_t *state, double lambda)

Description

  • Returns four Poisson-distributed unsigned int values using Philox generator.
  • Generates and returns Poisson-distributed random unsigned int values using Philox generator in state. State is incremented by a variable amount.

Parameters

  • state (murandStatePhilox4_32_10_t *): Pointer to a state to use
  • lambda (double): Lambda parameter of the Poisson distribution

Returns

  • Four Poisson-distributed unsigned int values as uint4

3.7 Skipahead Functions

3.7.1 skipahead

The following 7 signatures are supported in MUSA SDK 5.2.

Overload 1
void skipahead(unsigned long long offset, murandStateMRG32k3a_t *state)

Description

  • Updates MRG32K3A state to skip ahead by offset elements.
  • Updates the MRG32K3A state in state to skip ahead by offset elements.

Parameters

  • offset (unsigned long long): Number of elements to skip
  • state (murandStateMRG32k3a_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 2
void skipahead(unsigned long long offset, murandStatePhilox4_32_10_t *state)

Description

  • Updates Philox state to skip ahead by offset elements.
  • Updates the Philox generator state in state to skip ahead by offset elements.

Parameters

  • offset (unsigned long long): Number of elements to skip
  • state (murandStatePhilox4_32_10_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 3
void skipahead(unsigned long long offset, murandStateScrambledSobol32_t *state)

Description

  • Updates SCRAMBLED_SOBOL32 state to skip ahead by offset elements.
  • Updates the SCRAMBLED_SOBOL32 state in state to skip ahead by offset elements.

Parameters

  • offset (unsigned long long): Number of elements to skip
  • state (murandStateScrambledSobol32_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 4
void skipahead(unsigned long long offset, murandStateScrambledSobol64_t *state)

Description

  • Updates scrambled_sobol64 state to skip ahead by offset elements.
  • Updates the scrambled_sobol64 state in state to skip ahead by offset elements.

Parameters

  • offset (unsigned long long): Number of elements to skip
  • state (murandStateScrambledSobol64_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 5
void skipahead(unsigned long long offset, murandStateSobol32_t *state)

Description

  • Updates SOBOL32 state to skip ahead by offset elements.
  • Updates the SOBOL32 state in state to skip ahead by offset elements.

Parameters

  • offset (unsigned long long): Number of elements to skip
  • state (murandStateSobol32_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 6
void skipahead(unsigned long long int offset, murandStateSobol64_t *state)

Description

  • Updates Sobol64 state to skip ahead by offset elements.
  • Updates the Sobol64 state in state to skip ahead by offset elements.

Parameters

  • offset (unsigned long long int): Number of elements to skip
  • state (murandStateSobol64_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 7
void skipahead(unsigned long long offset, murandStateXORWOW_t *state)

Description

  • Updates XORWOW state to skip ahead by offset elements.
  • Updates the XORWOW state in state to skip ahead by offset elements.

Parameters

  • offset (unsigned long long): Number of elements to skip
  • state (murandStateXORWOW_t *): Pointer to state to update

Returns

  • Returns no value.

3.7.2 skipahead_subsequence

The following 3 signatures are supported in MUSA SDK 5.2.

Overload 1
void skipahead_subsequence(unsigned long long subsequence, murandStateMRG32k3a_t *state)

Description

  • Updates MRG32K3A state to skip ahead by subsequence subsequences.
  • Updates the MRG32K3A state in state to skip ahead by subsequence subsequences. Each subsequence is 2^76 numbers long.

Parameters

  • subsequence (unsigned long long): Number of subsequences to skip
  • state (murandStateMRG32k3a_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 2
void skipahead_subsequence(unsigned long long subsequence, murandStatePhilox4_32_10_t *state)

Description

  • Updates Philox state to skip ahead by subsequence subsequences.
  • Updates the Philox generator state in state to skip ahead by subsequence subsequences. Each subsequence is 4 * 2^64 numbers long.

Parameters

  • subsequence (unsigned long long): Number of subsequences to skip
  • state (murandStatePhilox4_32_10_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 3
void skipahead_subsequence(unsigned long long subsequence, murandStateXORWOW_t *state)

Description

  • Updates XORWOW state to skip ahead by subsequence subsequences.
  • Updates the XORWOW state to skip ahead by subsequence subsequences. Each subsequence is 2^67 numbers long.

Parameters

  • subsequence (unsigned long long): Number of subsequences to skip
  • state (murandStateXORWOW_t *): Pointer to state to update

Returns

  • Returns no value.

3.7.3 skipahead_sequence

The following 3 signatures are supported in MUSA SDK 5.2.

Overload 1
void skipahead_sequence(unsigned long long sequence, murandStateMRG32k3a_t *state)

Description

  • Updates MRG32K3A state to skip ahead by sequence sequences.
  • Updates the MRG32K3A state in state to skip ahead by sequence sequences. Each sequence is 2^127 numbers long.

Parameters

  • sequence (unsigned long long): Number of sequences to skip
  • state (murandStateMRG32k3a_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 2
void skipahead_sequence(unsigned long long sequence, murandStatePhilox4_32_10_t *state)

Description

  • Updates Philox state to skip ahead by sequence sequences.
  • Updates the Philox generator state in state skipping sequence sequences ahead. For Philox each sequence is 4 * 2^64 numbers long (equal to the size of a subsequence).

Parameters

  • sequence (unsigned long long): Number of sequences to skip
  • state (murandStatePhilox4_32_10_t *): Pointer to state to update

Returns

  • Returns no value.
Overload 3
void skipahead_sequence(unsigned long long sequence, murandStateXORWOW_t *state)

Description

  • Updates XORWOW state to skip ahead by sequence sequences.
  • Updates the XORWOW state skipping sequence sequences ahead. For XORWOW each sequence is 2^67 numbers long (equal to the size of a subsequence).

Parameters

  • sequence (unsigned long long): Number of sequences to skip
  • state (murandStateXORWOW_t *): Pointer to state to update

Returns

  • Returns no value.