From Jason Turner

[rand.dist.norm.chisq]

Diff to HTML by rtfpessoa

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