|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Gsl_Compatible_Rng against GSL, bit by bit, but for the reals of flat() and gaussian() where GSL fuses multiply-adds, and for those of gaussian() and exponential() where the logarithm of the tests is not that of GSL, as with MSVC and clang-cl; and against hashes of the draws of GSL, which stand for it where it is not (ALEPH_WITH_GSL is 0). More...
#include <gtest/gtest.h>#include <ah-random.H>#include <algorithm>#include <climits>#include <cmath>#include <cstdint>#include <cstring>#include <iomanip>#include <memory>#include <numeric>#include <random>#include <vector>Go to the source code of this file.
Functions | |
| TEST (GslCompatibleRng, TheDefaultSeedIsTheOneOfGsl) | |
| TEST (GslCompatibleRng, TheDrawsOfGslByTheirHashes) | |
| TEST (GslCompatibleRng, EveryDrawIsTheOneOfGsl) | |
| TEST (GslCompatibleRng, TheRealDrawsRoundEachProduct) | |
| TEST (GslCompatibleRng, SeedingAgainIsAsGslRngSet) | |
| TEST (GslCompatibleRng, TheNumbersOfTheStandard) | |
| TEST (GslCompatibleRng, TheNumbersAreThoseOfStdMt19937) | |
| TEST (GslCompatibleRng, UniformIntRejectsZeroAndTooLargeBounds) | |
| TEST (GslCompatibleRng, UniformIntIsItsDefinitionWhereTheQuotientReachesTheBound) | |
| TEST (GslCompatibleRng, UniformIntTakesAnotherNumberAfterTheBoundInANewState) | |
| TEST (GslCompatibleRng, RangesOfTheDraws) | |
| TEST (GslCompatibleRng, MomentsOfTheDistributions) | |
| TEST (GslCompatibleRng, ACopyGoesOnWithTheSameNumbers) | |
| TEST (GslCompatibleRng, FeedsTheStandardLibrary) | |
Gsl_Compatible_Rng against GSL, bit by bit, but for the reals of flat() and gaussian() where GSL fuses multiply-adds, and for those of gaussian() and exponential() where the logarithm of the tests is not that of GSL, as with MSVC and clang-cl; and against hashes of the draws of GSL, which stand for it where it is not (ALEPH_WITH_GSL is 0).
Each test seeds a Gsl_Compatible_Rng and a gsl_rng_mt19937 alike, and draws from both, in an order that another generator picks, so that a draw that took one number more or less from one of them would show in every later one.
Definition in file ah_random_test.cc.
| TEST | ( | GslCompatibleRng | , |
| ACopyGoesOnWithTheSameNumbers | |||
| ) |
Definition at line 545 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::uniform_int().
| TEST | ( | GslCompatibleRng | , |
| EveryDrawIsTheOneOfGsl | |||
| ) |
Definition at line 324 of file ah_random_test.cc.
| TEST | ( | GslCompatibleRng | , |
| FeedsTheStandardLibrary | |||
| ) |
Definition at line 560 of file ah_random_test.cc.
References w.
| TEST | ( | GslCompatibleRng | , |
| MomentsOfTheDistributions | |||
| ) |
Definition at line 520 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::exponential(), Aleph::Gsl_Compatible_Rng::flat(), Aleph::Gsl_Compatible_Rng::gaussian(), and Aleph::Gsl_Compatible_Rng::uniform_int().
| TEST | ( | GslCompatibleRng | , |
| RangesOfTheDraws | |||
| ) |
Definition at line 501 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::exponential(), Aleph::Gsl_Compatible_Rng::flat(), Aleph::Gsl_Compatible_Rng::uniform(), Aleph::Gsl_Compatible_Rng::uniform_int(), and Aleph::Gsl_Compatible_Rng::uniform_pos().
| TEST | ( | GslCompatibleRng | , |
| SeedingAgainIsAsGslRngSet | |||
| ) |
Definition at line 360 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::get(), r, and Aleph::Gsl_Compatible_Rng::seed().
| TEST | ( | GslCompatibleRng | , |
| TheDefaultSeedIsTheOneOfGsl | |||
| ) |
Definition at line 219 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::get(), Aleph::Gsl_Compatible_Rng::max(), Aleph::Gsl_Compatible_Rng::min(), and r.
| TEST | ( | GslCompatibleRng | , |
| TheDrawsOfGslByTheirHashes | |||
| ) |
Definition at line 237 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::get(), r, and seed.
| TEST | ( | GslCompatibleRng | , |
| TheNumbersAreThoseOfStdMt19937 | |||
| ) |
Definition at line 401 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::seed().
| TEST | ( | GslCompatibleRng | , |
| TheNumbersOfTheStandard | |||
| ) |
Definition at line 389 of file ah_random_test.cc.
| TEST | ( | GslCompatibleRng | , |
| TheRealDrawsRoundEachProduct | |||
| ) |
Definition at line 330 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::uniform(), Aleph::Gsl_Compatible_Rng::uniform_pos(), and y.
| TEST | ( | GslCompatibleRng | , |
| UniformIntIsItsDefinitionWhereTheQuotientReachesTheBound | |||
| ) |
Definition at line 445 of file ah_random_test.cc.
References Aleph::and, Aleph::Gsl_Compatible_Rng::get(), and k.
| TEST | ( | GslCompatibleRng | , |
| UniformIntRejectsZeroAndTooLargeBounds | |||
| ) |
Definition at line 427 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::max(), and Aleph::Gsl_Compatible_Rng::uniform_int().
| TEST | ( | GslCompatibleRng | , |
| UniformIntTakesAnotherNumberAfterTheBoundInANewState | |||
| ) |
Definition at line 474 of file ah_random_test.cc.
References Aleph::Gsl_Compatible_Rng::get(), seed, and Aleph::Gsl_Compatible_Rng::uniform_int_ne().