|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
SplitMix64_Rng against its reference, and Random_Source against the generators that it draws from. More...
#include <gtest/gtest.h>#include <ah-random.H>#include <ah_init_guard.H>#include <tpl_array.H>#include <tpl_dynSetTree.H>#include <algorithm>#include <cmath>#include <cstdint>#include <limits>#include <numeric>#include <optional>#include <random>#include <stdexcept>#include <thread>#include <type_traits>#include <utility>Go to the source code of this file.
Functions | |
| TEST (SplitMix64Rng, TheNumbersOfItsReference) | |
| TEST (SplitMix64Rng, TheNumberIsTheMixOfTheStateAdvancedByTheIncrement) | |
| TEST (SplitMix64Rng, IsAConstantExpression) | |
| TEST (SplitMix64Rng, TheDefaultSeedIsZero) | |
| TEST (SplitMix64Rng, SeedingAgainIsAsBuildingWithTheSeed) | |
| TEST (SplitMix64Rng, ACopyGoesOnWithTheSameNumbers) | |
| TEST (SplitMix64Rng, FeedsTheStandardLibrary) | |
| TEST (SplitMix64Rng, ItsBitsAreBalanced) | |
| TEST (RandomDetail, BoundedIsExactWithEveryBoundOfWordsOf8Bits) | |
| TEST (RandomDetail, BoundedIsExactWithWordsOf16Bits) | |
| TEST (RandomDetail, MaskedIsExactWithEveryBoundOfWordsOf8Bits) | |
| TEST (RandomDetail, MaskedIsExactWithWordsOf16Bits) | |
| TEST (RandomDetail, TheSeedsOfTheirOwnAreNumbersOfOneSplitMix64) | |
| TEST (RandomDetail, WhatSeedsTheSplitMix64OfTheProcessChangesWithTheClocks) | |
| TEST (RandomDetail, TheSplitMix64OfTheProcessDoesNotStartFromAFixedState) | |
| TEST (RandomSource, WhatCannotThrowIsNoexceptAndItIsNotCopied) | |
| TEST (RandomSource, ByDefaultItDrawsFromASplitMix64WithASeedOfItsOwn) | |
| TEST (RandomSource, EachOneBuiltByDefaultHasItsOwnNumbersFromEveryThread) | |
| TEST (RandomSource, TheFirstNumbersOfSourcesSeededAsByDefaultAreUniform) | |
| TEST (RandomSource, WithASeedAloneEveryDrawIsThatOfSplitMix64) | |
| TEST (RandomSource, WithTheMersenneTwisterEveryDrawIsThatOfGslCompatibleRng) | |
| TEST (RandomSource, TheNumbersOfTheMersenneTwisterAreThoseOfTheStandard) | |
| TEST (RandomSource, AnIntegerBelowABoundAboveThe32BitsIsANumberOf64BitsUnderAMask) | |
| TEST (RandomSource, TheIntegersBelowABoundAreUniform) | |
| TEST (RandomSource, TheRealsAreUniformInTheUnitInterval) | |
| TEST (RandomSource, AnIntegerBelowZeroValuesIsRejectedAndTakesNoNumber) | |
| TEST (RandomSource, TheIntegerBelowOneValueIsZero) | |
| TEST (RandomSource, ASeedOfTheMersenneTwisterGivesTheSameNumbersOnEveryPlatform) | |
| TEST (RandomSource, ASeedChoosesTheEngine) | |
| TEST (RandomSource, ItsMersenneTwisterIsSeededWithTheNextNumberOfItsSplitMix64) | |
| TEST (RandomSource, AMoveTakesTheGeneratorAndLeavesASplitMix64WithASeedOfItsOwn) | |
| TEST (RandomSource, AnAssignmentToItselfLeavesItAsItWas) | |
| TEST (RandomSource, ASwapExchangesTheGeneratorsWithTheirStates) | |
| TEST (RandomSource, TwoAreEqualWhenTheyGiveTheSameNumbersFromNowOn) | |
| TEST (RandomSource, FeedsTheStandardLibrary) | |
| TEST (RandomSource, ItsGslRngActsOnItsMersenneTwister) | |
SplitMix64_Rng against its reference, and Random_Source against the generators that it draws from.
The numbers of SplitMix64_Rng are compared with those that the SplittableRandom of Java, the implementation of its authors, gives for each seed. The draws of a Random_Source are compared with those of a twin generator: a Gsl_Compatible_Rng, which ah_random_test compares with GSL, or a SplitMix64_Rng through the method of each draw, written here as its definition and not as the header writes it. The two methods that give an integer below a bound are run with words of 8 and 16 bits on every number: each integer must come from as many numbers.
Definition in file random_source_test.cc.
| TEST | ( | RandomDetail | , |
| BoundedIsExactWithEveryBoundOfWordsOf8Bits | |||
| ) |
Definition at line 428 of file random_source_test.cc.
| TEST | ( | RandomDetail | , |
| BoundedIsExactWithWordsOf16Bits | |||
| ) |
Definition at line 434 of file random_source_test.cc.
| TEST | ( | RandomDetail | , |
| MaskedIsExactWithEveryBoundOfWordsOf8Bits | |||
| ) |
Definition at line 443 of file random_source_test.cc.
| TEST | ( | RandomDetail | , |
| MaskedIsExactWithWordsOf16Bits | |||
| ) |
Definition at line 449 of file random_source_test.cc.
| TEST | ( | RandomDetail | , |
| TheSeedsOfTheirOwnAreNumbersOfOneSplitMix64 | |||
| ) |
Definition at line 456 of file random_source_test.cc.
References Aleph::SplitMix64_Rng::increment, and Aleph::random_detail::seed_of_its_own().
| TEST | ( | RandomDetail | , |
| TheSplitMix64OfTheProcessDoesNotStartFromAFixedState | |||
| ) |
Definition at line 486 of file random_source_test.cc.
References Aleph::SplitMix64_Rng::increment, and Aleph::random_detail::seed_of_its_own().
| TEST | ( | RandomDetail | , |
| WhatSeedsTheSplitMix64OfTheProcessChangesWithTheClocks | |||
| ) |
Definition at line 475 of file random_source_test.cc.
References Aleph::and, and Aleph::random_detail::entropy_of_the_run().
| TEST | ( | RandomSource | , |
| AMoveTakesTheGeneratorAndLeavesASplitMix64WithASeedOfItsOwn | |||
| ) |
Definition at line 897 of file random_source_test.cc.
References Aleph::Random_Source::engine(), engine, Aleph::Random_Source::mersenne_twister(), and Aleph::Random_Source::uniform_int().
| TEST | ( | RandomSource | , |
| AnAssignmentToItselfLeavesItAsItWas | |||
| ) |
Definition at line 948 of file random_source_test.cc.
References engine.
| TEST | ( | RandomSource | , |
| AnIntegerBelowABoundAboveThe32BitsIsANumberOf64BitsUnderAMask | |||
| ) |
Definition at line 696 of file random_source_test.cc.
References k, seed, and Aleph::Random_Source::uniform_int_ne().
| TEST | ( | RandomSource | , |
| AnIntegerBelowZeroValuesIsRejectedAndTakesNoNumber | |||
| ) |
Definition at line 769 of file random_source_test.cc.
References engine, and Aleph::Random_Source::uniform_int().
| TEST | ( | RandomSource | , |
| ASeedChoosesTheEngine | |||
| ) |
Definition at line 828 of file random_source_test.cc.
References Aleph::Random_Source::engine(), Aleph::Random_Source::mersenne_twister(), Aleph::Random_Source::seed(), and seed.
| TEST | ( | RandomSource | , |
| ASeedOfTheMersenneTwisterGivesTheSameNumbersOnEveryPlatform | |||
| ) |
Definition at line 792 of file random_source_test.cc.
References Aleph::Random_Source::engine(), Aleph::Random_Source::mersenne_twister(), Aleph::Random_Source::seed(), and seed.
| TEST | ( | RandomSource | , |
| ASwapExchangesTheGeneratorsWithTheirStates | |||
| ) |
Definition at line 959 of file random_source_test.cc.
References Aleph::Random_Source::engine(), Aleph::Random_Source::swap(), Aleph::swap(), and Aleph::Random_Source::uniform().
| TEST | ( | RandomSource | , |
| ByDefaultItDrawsFromASplitMix64WithASeedOfItsOwn | |||
| ) |
Definition at line 530 of file random_source_test.cc.
References Aleph::Random_Source::engine(), Aleph::SplitMix64_Rng::increment, Aleph::next(), and seed.
| TEST | ( | RandomSource | , |
| EachOneBuiltByDefaultHasItsOwnNumbersFromEveryThread | |||
| ) |
Definition at line 554 of file random_source_test.cc.
References Aleph::each(), and Aleph::DynSetTree< Key, Tree, Compare >::insert().
| TEST | ( | RandomSource | , |
| FeedsTheStandardLibrary | |||
| ) |
Definition at line 1008 of file random_source_test.cc.
| TEST | ( | RandomSource | , |
| ItsGslRngActsOnItsMersenneTwister | |||
| ) |
Definition at line 1060 of file random_source_test.cc.
| TEST | ( | RandomSource | , |
| ItsMersenneTwisterIsSeededWithTheNextNumberOfItsSplitMix64 | |||
| ) |
Definition at line 866 of file random_source_test.cc.
References Aleph::Random_Source::engine(), Aleph::Random_Source::mersenne_twister(), Aleph::Gsl_Compatible_Rng::seed(), seed, Aleph::Random_Source::uniform_int(), and Aleph::Gsl_Compatible_Rng::uniform_int().
| TEST | ( | RandomSource | , |
| TheFirstNumbersOfSourcesSeededAsByDefaultAreUniform | |||
| ) |
Definition at line 587 of file random_source_test.cc.
| TEST | ( | RandomSource | , |
| TheIntegerBelowOneValueIsZero | |||
| ) |
Definition at line 779 of file random_source_test.cc.
References engine, Aleph::Random_Source::uniform_int(), and Aleph::Random_Source::uniform_int_ne().
| TEST | ( | RandomSource | , |
| TheIntegersBelowABoundAreUniform | |||
| ) |
Definition at line 720 of file random_source_test.cc.
References engine, and Aleph::Random_Source::uniform_int().
| TEST | ( | RandomSource | , |
| TheNumbersOfTheMersenneTwisterAreThoseOfTheStandard | |||
| ) |
Definition at line 685 of file random_source_test.cc.
| TEST | ( | RandomSource | , |
| TheRealsAreUniformInTheUnitInterval | |||
| ) |
Definition at line 746 of file random_source_test.cc.
References engine, and Aleph::Random_Source::uniform().
| TEST | ( | RandomSource | , |
| TwoAreEqualWhenTheyGiveTheSameNumbersFromNowOn | |||
| ) |
Definition at line 984 of file random_source_test.cc.
References engine.
| TEST | ( | RandomSource | , |
| WhatCannotThrowIsNoexceptAndItIsNotCopied | |||
| ) |
Definition at line 501 of file random_source_test.cc.
References Aleph::and, Aleph::Random_Source::engine(), Aleph::Random_Source::get(), Aleph::Random_Source::max(), Aleph::Random_Source::mersenne_twister(), Aleph::Random_Source::min(), Aleph::Random_Source::seed(), Aleph::Random_Source::swap(), Aleph::Random_Source::uniform(), Aleph::Random_Source::uniform_int(), and Aleph::Random_Source::uniform_int_ne().
| TEST | ( | RandomSource | , |
| WithASeedAloneEveryDrawIsThatOfSplitMix64 | |||
| ) |
Definition at line 608 of file random_source_test.cc.
References Aleph::Random_Source::engine(), Aleph::Random_Source::get(), seed, Aleph::Random_Source::uniform(), Aleph::Random_Source::uniform_int(), and Aleph::Random_Source::uniform_int_ne().
| TEST | ( | RandomSource | , |
| WithTheMersenneTwisterEveryDrawIsThatOfGslCompatibleRng | |||
| ) |
Definition at line 649 of file random_source_test.cc.
References Aleph::Random_Source::engine(), Aleph::Gsl_Compatible_Rng::get(), Aleph::Random_Source::get(), Aleph::Random_Source::mersenne_twister(), seed, Aleph::Gsl_Compatible_Rng::uniform(), Aleph::Random_Source::uniform(), Aleph::Random_Source::uniform_int(), Aleph::Gsl_Compatible_Rng::uniform_int(), and Aleph::Random_Source::uniform_int_ne().
| TEST | ( | SplitMix64Rng | , |
| ACopyGoesOnWithTheSameNumbers | |||
| ) |
Definition at line 372 of file random_source_test.cc.
| TEST | ( | SplitMix64Rng | , |
| FeedsTheStandardLibrary | |||
| ) |
Definition at line 387 of file random_source_test.cc.
References w.
| TEST | ( | SplitMix64Rng | , |
| IsAConstantExpression | |||
| ) |
Definition at line 330 of file random_source_test.cc.
References Aleph::and, Aleph::SplitMix64_Rng::default_seed, Aleph::SplitMix64_Rng::max(), Aleph::SplitMix64_Rng::min(), Aleph::SplitMix64_Rng::seed(), and seed.
| TEST | ( | SplitMix64Rng | , |
| ItsBitsAreBalanced | |||
| ) |
Definition at line 403 of file random_source_test.cc.
| TEST | ( | SplitMix64Rng | , |
| SeedingAgainIsAsBuildingWithTheSeed | |||
| ) |
Definition at line 357 of file random_source_test.cc.
References Aleph::SplitMix64_Rng::seed().
| TEST | ( | SplitMix64Rng | , |
| TheDefaultSeedIsZero | |||
| ) |
Definition at line 350 of file random_source_test.cc.
| TEST | ( | SplitMix64Rng | , |
| TheNumberIsTheMixOfTheStateAdvancedByTheIncrement | |||
| ) |
Definition at line 317 of file random_source_test.cc.
References Aleph::SplitMix64_Rng::increment, and Aleph::SplitMix64_Rng::mix().
| TEST | ( | SplitMix64Rng | , |
| TheNumbersOfItsReference | |||
| ) |
Definition at line 307 of file random_source_test.cc.