32 #ifndef MCKL_RANDOM_PERMUTATION_TEST_HPP 33 #define MCKL_RANDOM_PERMUTATION_TEST_HPP 44 template <std::
size_t T>
47 static_assert(T > 0,
"**PermutationTest** used with T equal to zero");
49 static_assert(T <= 20,
"**PermutationTest** used with T larger than 20");
59 template <
typename RNGType,
typename DistributionType>
60 double operator()(RNGType &rng, DistributionType &distribution)
62 std::array<typename DistributionType::result_type, T> r;
64 std::fill(count.begin(), count.end(), 0);
65 for (std::size_t i = 0; i != n_; ++i) {
66 rand(rng, distribution, T, r.data());
67 count[internal::permutation_index<T>(r.data())] += 1;
70 return this->
stat(M_, count.data(), np_);
76 static constexpr std::size_t M_ =
85 #endif // MCKL_RANDOM_PERMUTATION_TEST_HPP double stat(std::size_t m, const double *count, const double *np) const
std::vector< T, Alloc > Vector
std::vector with Allocator as the default allocator
#define MCKL_DEFINE_RANDOM_TEST_OPERATOR(ResultType)
double degree_of_freedom() const
void rand(RNGType &rng, ArcsineDistribution< RealType > &distribution, std::size_t N, RealType *r)
double operator()(RNGType &rng, DistributionType &distribution)
Tests based on the -distribution.
PermutationTest(std::size_t n)
Construct a Permutation test.