vSMC
vSMC: Scalable Monte Carlo
Classes | Public Types | Public Member Functions | Friends | List of all members
vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > Class Template Reference

Uniform real distribution with variants open/closed variants. More...

#include <vsmc/rng/uniform_real_distribution.hpp>

Classes

struct  param_type
 

Public Types

typedef FPType result_type
 

Public Member Functions

 UniformRealDistribution (result_type a=0, result_type b=1)
 
 UniformRealDistribution (const param_type &param)
 
result_type a () const
 
result_type b () const
 
result_type max () const
 
result_type min () const
 
template<typename Eng >
result_type operator() (Eng &eng) const
 Generate uniform random variates. More...
 
param_type param () const
 
void param (const param_type &param)
 
void reset () const
 

Friends

bool operator!= (const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &runif1, const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &runif2)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &runif)
 
bool operator== (const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &runif1, const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &runif2)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &runif)
 

Detailed Description

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
class vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >

Uniform real distribution with variants open/closed variants.

This distribution is almost identical to C++11 std::uniform_real_distribution. But it differs in two important aspects

Definition at line 173 of file uniform_real_distribution.hpp.

Member Typedef Documentation

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
typedef FPType vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::result_type

Definition at line 177 of file uniform_real_distribution.hpp.

Constructor & Destructor Documentation

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::UniformRealDistribution ( result_type  a = 0,
result_type  b = 1 
)
inlineexplicit

Definition at line 248 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::UniformRealDistribution ( const param_type param)
inlineexplicit

Definition at line 252 of file uniform_real_distribution.hpp.

Member Function Documentation

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
result_type vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::a ( ) const
inline

Definition at line 266 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
result_type vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::b ( ) const
inline

Definition at line 267 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
result_type vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::max ( ) const
inline

Definition at line 269 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
result_type vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::min ( ) const
inline

Definition at line 268 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
template<typename Eng >
result_type vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::operator() ( Eng &  eng) const
inline

Generate uniform random variates.

Template Parameters
EngRequirement:
Eng::min() == 0 && (
Eng::max() == std::numeric_limits<uint32_t>::max() ||
Eng::max() == std::numeric_limits<uint64_t>::max()
)

Definition at line 281 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
param_type vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::param ( ) const
inline

Definition at line 256 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
void vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::param ( const param_type param)
inline

Definition at line 258 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
void vsmc::UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr >::reset ( ) const
inline

Definition at line 264 of file uniform_real_distribution.hpp.

Friends And Related Function Documentation

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
bool operator!= ( const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &  runif1,
const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &  runif2 
)
friend

Definition at line 301 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &  runif 
)
friend

Definition at line 309 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
bool operator== ( const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &  runif1,
const UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &  runif2 
)
friend

Definition at line 288 of file uniform_real_distribution.hpp.

template<typename FPType = double, typename Left = Closed, typename Right = Open, bool MinMaxIsConstexpr = false>
template<typename CharT , typename Traits >
std::basic_istream<CharT, Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
UniformRealDistribution< FPType, Left, Right, MinMaxIsConstexpr > &  runif 
)
friend

Definition at line 323 of file uniform_real_distribution.hpp.