From 1eeda5f893d9595a855cdfa5d53dbbdd08c091b7 Mon Sep 17 00:00:00 2001 From: timo-eichhorn <105986136+timo-eichhorn@users.noreply.github.com> Date: Sun, 11 Jun 2023 23:08:56 +0200 Subject: [PATCH 1/3] Made result_type typedef public Changed result_type typedef in pcg_extras::seed_seq_from to be public in order to be compatible with standard library PRNGs --- include/pcg_extras.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pcg_extras.hpp b/include/pcg_extras.hpp index 041724a..01c37b6 100644 --- a/include/pcg_extras.hpp +++ b/include/pcg_extras.hpp @@ -583,9 +583,9 @@ class seed_seq_from { private: RngType rng_; +public: typedef uint_least32_t result_type; -public: template seed_seq_from(Args&&... args) : rng_(std::forward(args)...) From c30516c50439ae8caf120eca89e5ebcc59422a7b Mon Sep 17 00:00:00 2001 From: Timo Eichhorn <105986136+timo-eichhorn@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:53:36 +0200 Subject: [PATCH 2/3] Added typedefs for DXSM variants of pcg32 and pcg64 --- include/pcg_random.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/pcg_random.hpp b/include/pcg_random.hpp index d479a81..3354f3d 100644 --- a/include/pcg_random.hpp +++ b/include/pcg_random.hpp @@ -1864,11 +1864,13 @@ using ext_setseq_xsl_rr_128_64 = } // namespace pcg_engines typedef pcg_engines::setseq_xsh_rr_64_32 pcg32; +typedef pcg_engines::setseq_dxsm_64_32 pcg32_dxsm; typedef pcg_engines::oneseq_xsh_rr_64_32 pcg32_oneseq; typedef pcg_engines::unique_xsh_rr_64_32 pcg32_unique; typedef pcg_engines::mcg_xsh_rs_64_32 pcg32_fast; typedef pcg_engines::setseq_xsl_rr_128_64 pcg64; +typedef pcg_engines::setseq_dxsm_128_64 pcg64_dxsm; typedef pcg_engines::oneseq_xsl_rr_128_64 pcg64_oneseq; typedef pcg_engines::unique_xsl_rr_128_64 pcg64_unique; typedef pcg_engines::mcg_xsl_rr_128_64 pcg64_fast; From efd45e6d78db3e58a1b8f3ab35ed6b616ff79e95 Mon Sep 17 00:00:00 2001 From: Timo Eichhorn Date: Wed, 16 Apr 2025 23:12:11 +0200 Subject: [PATCH 3/3] Added more DXSM variants and made an implicit cast explicit --- include/pcg_random.hpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/include/pcg_random.hpp b/include/pcg_random.hpp index 3354f3d..a62094f 100644 --- a/include/pcg_random.hpp +++ b/include/pcg_random.hpp @@ -333,7 +333,7 @@ class specific_stream { void set_stream(itype specific_seq) { - inc_ = (specific_seq << 1) | 1; + inc_ = (specific_seq << 1) | static_cast(1u); } static constexpr bool can_specify_stream = true; @@ -1864,17 +1864,25 @@ using ext_setseq_xsl_rr_128_64 = } // namespace pcg_engines typedef pcg_engines::setseq_xsh_rr_64_32 pcg32; -typedef pcg_engines::setseq_dxsm_64_32 pcg32_dxsm; typedef pcg_engines::oneseq_xsh_rr_64_32 pcg32_oneseq; typedef pcg_engines::unique_xsh_rr_64_32 pcg32_unique; typedef pcg_engines::mcg_xsh_rs_64_32 pcg32_fast; +typedef pcg_engines::setseq_dxsm_64_32 pcg32_dxsm; +typedef pcg_engines::oneseq_dxsm_64_32 pcg32_dxsm_oneseq; +typedef pcg_engines::unique_dxsm_64_32 pcg32_dxsm_unique; +typedef pcg_engines::mcg_dxsm_64_32 pcg32_dxsm_fast; + typedef pcg_engines::setseq_xsl_rr_128_64 pcg64; -typedef pcg_engines::setseq_dxsm_128_64 pcg64_dxsm; typedef pcg_engines::oneseq_xsl_rr_128_64 pcg64_oneseq; typedef pcg_engines::unique_xsl_rr_128_64 pcg64_unique; typedef pcg_engines::mcg_xsl_rr_128_64 pcg64_fast; +typedef pcg_engines::setseq_dxsm_128_64 pcg64_dxsm; +typedef pcg_engines::oneseq_dxsm_128_64 pcg64_dxsm_oneseq; +typedef pcg_engines::unique_dxsm_128_64 pcg64_dxsm_unique; +typedef pcg_engines::mcg_dxsm_128_64 pcg64_dxsm_fast; + typedef pcg_engines::setseq_rxs_m_xs_8_8 pcg8_once_insecure; typedef pcg_engines::setseq_rxs_m_xs_16_16 pcg16_once_insecure; typedef pcg_engines::setseq_rxs_m_xs_32_32 pcg32_once_insecure; @@ -1904,8 +1912,8 @@ typedef pcg_engines::ext_oneseq_xsh_rs_64_32<1,32,true> pcg32_k2_fast; // (neither is intended for use in cryptographic applications) typedef pcg_engines::ext_setseq_xsh_rr_64_32<6,16,true> pcg32_k64; -typedef pcg_engines::ext_mcg_xsh_rs_64_32<6,32,true> pcg32_k64_oneseq; -typedef pcg_engines::ext_oneseq_xsh_rs_64_32<6,32,true> pcg32_k64_fast; +typedef pcg_engines::ext_oneseq_xsh_rs_64_32<6,32,true> pcg32_k64_oneseq; +typedef pcg_engines::ext_mcg_xsh_rs_64_32<6,32,true> pcg32_k64_fast; typedef pcg_engines::ext_setseq_xsh_rr_64_32<6,16,false> pcg32_c64; typedef pcg_engines::ext_oneseq_xsh_rs_64_32<6,32,false> pcg32_c64_oneseq;