MCKL
Monte Carlo Kernel Library
Public Member Functions | List of all members
mckl::CollisionTest< D, T > Class Template Reference

Collision test. More...

#include <mckl/random/collision_test.hpp>

Inherits mckl::PoissonTest< CollisionTest< D, T > >.

Public Member Functions

 CollisionTest (std::size_t n)
 
double mean () const
 
template<typename DistributionType >
std::size_t operator() (DistributionType &&distribution)
 
template<typename RNGType , typename U01DistributionType >
std::size_t operator() (RNGType &rng, U01DistributionType &u01)
 
- Public Member Functions inherited from mckl::PoissonTest< CollisionTest< D, T > >
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::PoissonTest< CollisionTest< D, T > >
using result_type = std::size_t
 

Detailed Description

template<std::size_t D, std::size_t T>
class mckl::CollisionTest< D, T >

Collision test.

Template Parameters
DMultiplier
TLength of the tuple

The implementation use the Poisson distribution approximation instead of the exact computation. This makes it faster and more easier to conduct some second-level tests. The approximation is only appropriate if \(n\) is large and the number of categories \(D^T\) is even larger.

Definition at line 53 of file collision_test.hpp.

Constructor & Destructor Documentation

◆ CollisionTest()

template<std::size_t D, std::size_t T>
mckl::CollisionTest< D, T >::CollisionTest ( std::size_t  n)
inline

Definition at line 60 of file collision_test.hpp.

Member Function Documentation

◆ mean()

template<std::size_t D, std::size_t T>
double mckl::CollisionTest< D, T >::mean ( ) const
inline

Definition at line 87 of file collision_test.hpp.

◆ operator()() [1/2]

template<std::size_t D, std::size_t T>
template<typename DistributionType >
std::size_t mckl::CollisionTest< D, T >::operator() ( DistributionType &&  distribution)
inline

Definition at line 66 of file collision_test.hpp.

◆ operator()() [2/2]

template<std::size_t D, std::size_t T>
template<typename RNGType , typename U01DistributionType >
std::size_t mckl::CollisionTest< D, T >::operator() ( RNGType &  rng,
U01DistributionType &  u01 
)
inline

Definition at line 69 of file collision_test.hpp.