MCKL
Monte Carlo Kernel Library
Public Member Functions | List of all members
mckl::GapTest< NTrialMax > Class Template Reference

Gap test. More...

#include <mckl/random/gap_test.hpp>

Inherits mckl::ChiSquaredTest< GapTest< NTrialMax > >.

Public Member Functions

 GapTest (std::size_t n, double alpha, double beta)
 Construct a Gap test. More...
 
double degree_of_freedom () const
 
template<typename DistributionType >
double operator() (DistributionType &&distribution)
 
template<typename RNGType , typename U01DistributionType >
double operator() (RNGType &rng, U01DistributionType &u01)
 
- Public Member Functions inherited from mckl::ChiSquaredTest< GapTest< NTrialMax > >
double cdf (result_type s) const
 
bool pass (double alpha, result_type s) const
 
double pdf (result_type s) const
 

Additional Inherited Members

- Public Types inherited from mckl::ChiSquaredTest< GapTest< NTrialMax > >
using result_type = double
 
- Protected Member Functions inherited from mckl::ChiSquaredTest< GapTest< NTrialMax > >
double stat (std::size_t m, const double *count, const double *np) const
 
double stat (std::size_t m, const double *count, double np) const
 

Detailed Description

template<std::size_t NTrialMax = std::numeric_limits<std::size_t>::max()>
class mckl::GapTest< NTrialMax >

Gap test.

Template Parameters
NTrialMaxThe maximum number of trials

Definition at line 45 of file gap_test.hpp.

Constructor & Destructor Documentation

◆ GapTest()

template<std::size_t NTrialMax = std::numeric_limits<std::size_t>::max()>
mckl::GapTest< NTrialMax >::GapTest ( std::size_t  n,
double  alpha,
double  beta 
)
inline

Construct a Gap test.

Parameters
nThe number of gaps if Cyclic is false, otherwise the number of standard uniform random numbers
alphaThe lower bound of the gap
betaThe upper bound of the gap

The Gap test may not terminate if the sequence is sufficient non-random. The test will be terminated if a gap with length larger than \(n\) is found. In this case, zero will be returned as the test statistic.

Definition at line 60 of file gap_test.hpp.

Member Function Documentation

◆ degree_of_freedom()

template<std::size_t NTrialMax = std::numeric_limits<std::size_t>::max()>
double mckl::GapTest< NTrialMax >::degree_of_freedom ( ) const
inline

Definition at line 120 of file gap_test.hpp.

◆ operator()() [1/2]

template<std::size_t NTrialMax = std::numeric_limits<std::size_t>::max()>
template<typename DistributionType >
double mckl::GapTest< NTrialMax >::operator() ( DistributionType &&  distribution)
inline

Definition at line 89 of file gap_test.hpp.

◆ operator()() [2/2]

template<std::size_t NTrialMax = std::numeric_limits<std::size_t>::max()>
template<typename RNGType , typename U01DistributionType >
double mckl::GapTest< NTrialMax >::operator() ( RNGType &  rng,
U01DistributionType &  u01 
)
inline

Definition at line 92 of file gap_test.hpp.