pcg-cpp
pcg-cpp copied to clipboard
Inconsistent generator naming
While investigating the source code, I've found several generators with the inconsistent names.
In file pcg_random.hpp on line 1724
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;
pcg32_k64_oneseq
is based on the mcg
, and pcg32_k64_fast
is based on the oneseq
generator.
But on line 1732
typedef pcg_engines::ext_setseq_xsl_rr_128_64<5,16,true> pcg64_k32;
typedef pcg_engines::ext_oneseq_xsl_rr_128_64<5,128,true> pcg64_k32_oneseq;
typedef pcg_engines::ext_mcg_xsl_rr_128_64<5,128,true> pcg64_k32_fast;
pcg64_k32_oneseq
is based on the oneseq
generator, and pcg64_k32_fast
is based on the mcg
.
After further investigation, I discovered the following. The base generator are declared as follows (line 1686)
typedef pcg_engines::setseq_xsh_rr_64_32 pcg32;
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;
Where pcg32_oneseq
is based on oneseq
generator and pcg32_fast
is based on mcg
generator.
But multiple extended fast generators (pcg32_k2_fast
, pcg32_k64_fast
, pcg32_k1024_fast
, pcg32_c1024_fast
, pcg64_k1024_fast
, pcg64_c1024_fast
, pcg32_k16384_fast
) are based on oneseq
generator while other fast generators (pcg32_c64_fast
, pcg64_k32_fast
, pcg64_c32_fast
) are based on mcg
.