File indexing completed on 2025-01-30 09:59:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef BOOST_RANDOM_UNIFORM_REAL_HPP
0018 #define BOOST_RANDOM_UNIFORM_REAL_HPP
0019
0020 #include <boost/assert.hpp>
0021 #include <boost/config.hpp>
0022 #include <boost/limits.hpp>
0023 #include <boost/random/uniform_real_distribution.hpp>
0024
0025 namespace boost {
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 template<class RealType = double>
0036 class uniform_real : public random::uniform_real_distribution<RealType>
0037 {
0038 typedef random::uniform_real_distribution<RealType> base_type;
0039 public:
0040
0041 class param_type : public base_type::param_type
0042 {
0043 public:
0044 typedef uniform_real distribution_type;
0045
0046
0047
0048
0049
0050 explicit param_type(RealType min_arg = RealType(0.0),
0051 RealType max_arg = RealType(1.0))
0052 : base_type::param_type(min_arg, max_arg)
0053 {}
0054 };
0055
0056
0057
0058
0059
0060
0061
0062 explicit uniform_real(RealType min_arg = RealType(0.0),
0063 RealType max_arg = RealType(1.0))
0064 : base_type(min_arg, max_arg)
0065 {
0066 BOOST_ASSERT(min_arg < max_arg);
0067 }
0068
0069
0070 explicit uniform_real(const param_type& parm)
0071 : base_type(parm)
0072 {}
0073
0074
0075 param_type param() const { return param_type(this->a(), this->b()); }
0076
0077 void param(const param_type& parm) { this->base_type::param(parm); }
0078 };
0079
0080 }
0081
0082 #endif