10 #define BOOST_TEST_MODULE NonRandomCounterTest
11 #include <boost/test/unit_test.hpp>
20 constexpr std::size_t
N = 1024U;
21 constexpr
long seed = 3U;
25 std::cout <<
"engine { " << seed <<
" }: ";
28 BOOST_CHECK_EQUAL(engine.name(),
"NonRandomCounter");
31 std::array<double, N> numbers;
32 engine.flatArray(numbers.size(), numbers.data());
33 std::cout <<
"\nengine.flatArray(" << numbers.size() <<
", "
34 << ((
void*) numbers.data()) <<
") => ";
37 for (std::size_t i = 1U; i <
N; ++i)
38 BOOST_CHECK_LT(numbers[i - 1U], numbers[i]);
41 engine.setSeed(seed, 0);
42 std::cout <<
"\nengine.setSeed(" << seed <<
") => ";
45 for (
double const expected: numbers)
46 BOOST_CHECK_EQUAL(engine.flat(), expected);
47 std::cout <<
"\nengine.flat() x " << numbers.size() <<
" => ";
51 engine.setSeeds(&seed, 1);
52 std::cout <<
"\nengine.setSeeds(" << ((
void*) &seed) <<
", 1) => ";
55 for (
double const expected: numbers)
56 BOOST_CHECK_EQUAL(engine.flat(), expected);
57 std::cout <<
"\nengine.flat() x " << numbers.size() <<
" => ";
Non-random number engine for profiling purposes.
Fast random engine which returns sequential numbers.
void Test(TFile *pFile=nullptr, bool statChecks=true)
process_name largeant stream1 can override from command line with o or output physics producers generator N
BEGIN_PROLOG could also be cout