Skip to content

Commit b64ea1c

Browse files
authored
[oneMath][RNG] Make number of generators for MT2203 be implementation defined (#618)
* Made the number of engines to be implementation defined * engines -> generators * Update engines-basic-random-number-generators.rst * fixed the link
1 parent 5cef0ab commit b64ea1c

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

source/elements/oneMath/source/domains/rng/host_api/engines-basic-random-number-generators.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Host Engines (Basic Random Number Generators)
4040
* - \ :ref:`onemath_rng_mt19937`\
4141
- Mersenne Twister pseudorandom number generator ``MT19937``\ :ref:`[Matsumoto98] <onemath_rng_bibliography>` with period length 2\ :sup:`19937`-1 of the produced sequence
4242
* - \ :ref:`onemath_rng_mt2203`\
43-
- Set of 6024 Mersenne Twister pseudorandom number generators ``MT2203``\ :ref:`[Matsumoto98] <onemath_rng_bibliography>`, :ref:`[Matsumoto00] <onemath_rng_bibliography>`. Each of them generates a sequence of period length equal to 2\ :sup:`2203`-1. Parameters of the generators provide mutual independence of the corresponding sequences.
43+
- Set of Mersenne Twister pseudorandom number generators ``MT2203``\ :ref:`[Matsumoto98] <onemath_rng_bibliography>`, :ref:`[Matsumoto00] <onemath_rng_bibliography>`. Each of them generates a sequence of period length equal to 2\ :sup:`2203`-1. Parameters of the generators provide mutual independence of the corresponding sequences.
4444
* - \ :ref:`onemath_rng_sfmt19937`\
4545
- SIMD-oriented Fast Mersenne Twister pseudorandom number generator ``SFMT19937``\ :ref:`[Saito08] <onemath_rng_bibliography>` with a period length equal to 2\ :sup:`19937`-1 of the produced sequence.
4646
* - \ :ref:`onemath_rng_sobol`\
@@ -62,8 +62,8 @@ Host Engines (Basic Random Number Generators)
6262
description of these functions can be found in the :ref:`onemath_rng_service_routines` section.
6363

6464

65-
In addition, the MT2203 pseudorandom number generator is a set of 6024
66-
generators designed to create up to 6024 independent random
65+
In addition, the MT2203 pseudorandom number generator is a set of
66+
generators designed to create independent random
6767
sequences, which might be used in parallel Monte Carlo simulations.
6868
Another generator that has the same feature is Wichmann-Hill. It
6969
allows creating up to 273 independent random streams. The properties
@@ -107,7 +107,7 @@ Host Engines (Basic Random Number Generators)
107107
SFMT19937 [Saito08] with a period length equal to
108108
2\ :sup:`19937`-1 of the produced sequence.
109109
- :ref:`onemath_rng_mt2203`
110-
Set of 6024 Mersenne Twister pseudorandom number generators MT2203
110+
Set of Mersenne Twister pseudorandom number generators MT2203
111111
[Matsumoto98], [Matsumoto00]. Each of them generates a sequence of
112112
period length equal to 2\ :sup:`2203`-1. Parameters of the
113113
generators provide mutual independence of the corresponding

source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77
mt2203
88
======
99

10-
The mt2203 engine is the set of 6024 Mersenne Twister pseudorandom number generators MT2203 [:ref:`Matsumoto98 <onemath_rng_bibliography>`], [:ref:`Matsumoto00 <onemath_rng_bibliography>`].
10+
The mt2203 engine is the set of Mersenne Twister pseudorandom number generators MT2203 [:ref:`Matsumoto98 <onemath_rng_bibliography>`], [:ref:`Matsumoto00 <onemath_rng_bibliography>`].
11+
Coefficients are obtained by `the following tool`_. The amount of generators in the set (denoted `n_engines`) is implementation defined.
1112

1213
.. _onemath_rng_mt2203_description:
1314

1415
.. rubric:: Description
1516

16-
The set of 6024 basic pseudorandom number generators MT2203 is a natural addition to the MT19937 generator. MT2203 generators are intended for use in large scale Monte Carlo simulations performed on multi-processor computer systems.
17+
The set of basic pseudorandom number generators MT2203 is a natural addition to the MT19937 generator.
18+
MT2203 generators are intended for use in large scale Monte Carlo simulations performed on multi-processor computer systems.
1719

1820
.. container:: section
1921

2022
.. rubric:: Generation algorithm
2123

22-
For :math:`j = 1,..., 6024`:
24+
For :math:`j = 1,..., n_engines`:
2325

2426
:math:`x_{n, j} =x_{n - (69 - 34), j} \oplus ( (x_{n - 69, j} \& 0xFFFFFFE0) | (x_{n + 69 + 1, j} \& 0x1F) ) A_{j}`
2527

@@ -140,14 +142,14 @@ class mt2203
140142
The initial conditions of the generator state. The initialization algorithm described in [:ref:`MT2203 <onemath_rng_bibliography>`].
141143

142144
engine_idx
143-
The index of the set 1, ..., 6024.
145+
The index of the set 1, ..., n_engines.
144146

145147
.. container:: section
146148

147149
.. rubric:: Throws
148150

149151
oneapi::math::invalid_argument
150-
Exception is thrown when :math:`idx > 6024`
152+
Exception is thrown when :math:`idx > n_engines`
151153

152154
.. _`mt2203(sycl::queue queue, std::initializer_list<std::uint32_t> seed)`:
153155

@@ -182,7 +184,7 @@ class mt2203
182184
The initial conditions of the generator state. The initialization algorithm described in [:ref:`MT2203 <onemath_rng_bibliography>`].
183185

184186
engine_idx
185-
The index of the set 1, ..., 6024.
187+
The index of the set 1, ..., n_engines.
186188

187189
.. _`mt2203(const mt2203& other)`:
188190

@@ -237,3 +239,5 @@ class mt2203
237239
Valid ``mt2203`` r-value object. The ``queue`` and state of the other engine is moved to the current engine.
238240

239241
**Parent topic:** :ref:`onemath_rng_engines_basic_random_number_generators`
242+
243+
.. _`the following tool`: https://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/DC/dc.html

0 commit comments

Comments
 (0)