rngtest::StatTest class

Random number generator statistical test.

This class uses runtime polymorphism without client-side inheritance: inheritance is confined to the internals of the this class, invisible to client-code. The class exclusively deals with ownership enabling client-side value semantics. Credit goes to Sean Parent at Adobe: https://github.com/sean-parent/sean-parent.github.com/wiki/ Papers-and-Presentations. For example client code that models a Battery, see rngtest::TestU01.

Constructors, destructors, conversion operators

template<typename T, typename... CtrArgs>
StatTest(std::function<T()> c][[maybe_unused], CtrArgs... args) explicit
Constructor taking a function pointer to a constructor of an object modeling Concept.
StatTest(const StatTest& x)
Copy constructor.
StatTest(StatTest&&) noexcept defaulted
Move constructor.

Public functions

void npval() const
Public interface to contribute number of results/test, i.e., p-values.
void names() const
Public interface to contribute test name(s)
void run() const
Public interface to running a test.
void time() const
Public interface to contributing a test's run time measured in seconds.
auto operator=(const StatTest& x) -> StatTest&
Copy assignment.
auto operator=(StatTest&&) noexcept -> StatTest& defaulted
Move assignment.

Function documentation

template<typename T, typename... CtrArgs>
rngtest::StatTest::StatTest(std::function<T()> c][[maybe_unused], CtrArgs... args) explicit

Constructor taking a function pointer to a constructor of an object modeling Concept.

Parameters
args in Constructor arguments

Passing std::function allows late execution of the constructor of T, i.e., at some future time, and thus usage from a factory. Note that the value of the first function argument, std::function<T()>, is not used here, but its constructor type, T, is used to enable the compiler to deduce the model constructor type, used to create its Charm proxy, defined by T::Proxy. The actual constructor of T is not called here but at some future time by the Charm++ runtime system, here only an asynchrounous ckNew() is called, i.e., a message (or request) for a future call to T's constructor. This overload can only be used for Charm++ chare objects defining typedef 'Proxy', which must define the Charm++ proxy. All optional constructor arguments are forwarded to ckNew() and thus to T's constructor. If it was somehow possible to obtain all bound arguments' types and values from an already-bound std::function, we could use those instead of having to explicitly forward the model constructor arguments via this host constructor.