From 3a1c8ff063ca331db5b0d3d96699887876b2367b Mon Sep 17 00:00:00 2001 From: Andrei Fedorov Date: Thu, 20 Mar 2025 14:05:05 +0100 Subject: [PATCH 1/4] Made the number of engines to be implementation defined --- .../domains/rng/host_api/onemath-rng-mt2203.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst b/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst index b7a6ac297c..ab8825956f 100644 --- a/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst +++ b/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst @@ -7,19 +7,21 @@ mt2203 ====== -The mt2203 engine is the set of 6024 Mersenne Twister pseudorandom number generators MT2203 [:ref:`Matsumoto98 `], [:ref:`Matsumoto00 `]. +The mt2203 engine is the set of Mersenne Twister pseudorandom number generators MT2203 [:ref:`Matsumoto98 `], [:ref:`Matsumoto00 `]. +Coefficients are obtained by `the following tool`_. The amount of engines in the set (denoted `n_engines`) is implementation defined. .. _onemath_rng_mt2203_description: .. rubric:: Description -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. +The set of 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. .. container:: section .. rubric:: Generation algorithm - For :math:`j = 1,..., 6024`: + For :math:`j = 1,..., n_engines`: :math:`x_{n, j} =x_{n - (69 - 34), j} \oplus ( (x_{n - 69, j} \& 0xFFFFFFE0) | (x_{n + 69 + 1, j} \& 0x1F) ) A_{j}` @@ -140,14 +142,14 @@ class mt2203 The initial conditions of the generator state. The initialization algorithm described in [:ref:`MT2203 `]. engine_idx - The index of the set 1, ..., 6024. + The index of the set 1, ..., n_engines. .. container:: section .. rubric:: Throws oneapi::math::invalid_argument - Exception is thrown when :math:`idx > 6024` + Exception is thrown when :math:`idx > n_engines` .. _`mt2203(sycl::queue queue, std::initializer_list seed)`: @@ -182,7 +184,7 @@ class mt2203 The initial conditions of the generator state. The initialization algorithm described in [:ref:`MT2203 `]. engine_idx - The index of the set 1, ..., 6024. + The index of the set 1, ..., n_engines. .. _`mt2203(const mt2203& other)`: @@ -237,3 +239,5 @@ class mt2203 Valid ``mt2203`` r-value object. The ``queue`` and state of the other engine is moved to the current engine. **Parent topic:** :ref:`onemath_rng_engines_basic_random_number_generators` + +.. _`the following reference`: https://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/DC/dc.html From 81adcc10f0e5a69b6c437ba741287f6c6fc61a9e Mon Sep 17 00:00:00 2001 From: Andrei Fedorov Date: Thu, 20 Mar 2025 15:06:46 +0100 Subject: [PATCH 2/4] engines -> generators --- .../oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst b/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst index ab8825956f..1b2632f204 100644 --- a/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst +++ b/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst @@ -8,7 +8,7 @@ mt2203 ====== The mt2203 engine is the set of Mersenne Twister pseudorandom number generators MT2203 [:ref:`Matsumoto98 `], [:ref:`Matsumoto00 `]. -Coefficients are obtained by `the following tool`_. The amount of engines in the set (denoted `n_engines`) is implementation defined. +Coefficients are obtained by `the following tool`_. The amount of generators in the set (denoted `n_engines`) is implementation defined. .. _onemath_rng_mt2203_description: From 8a43914d4b1e622a78e825ea24f9433cebdb646f Mon Sep 17 00:00:00 2001 From: Andrei Fedorov Date: Thu, 20 Mar 2025 15:08:25 +0100 Subject: [PATCH 3/4] Update engines-basic-random-number-generators.rst --- .../host_api/engines-basic-random-number-generators.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/elements/oneMath/source/domains/rng/host_api/engines-basic-random-number-generators.rst b/source/elements/oneMath/source/domains/rng/host_api/engines-basic-random-number-generators.rst index f997f52503..6058c7592f 100644 --- a/source/elements/oneMath/source/domains/rng/host_api/engines-basic-random-number-generators.rst +++ b/source/elements/oneMath/source/domains/rng/host_api/engines-basic-random-number-generators.rst @@ -40,7 +40,7 @@ Host Engines (Basic Random Number Generators) * - \ :ref:`onemath_rng_mt19937`\ - Mersenne Twister pseudorandom number generator ``MT19937``\ :ref:`[Matsumoto98] ` with period length 2\ :sup:`19937`-1 of the produced sequence * - \ :ref:`onemath_rng_mt2203`\ - - Set of 6024 Mersenne Twister pseudorandom number generators ``MT2203``\ :ref:`[Matsumoto98] `, :ref:`[Matsumoto00] `. 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. + - Set of Mersenne Twister pseudorandom number generators ``MT2203``\ :ref:`[Matsumoto98] `, :ref:`[Matsumoto00] `. 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. * - \ :ref:`onemath_rng_sfmt19937`\ - SIMD-oriented Fast Mersenne Twister pseudorandom number generator ``SFMT19937``\ :ref:`[Saito08] ` with a period length equal to 2\ :sup:`19937`-1 of the produced sequence. * - \ :ref:`onemath_rng_sobol`\ @@ -62,8 +62,8 @@ Host Engines (Basic Random Number Generators) description of these functions can be found in the :ref:`onemath_rng_service_routines` section. - In addition, the MT2203 pseudorandom number generator is a set of 6024 - generators designed to create up to 6024 independent random + In addition, the MT2203 pseudorandom number generator is a set of + generators designed to create independent random sequences, which might be used in parallel Monte Carlo simulations. Another generator that has the same feature is Wichmann-Hill. It allows creating up to 273 independent random streams. The properties @@ -107,7 +107,7 @@ Host Engines (Basic Random Number Generators) SFMT19937 [Saito08] with a period length equal to 2\ :sup:`19937`-1 of the produced sequence. - :ref:`onemath_rng_mt2203` - Set of 6024 Mersenne Twister pseudorandom number generators MT2203 + Set of Mersenne Twister pseudorandom number generators MT2203 [Matsumoto98], [Matsumoto00]. 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 From eed60ef016af0e87ce9e25eb1c4c4e8f5a43b988 Mon Sep 17 00:00:00 2001 From: Andrei Fedorov Date: Thu, 20 Mar 2025 15:22:41 +0100 Subject: [PATCH 4/4] fixed the link --- .../oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst b/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst index 1b2632f204..83bcdffe98 100644 --- a/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst +++ b/source/elements/oneMath/source/domains/rng/host_api/onemath-rng-mt2203.rst @@ -240,4 +240,4 @@ class mt2203 **Parent topic:** :ref:`onemath_rng_engines_basic_random_number_generators` -.. _`the following reference`: https://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/DC/dc.html +.. _`the following tool`: https://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/DC/dc.html