vSMC
vSMC: Scalable Monte Carlo
Classes | Namespaces | Macros | Typedefs | Functions
xorshift.hpp File Reference
#include <vsmc/rng/internal/common.hpp>

Go to the source code of this file.

Classes

struct  vsmc::internal::XorshiftIndex< ResultType, K, R, S, bool >
 
struct  vsmc::internal::XorshiftIndex< ResultType, K, R, S, false >
 
struct  vsmc::internal::XorshiftLeft< bool, ResultType, unsigned >
 
struct  vsmc::internal::XorshiftLeft< true, ResultType, A >
 
struct  vsmc::internal::XorshiftRight< bool, ResultType, unsigned >
 
struct  vsmc::internal::XorshiftRight< true, ResultType, A >
 
struct  vsmc::traits::XorshiftEngineTrait< ResultType >
 Traits of XorshiftEngine. More...
 
class  vsmc::XorshiftEngine< ResultType, K, A, B, C, D, R, S >
 Xorshift RNG engine. More...
 
class  vsmc::XorwowEngine< Eng, D, DInit >
 Xorwow RNG engine. More...
 

Namespaces

 vsmc
 
 vsmc::internal
 
 vsmc::traits
 

Macros

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_INDEX(I, K)
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_INDEX_ORDER(R, S, K)
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_ORDER(K)   VSMC_STATIC_ASSERT((K != 0), USE_XorshiftEngine_WITH_ORDER_EUQAL_TO_ZERO)
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS(A)
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS_C(C, K)
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS_D(D, K)
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_UINT_SIZE(ResultType)
 
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_UNSIGNED(ResultType)
 

Typedefs

typedef Xorshift128x32 vsmc::Xorshift
 The default 32-bits Xorshift RNG engine. More...
 
typedef XorshiftEngine< uint32_t, 128, 17, 12, 13, 15, 128, 95 > vsmc::Xorshift128x32
 Xorshift RNG engine generating \(2^{4096}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint32_t, 16, 17, 15, 13, 14, 16, 1 > vsmc::Xorshift16x32
 Xorshift RNG engine generating \(2^{512}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint64_t, 16, 34, 29, 25, 31, 16, 7 > vsmc::Xorshift16x64
 Xorshift RNG engine generating \(2^{1024}-1\) 64-bits integers. More...
 
typedef XorshiftEngine< uint32_t, 1, 13, 17, 5, 0, 0, 0 > vsmc::Xorshift1x32
 Xorshift RNG engine generating \(2^{32}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint64_t, 1, 13, 7, 17, 0, 0, 0 > vsmc::Xorshift1x64
 Xorshift RNG engine generating \(2^{64}-1\) 64-bits integers. More...
 
typedef XorshiftEngine< uint32_t, 2, 17, 14, 12, 19, 2, 1 > vsmc::Xorshift2x32
 Xorshift RNG engine generating \(2^{64}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint64_t, 2, 33, 31, 28, 29, 2, 1 > vsmc::Xorshift2x64
 Xorshift RNG engine generating \(2^{128}-1\) 64-bits integers. More...
 
typedef XorshiftEngine< uint32_t, 32, 19, 11, 13, 16, 32, 15 > vsmc::Xorshift32x32
 Xorshift RNG engine generating \(2^{1024}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint64_t, 32, 35, 27, 26, 37, 32, 1 > vsmc::Xorshift32x64
 Xorshift RNG engine generating \(2^{2048}-1\) 64-bits integers. More...
 
typedef XorshiftEngine< uint32_t, 4, 15, 14, 12, 17, 4, 3 > vsmc::Xorshift4x32
 Xorshift RNG engine generating \(2^{128}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint64_t, 4, 37, 27, 29, 33, 4, 3 > vsmc::Xorshift4x64
 Xorshift RNG engine generating \(2^{256}-1\) 64-bits integers. More...
 
typedef XorshiftEngine< uint32_t, 64, 19, 12, 14, 15, 64, 59 > vsmc::Xorshift64x32
 Xorshift RNG engine generating \(2^{2048}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint64_t, 64, 33, 26, 27, 29, 64, 53 > vsmc::Xorshift64x64
 Xorshift RNG engine generating \(2^{4096}-1\) 64-bits integers. More...
 
typedef XorshiftEngine< uint32_t, 8, 18, 13, 14, 15, 8, 3 > vsmc::Xorshift8x32
 Xorshift RNG engine generating \(2^{256}-1\) 32-bits integers. More...
 
typedef XorshiftEngine< uint64_t, 8, 37, 26, 29, 34, 8, 1 > vsmc::Xorshift8x64
 Xorshift RNG engine generating \(2^{512}-1\) 64-bits integers. More...
 
typedef Xorshift64x64 vsmc::Xorshift_64
 The default 64-bits Xorshift RNG engine. More...
 
typedef Xorwow128x32 vsmc::Xorwow
 The default 32-bits Xorwow RNG engine. More...
 
typedef XorwowEngine< Xorshift128x32 > vsmc::Xorwow128x32
 Xorwow RNG engine using Xorshfit \(2^{4096}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift16x32 > vsmc::Xorwow16x32
 Xorwow RNG engine using Xorshfit \(2^{512}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift16x64 > vsmc::Xorwow16x64
 Xorwow RNG engine using Xorshfit \(2^{1024}-1\) 64-bits integers. More...
 
typedef XorwowEngine< Xorshift1x32 > vsmc::Xorwow1x32
 Xorwow RNG engine using Xorshfit \(2^{32}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift1x64 > vsmc::Xorwow1x64
 Xorwow RNG engine using Xorshfit \(2^{64}-1\) 64-bits integers. More...
 
typedef XorwowEngine< Xorshift2x32 > vsmc::Xorwow2x32
 Xorwow RNG engine using Xorshfit \(2^{64}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift2x64 > vsmc::Xorwow2x64
 Xorwow RNG engine using Xorshfit \(2^{128}-1\) 64-bits integers. More...
 
typedef XorwowEngine< Xorshift32x32 > vsmc::Xorwow32x32
 Xorwow RNG engine using Xorshfit \(2^{1024}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift32x64 > vsmc::Xorwow32x64
 Xorwow RNG engine using Xorshfit \(2^{2048}-1\) 64-bits integers. More...
 
typedef XorwowEngine< Xorshift4x32 > vsmc::Xorwow4x32
 Xorwow RNG engine using Xorshfit \(2^{128}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift4x64 > vsmc::Xorwow4x64
 Xorwow RNG engine using Xorshfit \(2^{256}-1\) 64-bits integers. More...
 
typedef XorwowEngine< Xorshift64x32 > vsmc::Xorwow64x32
 Xorwow RNG engine using Xorshfit \(2^{2048}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift64x64 > vsmc::Xorwow64x64
 Xorwow RNG engine using Xorshfit \(2^{4096}-1\) 64-bits integers. More...
 
typedef XorwowEngine< Xorshift8x32 > vsmc::Xorwow8x32
 Xorwow RNG engine using Xorshfit \(2^{256}-1\) 32-bits integers. More...
 
typedef XorwowEngine< Xorshift8x64 > vsmc::Xorwow8x64
 Xorwow RNG engine using Xorshfit \(2^{512}-1\) 64-bits integers. More...
 
typedef Xorwow64x64 vsmc::Xorwow_64
 The default 64-bits Xorwow RNG engine. More...
 

Functions

template<unsigned A, unsigned B, unsigned C, unsigned , typename ResultType , std::size_t R, std::size_t S>
ResultType vsmc::internal::xorshift (Array< ResultType, 1 > &state, XorshiftIndex< ResultType, 1, R, S > &)
 
template<unsigned A, unsigned B, unsigned C, unsigned D, typename ResultType , std::size_t K, std::size_t R, std::size_t S>
ResultType vsmc::internal::xorshift (Array< ResultType, K > &state, XorshiftIndex< ResultType, K, R, S > &index)
 

Macro Definition Documentation

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT
Value:
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS(A)
Definition: xorshift.hpp:56
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS_D(D, K)
Definition: xorshift.hpp:64
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_INDEX_ORDER(R, S, K)
Definition: xorshift.hpp:52
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_ORDER(K)
Definition: xorshift.hpp:37
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_UNSIGNED(ResultType)
Definition: xorshift.hpp:40
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS_C(C, K)
Definition: xorshift.hpp:60
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_INDEX(I, K)
Definition: xorshift.hpp:48
#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_UINT_SIZE(ResultType)
Definition: xorshift.hpp:44

Definition at line 68 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_INDEX (   I,
 
)
Value:
VSMC_STATIC_ASSERT((I != 0 || K == 1), \
USE_XorshiftEngine_WITH_INDEX_##I##_EQUAL_TO_ZERO)
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 48 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_INDEX_ORDER (   R,
  S,
 
)
Value:
VSMC_STATIC_ASSERT((R > S || K == 1), \
USE_XorshiftEngine_WITH_INDEX_##R##_NOT_LARGER_THAN_##S)
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 52 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_ORDER (   K)    VSMC_STATIC_ASSERT((K != 0), USE_XorshiftEngine_WITH_ORDER_EUQAL_TO_ZERO)

Definition at line 37 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS (   A)
Value:
VSMC_STATIC_ASSERT((A != 0), \
USE_XorshiftEngine_WITH_SHIFT_BITS_##A##_EQUAL_TO_ZERO);
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 56 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS_C (   C,
 
)
Value:
VSMC_STATIC_ASSERT((C != 0 || K != 1), \
USE_XorshiftEngine_WITH_SHIFT_BITS_##C##_EQUAL_TO_ZERO);
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 60 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_SHIFT_BITS_D (   D,
 
)
Value:
VSMC_STATIC_ASSERT((D != 0 || K == 1), \
USE_XorshiftEngine_WITH_SHIFT_BITS_##A##_EQUAL_TO_ZERO);
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 64 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_UINT_SIZE (   ResultType)
Value:
VSMC_STATIC_ASSERT((sizeof(ResultType) >= sizeof(uint32_t)), \
USE_XorshiftEngine_WITH_A_ResultType_SMALLER_THAN_32_BITS)
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 44 of file xorshift.hpp.

#define VSMC_STATIC_ASSERT_RNG_XORSHIFT_UNSIGNED (   ResultType)
Value:
VSMC_STATIC_ASSERT((cxx11::is_unsigned<ResultType>::value), \
USE_XorshiftEngine_WITH_A_ResultType_NOT_AN_UNSIGNED_INTEGER_TYPE)
#define VSMC_STATIC_ASSERT(cond, msg)
Definition: assert.hpp:46

Definition at line 40 of file xorshift.hpp.