From Jason Turner

[rand.dist.pois.gamma]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpo1jtj57a/{from.md → to.md} +13 -0
tmp/tmpo1jtj57a/{from.md → to.md} RENAMED
@@ -5,10 +5,11 @@ numbers x > 0 distributed according to the probability density function
5
  $$p(x\,|\,\alpha,\beta) =
6
  \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)} \, \cdot \, x^{\, \alpha-1}
7
  \text{ .}$$
8
 
9
  ``` cpp
 
10
  template<class RealType = double>
11
  class gamma_distribution {
12
  public:
13
  // types
14
  using result_type = RealType;
@@ -18,10 +19,13 @@ template<class RealType = double>
18
  gamma_distribution() : gamma_distribution(1.0) {}
19
  explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
20
  explicit gamma_distribution(const param_type& parm);
21
  void reset();
22
 
 
 
 
23
  // generating functions
24
  template<class URBG>
25
  result_type operator()(URBG& g);
26
  template<class URBG>
27
  result_type operator()(URBG& g, const param_type& parm);
@@ -31,11 +35,20 @@ template<class RealType = double>
31
  RealType beta() const;
32
  param_type param() const;
33
  void param(const param_type& parm);
34
  result_type min() const;
35
  result_type max() const;
 
 
 
 
 
 
 
 
36
  };
 
37
  ```
38
 
39
  ``` cpp
40
  explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
41
  ```
 
5
  $$p(x\,|\,\alpha,\beta) =
6
  \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)} \, \cdot \, x^{\, \alpha-1}
7
  \text{ .}$$
8
 
9
  ``` cpp
10
+ namespace std {
11
  template<class RealType = double>
12
  class gamma_distribution {
13
  public:
14
  // types
15
  using result_type = RealType;
 
19
  gamma_distribution() : gamma_distribution(1.0) {}
20
  explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
21
  explicit gamma_distribution(const param_type& parm);
22
  void reset();
23
 
24
+ // equality operators
25
+ friend bool operator==(const gamma_distribution& x, const gamma_distribution& y);
26
+
27
  // generating functions
28
  template<class URBG>
29
  result_type operator()(URBG& g);
30
  template<class URBG>
31
  result_type operator()(URBG& g, const param_type& parm);
 
35
  RealType beta() const;
36
  param_type param() const;
37
  void param(const param_type& parm);
38
  result_type min() const;
39
  result_type max() const;
40
+
41
+ // inserters and extractors
42
+ template<class charT, class traits>
43
+ friend basic_ostream<charT, traits>&
44
+ operator<<(basic_ostream<charT, traits>& os, const gamma_distribution& x);
45
+ template<class charT, class traits>
46
+ friend basic_istream<charT, traits>&
47
+ operator>>(basic_istream<charT, traits>& is, gamma_distribution& x);
48
  };
49
+ }
50
  ```
51
 
52
  ``` cpp
53
  explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
54
  ```