+ typedef RealType input_type;
+ typedef RealType result_type;
+
+ class param_type
+ {
+ public:
+ typedef gamma_distribution distribution_type;
+
+ /**
+ * Constructs a @c param_type object from the "alpha" and "beta"
+ * parameters.
+ *
+ * Requires: alpha > 0 && beta > 0
+ */
+ param_type(const RealType& alpha_arg = RealType(1.0),
+ const RealType& beta_arg = RealType(1.0))
+ : _alpha(alpha_arg), _beta(beta_arg)
+ {
+ }
+
+ /** Returns the "alpha" parameter of the distribution. */
+ RealType alpha() const { return _alpha; }
+ /** Returns the "beta" parameter of the distribution. */
+ RealType beta() const { return _beta; }
+
+#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
+ /** Writes the parameters to a @c std::ostream. */
+ template<class CharT, class Traits>
+ friend std::basic_ostream<CharT, Traits>&
+ operator<<(std::basic_ostream<CharT, Traits>& os,
+ const param_type& parm)
+ {
+ os << parm._alpha << ' ' << parm._beta;
+ return os;
+ }
+
+ /** Reads the parameters from a @c std::istream. */
+ template<class CharT, class Traits>
+ friend std::basic_istream<CharT, Traits>&
+ operator>>(std::basic_istream<CharT, Traits>& is, param_type& parm)
+ {
+ is >> parm._alpha >> std::ws >> parm._beta;
+ return is;
+ }
+#endif
+
+ /** Returns true if the two sets of parameters are the same. */
+ friend bool operator==(const param_type& lhs, const param_type& rhs)
+ {
+ return lhs._alpha == rhs._alpha && lhs._beta == rhs._beta;
+ }
+ /** Returns true if the two sets fo parameters are different. */
+ friend bool operator!=(const param_type& lhs, const param_type& rhs)
+ {
+ return !(lhs == rhs);
+ }
+ private:
+ RealType _alpha;
+ RealType _beta;
+ };