vSMC  v3.0.0
Scalable Monte Carlo
Classes | Namespaces | Macros | Typedefs | Functions
rng/internal/common.hpp File Reference
#include <vsmc/internal/common.hpp>
#include <mkl_version.h>
#include <mkl_vsl.h>

Go to the source code of this file.

Classes

class  vsmc::BetaDistribution< RealType >
 Beta distribution. More...
 
class  vsmc::CauchyDistribution< RealType >
 Cauchy distribution. More...
 
class  vsmc::ChiSquaredDistribution< RealType >
 The \(\chi^2\) distribution. More...
 
class  vsmc::CounterEngine< ResultType, Generator >
 Counter based RNG engine. More...
 
class  vsmc::DiscreteDistribution< IntType >
 Draw a single sample given weights. More...
 
class  vsmc::ExponentialDistribution< RealType >
 Exponential distribution. More...
 
class  vsmc::ExtremeValueDistribution< RealType >
 Extreme value distribution. More...
 
class  vsmc::FisherFDistribution< RealType >
 Fisher-F distribution. More...
 
class  vsmc::GammaDistribution< RealType >
 Gamma distribution. More...
 
class  vsmc::internal::CtrTypeTrait< T >
 
class  vsmc::internal::CtrTypeTrait< T >
 
class  vsmc::internal::internal::CtrTypeDispatch< T, bool >
 
class  vsmc::internal::internal::CtrTypeDispatch< T, false >
 
class  vsmc::internal::internal::CtrTypeDispatch< T, true >
 
class  vsmc::internal::internal::HasCtrType< T >
 
class  vsmc::internal::internal::HasCtrTypeImpl< T >
 
class  vsmc::internal::internal::HasKeyType< T >
 
class  vsmc::internal::internal::HasKeyTypeImpl< T >
 
class  vsmc::internal::internal::KeyTypeDispatch< T, bool >
 
class  vsmc::internal::internal::KeyTypeDispatch< T, false >
 
class  vsmc::internal::internal::KeyTypeDispatch< T, true >
 
class  vsmc::internal::KeyTypeTrait< T >
 
class  vsmc::internal::KeyTypeTrait< T >
 
class  vsmc::LaplaceDistribution< RealType >
 Laplace distribution. More...
 
class  vsmc::LevyDistribution< RealType >
 Levy distribution. More...
 
class  vsmc::LogisticDistribution< RealType >
 Logistic distribution. More...
 
class  vsmc::LognormalDistribution< RealType >
 Lognormal distribution. More...
 
class  vsmc::MKLEngine< BRNG, Bits >
 MKL RNG C++11 engine. More...
 
class  vsmc::NormalDistribution< RealType >
 Normal distribution. More...
 
class  vsmc::NormalMVDistribution< RealType, Dim >
 Multivariate Normal distribution. More...
 
class  vsmc::NormalMVProposal< RealType, Dim >
 Multivariate Normal random walk proposal. More...
 
class  vsmc::NormalProposal< RealType >
 Normal random walk proposal. More...
 
class  vsmc::ParetoDistribution< RealType >
 Pareto distribution. More...
 
class  vsmc::RandomWalk< RealType, Dim >
 Random walk MCMC update. More...
 
class  vsmc::RandomWalkG< RealType, DimX, DimG >
 Random walk MCMC update with test function. More...
 
class  vsmc::RayleighDistribution< RealType >
 Rayleigh distribution. More...
 
class  vsmc::RNGTraits< RNGType >
 Traits of RNG engines. More...
 
class  vsmc::StudentTDistribution< RealType >
 Student-t distribution. More...
 
class  vsmc::U01Distribution< RealType >
 
class  vsmc::U01LRDistribution< typename, typename, typename >
 
class  vsmc::UniformBitsDistribution< UIntType >
 Uniform bits distribution. More...
 
class  vsmc::UniformRealDistribution< RealType >
 Uniform real distribution. More...
 
class  vsmc::WeibullDistribution< RealType >
 Weibull distribution. More...
 

Namespaces

 vsmc
 
 vsmc::internal
 
 vsmc::internal::internal
 

Macros

#define VSMC_DEFINE_RNG_DISTRIBUTION_0(Name, name, T, t, Type)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_1(Name, name, p1, v1)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_2(Name, name, p1, v1, p2, v2)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_3(Name, name, p1, v1, p2, v2, p3, v3)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_4( Name, name, p1, v1, p2, v2, p3, v3, p4, v4)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_0(Name, T)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_1(Name, p1, v1)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_2(Name, p1, v1, p2, v2)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_3( Name, p1, v1, p2, v2, p3, v3)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_4( Name, p1, v1, p2, v2, p3, v3, p4, v4)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_0(name)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_1(name, p1)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_2(name, p1, p2)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_3(name, p1, p2, p3)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_4(name, p1, p2, p3, p4)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_0
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_1(T1, m1)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_2(T1, m1, T2, m2)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_3(T1, m1, T2, m2, T3, m3)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_4(T1, m1, T2, m2, T3, m3, T4, m4)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_OPERATOR(Name, name)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_0(Name, T, t, Type)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_1(Name, name, p1, v1)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_2(Name, name, p1, v1, p2, v2)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_3( Name, name, p1, v1, p2, v2, p3, v3)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_4( Name, name, p1, v1, p2, v2, p3, v3, p4, v4)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_0(Name, name, T)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_1(Name, name, p1)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_2(Name, name, p1, p2)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_3(Name, name, p1, p2, p3)
 
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_4(Name, name, p1, p2, p3, p4)
 
#define VSMC_RUNTIME_ASSERT_RNG_DISTRIBUTION_PARAM(flag, Name)
 

Typedefs

template<typename T >
using vsmc::internal::CtrType = typename CtrTypeTrait< T >::type
 
template<typename T >
using vsmc::internal::KeyType = typename KeyTypeTrait< T >::type
 

Functions

template<typename RealType , typename RNGType >
void vsmc::beta_distribution (RNGType &rng, std::size_t n, RealType *r, RealType alpha, RealType beta)
 Generating Beta random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::beta_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::beta_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::cauchy_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generating Cauchy random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::cauchy_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::cauchy_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::chi_squared_distribution (RNGType &rng, std::size_t n, RealType *r, RealType df)
 Generating \(\chi^2\) random variates. More...
 
template<typename RealType , typename RNGType >
void vsmc::exponential_distribution (RNGType &rng, std::size_t N, RealType *r, RealType lambda)
 Generating exponential random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::exponential_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::exponential_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double)
 
template<typename RealType , typename RNGType >
void vsmc::extreme_value_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generating extreme value random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::extreme_value_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::extreme_value_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::fisher_f_distribution (RNGType &rng, std::size_t N, RealType *r, RealType m, RealType n)
 Generating Fisher-F random variates. More...
 
template<typename RealType , typename RNGType >
void vsmc::gamma_distribution (RNGType &rng, std::size_t n, RealType *r, RealType alpha, RealType beta)
 Generating gamma random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::gamma_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::gamma_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::laplace_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generating laplace random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::laplace_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::laplace_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::levy_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generating levy random variates. More...
 
template<typename RealType , typename RNGType >
void vsmc::logistic_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generating logistic random variates. More...
 
template<typename RealType , typename RNGType >
void vsmc::lognormal_distribution (RNGType &rng, std::size_t N, RealType *r, RealType m, RealType s)
 Generating lognormal random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::lognormal_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::lognormal_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::normal_distribution (RNGType &rng, std::size_t n, RealType *r, RealType mean, RealType stddev)
 Generating Normal random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::normal_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *r, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::normal_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *r, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::normal_mv_distribution (RNGType &rng, std::size_t n, RealType *r, std::size_t dim, const RealType *mean, const RealType *chol)
 Generating multivariate Normal random varaites. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::normal_mv_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, std::size_t, const float *, const float *)
 
template<MKL_INT BRNG, int Bits>
void vsmc::normal_mv_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, std::size_t, const double *, const double *)
 
template<typename RealType , typename RNGType >
void vsmc::pareto_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generating pareto random variates. More...
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &rng, ChiSquaredDistribution< RealType > &dist, std::size_t N, RealType *r)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &rng, ExponentialDistribution< RealType > &dist, std::size_t N, RealType *r)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &rng, CauchyDistribution< RealType > &dist, std::size_t N, RealType *r)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &rng, ExtremeValueDistribution< RealType > &dist, std::size_t N, RealType *r)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &rng, FisherFDistribution< RealType > &dist, std::size_t N, RealType *r)
 
template<typename ResultType , typename Generator >
void vsmc::rand (CounterEngine< ResultType, Generator > &rng, std::size_t n, ResultType *r)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &rng, GammaDistribution< RealType > &dist, std::size_t N, RealType *r)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &rng, BetaDistribution< RealType > &dist, std::size_t N, RealType *r)
 
template<typename RNGType >
void vsmc::rand (RNGType &rng, std::size_t n, typename RNGType::result_type *r)
 Generate random integers. More...
 
template<typename RNGType , typename DistributionType >
void vsmc::rand (RNGType &rng, const DistributionType &distribution, std::size_t n, typename DistributionType::result_type *r)
 Generate random distribution numbers. More...
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, DiscreteDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, LaplaceDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, LevyDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, LogisticDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, LognormalDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, NormalDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , std::size_t Dim, typename RNGType >
void vsmc::rand (RNGType &, NormalMVDistribution< RealType, Dim > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, ParetoDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, RayleighDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, StudentTDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, U01Distribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType , typename Lower , typename Upper >
void vsmc::rand (RNGType &, U01LRDistribution< RealType, Lower, Upper > &, std::size_t, RealType *)
 
template<typename UIntType , typename RNGType >
void vsmc::rand (RNGType &, UniformBitsDistribution< UIntType > &, std::size_t, UIntType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, UniformRealDistribution< RealType > &, std::size_t, RealType *)
 
template<typename RealType , typename RNGType >
void vsmc::rand (RNGType &, WeibullDistribution< RealType > &, std::size_t, RealType *)
 
template<MKL_INT BRNG, int Bits>
void vsmc::rand (MKLEngine< BRNG, Bits > &, std::size_t, typename MKLEngine< BRNG, Bits >::result_type *)
 
template<typename RealType , typename RNGType >
void vsmc::rayleigh_distribution (RNGType &rng, std::size_t N, RealType *r, RealType sigma)
 Generating rayleigh random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::rayleigh_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::rayleigh_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double)
 
template<typename RealType , typename RNGType >
void vsmc::student_t_distribution (RNGType &rng, std::size_t N, RealType *r, RealType n)
 Generating student-t random variates. More...
 
template<typename RealType , typename RNGType >
void vsmc::u01_distribution (RNGType &rng, std::size_t n, RealType *r)
 Generate standard uniform random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::u01_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *)
 
template<MKL_INT BRNG, int Bits>
void vsmc::u01_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *)
 
template<typename , typename , typename RealType , typename RNGType >
void vsmc::u01_lr_distribution (RNGType &, std::size_t, RealType *)
 
template<typename UIntType , typename RNGType >
void vsmc::uniform_bits_distribution (RNGType &, std::size_t, UIntType *)
 
template<typename RealType , typename RNGType >
void vsmc::uniform_real_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generate uniform real random variates with open/closed variants. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::uniform_real_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::uniform_real_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 
template<typename RealType , typename RNGType >
void vsmc::weibull_distribution (RNGType &rng, std::size_t N, RealType *r, RealType a, RealType b)
 Generating weibull random variates. More...
 
template<MKL_INT BRNG, int Bits>
void vsmc::weibull_distribution (MKLEngine< BRNG, Bits > &, std::size_t, float *, float, float)
 
template<MKL_INT BRNG, int Bits>
void vsmc::weibull_distribution (MKLEngine< BRNG, Bits > &, std::size_t, double *, double, double)
 

Macro Definition Documentation

#define VSMC_DEFINE_RNG_DISTRIBUTION_0 (   Name,
  name,
  T,
  t,
  Type 
)
Value:
VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_0(Name, T) \
VSMC_DEFINE_RNG_DISTRIBUTION_OPERATOR(Name, name)
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_0(Name, T, t, Type)

Definition at line 800 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_1 (   Name,
  name,
  p1,
  v1 
)
Value:
VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_1(Name, p1, v1) \
VSMC_DEFINE_RNG_DISTRIBUTION_OPERATOR(Name, name)
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_1(Name, name, p1, v1)

Definition at line 805 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_2 (   Name,
  name,
  p1,
  v1,
  p2,
  v2 
)
Value:
VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_2(Name, name, p1, v1, p2, v2) \
VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_2(Name, p1, v1, p2, v2) \
VSMC_DEFINE_RNG_DISTRIBUTION_OPERATOR(Name, name)
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_2(Name, name, p1, v1, p2, v2)

Definition at line 810 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_3 (   Name,
  name,
  p1,
  v1,
  p2,
  v2,
  p3,
  v3 
)
Value:
Name, name, p1, v1, p2, v2, p3, v3) \
VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_3(Name, p1, v1, p2, v2, p3, v3) \
VSMC_DEFINE_RNG_DISTRIBUTION_OPERATOR(Name, name)
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_3( Name, name, p1, v1, p2, v2, p3, v3)

Definition at line 815 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_4 (   Name,
  name,
  p1,
  v1,
  p2,
  v2,
  p3,
  v3,
  p4,
  v4 
)
Value:
Name, name, p1, v1, p2, v2, p3, v3, p4, v4) \
VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_3( \
Name, p1, v1, p2, v2, p3, v3, p4, v4) \
VSMC_DEFINE_RNG_DISTRIBUTION_OPERATOR(Name, name)
#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_4( Name, name, p1, v1, p2, v2, p3, v3, p4, v4)

Definition at line 821 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_0 (   Name,
 
)
Value:
public: \
using result_type = T; \
using distribution_type = Name##Distribution<T>; \
\
Name##Distribution() = default; \
explicit Name##Distribution(const param_type &) {}

Definition at line 435 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_1 (   Name,
  p1,
  v1 
)
Value:
public: \
using result_type = RealType; \
using distribution_type = Name##Distribution<RealType>; \
\
explicit Name##Distribution(result_type p1 = v1) : param_(p1) \
{ \
reset(); \
} \
\
explicit Name##Distribution(const param_type &param) : param_(param) \
{ \
reset(); \
} \
\
result_type p1() const { return param_.p1(); }

Definition at line 443 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_2 (   Name,
  p1,
  v1,
  p2,
  v2 
)
Value:
public: \
using result_type = RealType; \
using distribution_type = Name##Distribution<RealType>; \
\
explicit Name##Distribution(result_type p1 = v1, result_type p2 = v2) \
: param_(p1, p2) \
{ \
reset(); \
} \
\
explicit Name##Distribution(const param_type &param) : param_(param) \
{ \
reset(); \
} \
\
result_type p1() const { return param_.p1(); } \
result_type p2() const { return param_.p2(); }

Definition at line 460 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_3 (   Name,
  p1,
  v1,
  p2,
  v2,
  p3,
  v3 
)
Value:
public: \
using result_type = RealType; \
using distribution_type = Name##Distribution<RealType>; \
\
explicit Name##Distribution( \
result_type p1 = v1, result_type p2 = v2, result_type p3 = v3) \
: param_(p1, p2, p3) \
{ \
reset(); \
} \
\
explicit Name##Distribution(const param_type &param) : param_(param) \
{ \
reset(); \
} \
\
result_type p1() const { return param_.p1(); } \
result_type p2() const { return param_.p2(); } \
result_type p3() const { return param_.p3(); }

Definition at line 479 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_CONSTRUCTOR_4 (   Name,
  p1,
  v1,
  p2,
  v2,
  p3,
  v3,
  p4,
  v4 
)
Value:
public: \
using result_type = RealType; \
using distribution_type = Name##Distribution<RealType>; \
\
explicit Name##Distribution(result_type p1 = v1, result_type p2 = v2, \
result_type p3 = v3, result_type p4 = v4) \
: param_(p1, p2, p3, p4) \
{ \
reset(); \
} \
\
explicit Name##Distribution(const param_type &param) : param_(param) \
{ \
reset(); \
} \
\
result_type p1() const { return param_.p1(); } \
result_type p2() const { return param_.p2(); } \
result_type p3() const { return param_.p3(); } \
result_type p4() const { return param_.p4(); }

Definition at line 501 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_0 (   name)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t n, RealType *r) \
{ \
static_assert(std::is_floating_point<RealType>::value, \
"**" #name "_distribution** USED WITH RealType OTHER THAN " \
"FLOATING POINT TYPES"); \
\
const std::size_t K = internal::BufferSize<RealType>::value; \
const std::size_t M = n / K; \
const std::size_t L = n % K; \
for (std::size_t i = 0; i != M; ++i, r += K) \
internal::name##_distribution_impl<K>(rng, K, r); \
internal::name##_distribution_impl<K>(rng, L, r); \
}

Definition at line 829 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_1 (   name,
  p1 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution( \
RNGType &rng, std::size_t N, RealType *r, RealType p1) \
{ \
static_assert(std::is_floating_point<RealType>::value, \
"**" #name "_distribution** USED WITH RealType OTHER THAN " \
"FLOATING POINT TYPES"); \
\
const std::size_t K = internal::BufferSize<RealType>::value; \
const std::size_t M = N / K; \
const std::size_t L = N % K; \
for (std::size_t i = 0; i != M; ++i, r += K) \
internal::name##_distribution_impl<K>(rng, K, r, p1); \
internal::name##_distribution_impl<K>(rng, L, r, p1); \
}

Definition at line 845 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_2 (   name,
  p1,
  p2 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution( \
RNGType &rng, std::size_t N, RealType *r, RealType p1, RealType p2) \
{ \
static_assert(std::is_floating_point<RealType>::value, \
"**" #name "_distribution** USED WITH RealType OTHER THAN " \
"FLOATING POINT TYPES"); \
\
const std::size_t K = internal::BufferSize<RealType>::value; \
const std::size_t M = N / K; \
const std::size_t L = N % K; \
for (std::size_t i = 0; i != M; ++i, r += K) \
internal::name##_distribution_impl<K>(rng, K, r, p1, p2); \
internal::name##_distribution_impl<K>(rng, L, r, p1, p2); \
}

Definition at line 862 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_3 (   name,
  p1,
  p2,
  p3 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t N, RealType *r, \
RealType p1, RealType p2, RealType p3) \
{ \
static_assert(std::is_floating_point<RealType>::value, \
"**" #name "_distribution** USED WITH RealType OTHER THAN " \
"FLOATING POINT TYPES"); \
\
const std::size_t K = internal::BufferSize<RealType>::value; \
const std::size_t M = N / K; \
const std::size_t L = N % K; \
for (std::size_t i = 0; i != M; ++i, r += K) \
internal::name##_distribution_impl<K>(rng, K, r, p1, p2, p3); \
internal::name##_distribution_impl<K>(rng, L, r, p1, p2, p3); \
}

Definition at line 879 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_4 (   name,
  p1,
  p2,
  p3,
  p4 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t N, RealType *r, \
RealType p1, RealType p2, RealType p3, RealType p4) \
{ \
static_assert(std::is_floating_point<RealType>::value, \
"**" #name "_distribution** USED WITH RealType OTHER THAN " \
"FLOATING POINT TYPES"); \
\
const std::size_t K = internal::BufferSize<RealType>::value; \
const std::size_t M = N / K; \
const std::size_t L = N % K; \
for (std::size_t i = 0; i != M; ++i, r += K) \
internal::name##_distribution_impl<K>(rng, K, r, p1, p2, p3, p4); \
internal::name##_distribution_impl<K>(rng, L, r, p1, p2, p3, p4); \
}

Definition at line 896 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_0
Value:
private: \
bool is_equal(const distribution_type &) const { return true; } \
\
template <typename CharT, typename Traits> \
void ostream(std::basic_ostream<CharT, Traits> &) const \
{ \
} \
\
template <typename CharT, typename Traits> \
void istream(std::basic_istream<CharT, Traits> &) \
{ \
}
std::basic_ostream< CharT, Traits > & ostream(std::basic_ostream< CharT, Traits > &os, const std::array< T, N > &ary)
Definition: basic.hpp:215
bool is_equal(const T &a, const T &b, std::true_type)
Definition: basic.hpp:83
std::basic_istream< CharT, Traits > & istream(std::basic_istream< CharT, Traits > &is, std::array< T, N > &ary)
Definition: basic.hpp:243

Definition at line 612 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_1 (   T1,
  m1 
)

Definition at line 626 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_2 (   T1,
  m1,
  T2,
  m2 
)

Definition at line 659 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_3 (   T1,
  m1,
  T2,
  m2,
  T3,
  m3 
)

Definition at line 699 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_4 (   T1,
  m1,
  T2,
  m2,
  T3,
  m3,
  T4,
  m4 
)

Definition at line 746 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_OPERATOR (   Name,
  name 
)

Definition at line 524 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_0 (   Name,
  T,
  t,
  Type 
)

Definition at line 46 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_1 (   Name,
  name,
  p1,
  v1 
)

Definition at line 86 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_2 (   Name,
  name,
  p1,
  v1,
  p2,
  v2 
)

Definition at line 159 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_3 (   Name,
  name,
  p1,
  v1,
  p2,
  v2,
  p3,
  v3 
)

Definition at line 241 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_PARAM_TYPE_4 (   Name,
  name,
  p1,
  v1,
  p2,
  v2,
  p3,
  v3,
  p4,
  v4 
)

Definition at line 333 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_0 (   Name,
  name,
 
)
Value:
template <typename T, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t N, T *r, \
const typename Name##Distribution<T>::param_type &) \
{ \
name##_distribution(rng, N, r); \
} \
\
template <typename T, typename RNGType> \
inline void rand( \
RNGType &rng, Name##Distribution<T> &dist, std::size_t N, T *r) \
{ \
dist(rng, N, r); \
}
void rand(MKLEngine< BRNG, Bits > &, std::size_t, typename MKLEngine< BRNG, Bits >::result_type *)
Definition: mkl.hpp:1133

Definition at line 913 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_1 (   Name,
  name,
  p1 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t N, RealType *r, \
const typename Name##Distribution<RealType>::param_type &param) \
{ \
name##_distribution(rng, N, r, param.p1()); \
} \
\
template <typename RealType, typename RNGType> \
inline void rand(RNGType &rng, Name##Distribution<RealType> &dist, \
std::size_t N, RealType *r) \
{ \
dist(rng, N, r); \
}
void rand(MKLEngine< BRNG, Bits > &, std::size_t, typename MKLEngine< BRNG, Bits >::result_type *)
Definition: mkl.hpp:1133

Definition at line 928 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_2 (   Name,
  name,
  p1,
  p2 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t N, RealType *r, \
const typename Name##Distribution<RealType>::param_type &param) \
{ \
name##_distribution(rng, N, r, param.p1(), param.p2()); \
} \
\
template <typename RealType, typename RNGType> \
inline void rand(RNGType &rng, Name##Distribution<RealType> &dist, \
std::size_t N, RealType *r) \
{ \
dist(rng, N, r); \
}
void rand(MKLEngine< BRNG, Bits > &, std::size_t, typename MKLEngine< BRNG, Bits >::result_type *)
Definition: mkl.hpp:1133

Definition at line 943 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_3 (   Name,
  name,
  p1,
  p2,
  p3 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t N, RealType *r, \
const typename Name##Distribution<RealType>::param_type &param) \
{ \
name##_distribution(rng, N, r, param.p1(), param.p2(), param.p3()); \
} \
\
template <typename RealType, typename RNGType> \
inline void rand(RNGType &rng, Name##Distribution<RealType> &dist, \
std::size_t N, RealType *r) \
{ \
dist(rng, N, r); \
}
void rand(MKLEngine< BRNG, Bits > &, std::size_t, typename MKLEngine< BRNG, Bits >::result_type *)
Definition: mkl.hpp:1133

Definition at line 958 of file rng/internal/common.hpp.

#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_4 (   Name,
  name,
  p1,
  p2,
  p3,
  p4 
)
Value:
template <typename RealType, typename RNGType> \
inline void name##_distribution(RNGType &rng, std::size_t N, RealType *r, \
const typename Name##Distribution<RealType>::param_type &param) \
{ \
name##_distribution( \
rng, N, r, param.p1(), param.p2(), param.p3, p4()); \
} \
\
template <typename RealType, typename RNGType> \
inline void rand(RNGType &rng, Name##Distribution<RealType> &dist, \
std::size_t N, RealType *r) \
{ \
dist(rng, N, r); \
}
void rand(MKLEngine< BRNG, Bits > &, std::size_t, typename MKLEngine< BRNG, Bits >::result_type *)
Definition: mkl.hpp:1133

Definition at line 973 of file rng/internal/common.hpp.

#define VSMC_RUNTIME_ASSERT_RNG_DISTRIBUTION_PARAM (   flag,
  Name 
)
Value:
"**" #Name "Distribution** CONSTRUCTED WITH INVALID PARAMETERS")
#define VSMC_RUNTIME_ASSERT(cond, msg)
Definition: assert.hpp:59

Definition at line 42 of file rng/internal/common.hpp.