- template<class Engine>
- result_type operator()(Engine& eng) {
- result_type numerator = static_cast<result_type>(eng() - eng.min BOOST_PREVENT_MACRO_SUBSTITUTION());
- result_type divisor = static_cast<result_type>(eng.max BOOST_PREVENT_MACRO_SUBSTITUTION() - eng.min BOOST_PREVENT_MACRO_SUBSTITUTION());
- assert(divisor > 0);
- assert(numerator >= 0 && numerator <= divisor);
- return numerator / divisor * (_max - _min) + _min;
- }
-
-#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
- template<class CharT, class Traits>
- friend std::basic_ostream<CharT,Traits>&
- operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_real& ud)
- {
- os << ud._min << " " << ud._max;
- return os;
- }
-
- template<class CharT, class Traits>
- friend std::basic_istream<CharT,Traits>&
- operator>>(std::basic_istream<CharT,Traits>& is, uniform_real& ud)
- {
- is >> std::ws >> ud._min >> std::ws >> ud._max;
- return is;
- }
-#endif
-
-private:
- RealType _min, _max;
+ /** Returns the parameters of the distribution */
+ param_type param() const { return param_type(this->a(), this->b()); }
+ /** Sets the parameters of the distribution. */
+ void param(const param_type& parm) { this->base_type::param(parm); }