From Jason Turner

[rand.dist.norm.cauchy]

Diff to HTML by rtfpessoa

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