12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #ifndef BOOST_RANDOM_UNIFORM_REAL_HPP
- #define BOOST_RANDOM_UNIFORM_REAL_HPP
- #include <boost/assert.hpp>
- #include <boost/config.hpp>
- #include <boost/limits.hpp>
- #include <boost/random/uniform_real_distribution.hpp>
- namespace boost {
- template<class RealType = double>
- class uniform_real : public random::uniform_real_distribution<RealType>
- {
- typedef random::uniform_real_distribution<RealType> base_type;
- public:
- class param_type : public base_type::param_type
- {
- public:
- typedef uniform_real distribution_type;
-
- explicit param_type(RealType min_arg = RealType(0.0),
- RealType max_arg = RealType(1.0))
- : base_type::param_type(min_arg, max_arg)
- {}
- };
-
- explicit uniform_real(RealType min_arg = RealType(0.0),
- RealType max_arg = RealType(1.0))
- : base_type(min_arg, max_arg)
- {
- BOOST_ASSERT(min_arg < max_arg);
- }
-
- explicit uniform_real(const param_type& parm)
- : base_type(parm)
- {}
-
- param_type param() const { return param_type(this->a(), this->b()); }
-
- void param(const param_type& parm) { this->base_type::param(parm); }
- };
- }
- #endif
|