/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2018, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
TEST(UniformIntDistributionTest, Output)
{
- gmx::test::TestReferenceData data;
- gmx::test::TestReferenceChecker checker(data.rootChecker());
+ gmx::test::TestReferenceData data;
+ gmx::test::TestReferenceChecker checker(data.rootChecker());
- gmx::ThreeFry2x64<8> rng(123456, gmx::RandomDomain::Other);
- gmx::UniformIntDistribution<int> dist(1, 1000);
- std::vector<int> result;
+ gmx::ThreeFry2x64<8> rng(123456, gmx::RandomDomain::Other);
+ gmx::UniformIntDistribution<int> dist(1, 1000);
+ std::vector<int> result;
result.reserve(10);
for (int i = 0; i < 10; i++)
TEST(UniformIntDistributionTest, Logical)
{
- gmx::ThreeFry2x64<8> rng(123456, gmx::RandomDomain::Other);
- gmx::UniformIntDistribution<int> distA(2, 5);
- gmx::UniformIntDistribution<int> distB(2, 5);
- gmx::UniformIntDistribution<int> distC(3, 5);
- gmx::UniformIntDistribution<int> distD(2, 4);
+ gmx::ThreeFry2x64<8> rng(123456, gmx::RandomDomain::Other);
+ gmx::UniformIntDistribution<int> distA(2, 5);
+ gmx::UniformIntDistribution<int> distB(2, 5);
+ gmx::UniformIntDistribution<int> distC(3, 5);
+ gmx::UniformIntDistribution<int> distD(2, 4);
EXPECT_EQ(distA, distB);
EXPECT_NE(distA, distC);
TEST(UniformIntDistributionTest, Reset)
{
- gmx::ThreeFry2x64<8> rng(123456, gmx::RandomDomain::Other);
- gmx::UniformIntDistribution<int> distA(2, 5);
- gmx::UniformIntDistribution<int> distB(2, 5);
- gmx::UniformIntDistribution<>::result_type valA, valB;
+ gmx::ThreeFry2x64<8> rng(123456, gmx::RandomDomain::Other);
+ gmx::UniformIntDistribution<int> distA(2, 5);
+ gmx::UniformIntDistribution<int> distB(2, 5);
+ gmx::UniformIntDistribution<>::result_type valA, valB;
valA = distA(rng);
TEST(UniformIntDistributionTest, AltParam)
{
- gmx::ThreeFry2x64<8> rngA(123456, gmx::RandomDomain::Other);
- gmx::ThreeFry2x64<8> rngB(123456, gmx::RandomDomain::Other);
- gmx::UniformIntDistribution<int> distA(2, 5);
- gmx::UniformIntDistribution<int> distB; // default parameters
- gmx::UniformIntDistribution<int>::param_type paramA(2, 5);
+ gmx::ThreeFry2x64<8> rngA(123456, gmx::RandomDomain::Other);
+ gmx::ThreeFry2x64<8> rngB(123456, gmx::RandomDomain::Other);
+ gmx::UniformIntDistribution<int> distA(2, 5);
+ gmx::UniformIntDistribution<int> distB; // default parameters
+ gmx::UniformIntDistribution<int>::param_type paramA(2, 5);
EXPECT_NE(distA(rngA), distB(rngB));
rngA.restart();
}
-} // namespace
+} // namespace
-} // namespace gmx
+} // namespace gmx