MCKL
Monte Carlo Kernel Library
Modules | Classes | Typedefs | Functions
Random number generating

Random number generating engines and utilities. More...

Modules

 AES
 Random number generating using AES round function.
 
 Distribution
 Distribution random variates.
 
 Intel DRNG
 Random number generating using Intel RDRAND instructions.
 
 Intel Math Kernel Library
 Random number generating using MKL.
 
 Philox
 Random number generating using Random123 Philox algorithm.
 
 Randomness tests
 Testing randomness of standard uniform distribution.
 
 Threefry
 Random number generating using Random123 Threefry algorithm.
 
 U01
 Converting random integers to uniform floating points.
 

Classes

class  mckl::CounterEngine< ResultType, Generator >
 Counter based RNG engine. More...
 
class  mckl::RNGSetScalar< RNGType >
 Scalar RNG set. More...
 
class  mckl::RNGSetTBBEnumerable< RNGType, Alloc, ETSKeyType >
 Thread-local storage RNG set using tbb::enumerable_thread_specific. More...
 
class  mckl::RNGSetVector< RNGType >
 Vector RNG set. More...
 
class  mckl::RNGTraits< RNGType >
 Traits of RNG engines. More...
 
class  mckl::Seed< RNGType >
 RNG default seed generator. More...
 
class  mckl::SeedGenerator< ResultType, ID, Randomize, Atomic >
 Seed generator. More...
 
class  mckl::Skein< Generator >
 Skein hash function. More...
 

Typedefs

template<typename T , std::size_t K>
using mckl::Counter = typename internal::CounterImpl< T, K >::type
 A counter type with the same width as std::array<T, K> but with possibly fewer elements. More...
 
using mckl::RNG = ::mckl::ARS
 The default 32-bit RNG. More...
 
using mckl::RNG_64 = ::mckl::ARS_64
 The default 64-bit RNG. More...
 
template<typename RNGType = typename ::mckl::RNGSetTBB <>::rng_type>
using mckl::RNGSet = ::mckl::RNGSetTBB< RNGType >
 Default RNG set. More...
 
template<typename RNGType = RNG>
using mckl::RNGSetTBB = RNGSetTBBEnumerable< RNGType, ::tbb::cache_aligned_allocator< RNGType >, ::tbb::ets_no_key >
 Thread-local storage RNG set using tbb::enumerable_thread_specific without native TLS keys. More...
 
template<typename RNGType = RNG>
using mckl::RNGSetTBBKPI = RNGSetTBBEnumerable< RNGType, ::tbb::cache_aligned_allocator< RNGType >, ::tbb::ets_key_per_instance >
 Thread-local storage RNG set using tbb::enumerable_thread_specific with native TLS keys. More...
 
using mckl::Skein1024 = Skein< typename Threefish1024::generator_type >
 Skein-1024 hash function. More...
 
using mckl::Skein256 = Skein< typename Threefish256::generator_type >
 Skein-256 hash function. More...
 
using mckl::Skein512 = Skein< typename Threefish512::generator_type >
 Skein-512 hash function. More...
 

Functions

template<typename T , std::size_t K>
 mckl::__attribute__ ((always_inline, flatten)) inline void increment(std
 Increment a counter by one. More...
 
template<typename T , std::size_t K, T NSkip>
void mckl::increment (std::array< T, K > &ctr, std::integral_constant< T, NSkip >)
 Increment a counter by given steps. More...
 
template<typename T , std::size_t K>
void mckl::increment (std::array< T, K > &ctr, T nskip)
 Increment a counter by given steps. More...
 
template<typename T , std::size_t K, std::size_t Blocks>
void mckl::increment (std::array< T, K > &ctr, std::array< std::array< T, K >, Blocks > &ctr_block)
 Increment a counter by a given steps, and store each step in an array of counters. More...
 
template<typename RNGType >
RNGType::result_type mckl::rand (RNGType &rng)
 Generate random integers. More...
 
template<typename RNGType >
void mckl::rand (RNGType &rng, std::size_t n, typename RNGType::result_type *r)
 Generate random integers. More...
 
template<typename RNGType , typename DistributionType >
DistributionType::result_type mckl::rand (RNGType &rng, DistributionType &distribution)
 Generate distribution random variates. More...
 
template<typename RNGType , typename DistributionType >
void mckl::rand (RNGType &rng, DistributionType &distribution, std::size_t n, typename DistributionType::result_type *r)
 Generate distribution random variates. More...
 

Detailed Description

Random number generating engines and utilities.

Typedef Documentation

◆ Counter

template<typename T , std::size_t K>
using mckl::Counter = typedef typename internal::CounterImpl<T, K>::type

A counter type with the same width as std::array<T, K> but with possibly fewer elements.

Definition at line 104 of file increment.hpp.

◆ RNG

using mckl::RNG = typedef ::mckl::ARS

The default 32-bit RNG.

Definition at line 73 of file rng.hpp.

◆ RNG_64

using mckl::RNG_64 = typedef ::mckl::ARS_64

The default 64-bit RNG.

Definition at line 77 of file rng.hpp.

◆ RNGSet

template<typename RNGType = typename ::mckl::RNGSetTBB <>::rng_type>
using mckl::RNGSet = typedef ::mckl::RNGSetTBB <RNGType>

Default RNG set.

Definition at line 173 of file rng_set.hpp.

◆ RNGSetTBB

template<typename RNGType = RNG>
using mckl::RNGSetTBB = typedef RNGSetTBBEnumerable<RNGType, ::tbb::cache_aligned_allocator<RNGType>, ::tbb::ets_no_key>

Thread-local storage RNG set using tbb::enumerable_thread_specific without native TLS keys.

Definition at line 159 of file rng_set.hpp.

◆ RNGSetTBBKPI

template<typename RNGType = RNG>
using mckl::RNGSetTBBKPI = typedef RNGSetTBBEnumerable<RNGType, ::tbb::cache_aligned_allocator<RNGType>, ::tbb::ets_key_per_instance>

Thread-local storage RNG set using tbb::enumerable_thread_specific with native TLS keys.

Definition at line 166 of file rng_set.hpp.

◆ Skein1024

Skein-1024 hash function.

Definition at line 631 of file skein.hpp.

◆ Skein256

Skein-256 hash function.

Definition at line 623 of file skein.hpp.

◆ Skein512

Skein-512 hash function.

Definition at line 627 of file skein.hpp.

Function Documentation

◆ __attribute__()

template<typename T , std::size_t K>
mckl::__attribute__ ( (always_inline, flatten)  )

Increment a counter by one.

Definition at line 370 of file increment_generic.hpp.

◆ increment() [1/3]

template<typename T , std::size_t K, T NSkip>
void mckl::increment ( std::array< T, K > &  ctr,
std::integral_constant< T, NSkip >   
)
inline

Increment a counter by given steps.

Definition at line 196 of file increment_generic.hpp.

◆ increment() [2/3]

template<typename T , std::size_t K>
void mckl::increment ( std::array< T, K > &  ctr,
nskip 
)
inline

Increment a counter by given steps.

Definition at line 209 of file increment_generic.hpp.

◆ increment() [3/3]

template<typename T , std::size_t K, std::size_t Blocks>
void mckl::increment ( std::array< T, K > &  ctr,
std::array< std::array< T, K >, Blocks > &  ctr_block 
)
inline

Increment a counter by a given steps, and store each step in an array of counters.

Definition at line 379 of file increment_generic.hpp.

◆ rand() [1/4]

template<typename RNGType >
RNGType::result_type mckl::rand ( RNGType &  rng)
inline

Generate random integers.

Definition at line 969 of file random/internal/common.hpp.

◆ rand() [2/4]

template<typename RNGType >
void mckl::rand ( RNGType &  rng,
std::size_t  n,
typename RNGType::result_type *  r 
)
inline

Generate random integers.

Definition at line 977 of file random/internal/common.hpp.

◆ rand() [3/4]

template<typename RNGType , typename DistributionType >
DistributionType::result_type mckl::rand ( RNGType &  rng,
DistributionType &  distribution 
)
inline

Generate distribution random variates.

Definition at line 987 of file random/internal/common.hpp.

◆ rand() [4/4]

template<typename RNGType , typename DistributionType >
void mckl::rand ( RNGType &  rng,
DistributionType &  distribution,
std::size_t  n,
typename DistributionType::result_type *  r 
)
inline

Generate distribution random variates.

Definition at line 996 of file random/internal/common.hpp.