template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
rngtest::TestU01Props class

TestU01 properties used to initialize TestU01 tests.

This class is used to abstract away the initialization for TestU01 statistical tests. Needed because of the move semantics and variadic templates, since Charm++ chares do not support these yet. TestU01Props is therefore not a chare, but TestU01, initialized with a TestU01Props object, is. Note that TestU01Props still needs to be migratable, i.e., defines the pack/unpack operator, as it is an argument to chare TestU01's constructor. < Extra test runner argument types

Public types

using Xargs = std::tuple<Ts...>
Test extra arguments type.
using RunFn = std::vector<double>(*)(unif01_Gen*, Result*, const Xargs&)
Test runner function pointer type.
using ResultPtr = TestU01Ptr<Result, Deleter>
TestU01 results type with a custom deleter by TestU01.

Constructors, destructors, conversion operators

TestU01Props() explicit
Default constructor taking no arguments.
TestU01Props(Proxy& host, tk::ctr::RNGType rng, std::vector<std::string>&& n, unif01_Gen* gen, Ts&&... xargs) explicit
Initializer constructor.
TestU01Props(const TestU01Props& x)
Copy constructor: in terms of copy assignment.
TestU01Props(TestU01Props&&) defaulted
Move constructor.

Public functions

auto operator=(const TestU01Props& x) -> TestU01Props&
Copy assignment.
auto operator=(TestU01Props&&) -> TestU01Props& defaulted
Move assignment.
auto proxy() -> Proxy& noexcept
auto npval() const -> std::size_t
auto names() const -> std::vector<std::string>
auto run() -> std::vector<std::vector<std::string>>
Run test and return its status as a vector of vector of strings.
auto time() -> std::pair<std::string, tk::real>

Pack/Unpack: Serialize Term object for Charm++

void pup(PUP::er& p)
void operator|(PUP::er& p, TestU01Props& c)
Pack/Unpack serialize operator|.

Function documentation

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::TestU01Props() explicit

Default constructor taking no arguments.

Required as migratable. Called by Charm++. Initialize what we can.

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::TestU01Props(Proxy& host, tk::ctr::RNGType rng, std::vector<std::string>&& n, unif01_Gen* gen, Ts&&... xargs) explicit

Initializer constructor.

Parameters
host in Host proxy facilitating call-back to host object chare.
rng in Random number generator ID enum to be tested
in Vector of statisical test names (can be more than one associated with a given test, since a test can contain more than one statistical test evaluation, yielding multiple p-values)
gen in Raw function pointer to TestU01 statistical test
xargs in Extra arguments to test-run

None of the state data is const since the this class is designed to be migratable over the network by the Charm++ runtime system.

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
Proxy& rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::proxy() noexcept

Returns Host proxy

Host proxy accessor

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
std::size_t rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::npval() const

Returns Number of p-values this test yields

Number of results/test (i.e., p-values) accessor

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
std::vector<std::string> rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::names() const

Returns Vector of test names (there can be more than one)

Test name(s) accessor

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
std::vector<std::vector<std::string>> rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::run()

Run test and return its status as a vector of vector of strings.

The return type could potentially be a more specific type, e.g., a struct with fields RNGType, and a vector of strings for the p-values, and the names. Instead, we return a more generic vector of vector of strings type. This helps keeping the corresponding argument to Battery::evaluate() generic, which may come in handy when other test libraries are added in the future. The return value is thus the following in a vector of vectors:

  • 0: Name(s) of statistics (note that a test may produce more than one statistics and thus p-values)
  • 1: p-value strings: "pass" or "fail, p-value = ..." for all tests run (note that a test may produce more than one statistics and thus p-values)
  • 2: RNG name used to run the test: sub-vector length = 1

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
std::pair<std::string, tk::real> rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::time()

Returns Time it took to run the test with the associated RNG name

Test time accessor

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
void rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::pup(PUP::er& p)

Parameters
in/out Charm++'s PUP::er serializer object reference

Pack/Unpack serialize member function

template<class Test, class Proxy, class Result, Result*(*)(void) Creator, void(*)(Result*) Deleter, typename... Ts>
void rngtest::TestU01Props<Test, Proxy, Result, Creator, Deleter, Ts>::operator|(PUP::er& p, TestU01Props& c)

Pack/Unpack serialize operator|.

Parameters
in/out Charm++'s PUP::er serializer object reference
in/out TestU01Props object reference