From Jason Turner

[rand.dist.pois.exp]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqh27x259/{from.md → to.md} +13 -0
tmp/tmpqh27x259/{from.md → to.md} RENAMED
@@ -3,10 +3,11 @@
3
  An `exponential_distribution` random number distribution produces random
4
  numbers x > 0 distributed according to the probability density function
5
  $$p(x\,|\,\lambda) = \lambda e^{-\lambda x} \text{ .}$$
6
 
7
  ``` cpp
 
8
  template<class RealType = double>
9
  class exponential_distribution {
10
  public:
11
  // types
12
  using result_type = RealType;
@@ -16,10 +17,13 @@ template<class RealType = double>
16
  exponential_distribution() : exponential_distribution(1.0) {}
17
  explicit exponential_distribution(RealType lambda);
18
  explicit exponential_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 lambda() 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 exponential_distribution(RealType lambda);
38
  ```
 
3
  An `exponential_distribution` random number distribution produces random
4
  numbers x > 0 distributed according to the probability density function
5
  $$p(x\,|\,\lambda) = \lambda e^{-\lambda x} \text{ .}$$
6
 
7
  ``` cpp
8
+ namespace std {
9
  template<class RealType = double>
10
  class exponential_distribution {
11
  public:
12
  // types
13
  using result_type = RealType;
 
17
  exponential_distribution() : exponential_distribution(1.0) {}
18
  explicit exponential_distribution(RealType lambda);
19
  explicit exponential_distribution(const param_type& parm);
20
  void reset();
21
 
22
+ // equality operators
23
+ friend bool operator==(const exponential_distribution& x, const exponential_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 lambda() 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 exponential_distribution& x);
42
+ template<class charT, class traits>
43
+ friend basic_istream<charT, traits>&
44
+ operator>>(basic_istream<charT, traits>& is, exponential_distribution& x);
45
  };
46
+ }
47
  ```
48
 
49
  ``` cpp
50
  explicit exponential_distribution(RealType lambda);
51
  ```