From Jason Turner

[rand.dist.norm.lognormal]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9tqjna00/{from.md → to.md} +13 -0
tmp/tmp9tqjna00/{from.md → to.md} RENAMED
@@ -5,10 +5,11 @@ numbers x > 0 distributed according to the probability density function
5
  $$p(x\,|\,m,s) = \frac{1}{s x \sqrt{2 \pi}}
6
  \cdot \exp{\left(-\frac{(\ln{x} - m)^2}{2 s^2}\right)}
7
  \text{ .}$$
8
 
9
  ``` cpp
 
10
  template<class RealType = double>
11
  class lognormal_distribution {
12
  public:
13
  // types
14
  using result_type = RealType;
@@ -18,10 +19,13 @@ template<class RealType = double>
18
  lognormal_distribution() : lognormal_distribution(0.0) {}
19
  explicit lognormal_distribution(RealType m, RealType s = 1.0);
20
  explicit lognormal_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 s() 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 lognormal_distribution(RealType m, RealType s = 1.0);
41
  ```
 
5
  $$p(x\,|\,m,s) = \frac{1}{s x \sqrt{2 \pi}}
6
  \cdot \exp{\left(-\frac{(\ln{x} - m)^2}{2 s^2}\right)}
7
  \text{ .}$$
8
 
9
  ``` cpp
10
+ namespace std {
11
  template<class RealType = double>
12
  class lognormal_distribution {
13
  public:
14
  // types
15
  using result_type = RealType;
 
19
  lognormal_distribution() : lognormal_distribution(0.0) {}
20
  explicit lognormal_distribution(RealType m, RealType s = 1.0);
21
  explicit lognormal_distribution(const param_type& parm);
22
  void reset();
23
 
24
+ // equality operators
25
+ friend bool operator==(const lognormal_distribution& x, const lognormal_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 s() 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 lognormal_distribution& x);
45
+ template<class charT, class traits>
46
+ friend basic_istream<charT, traits>&
47
+ operator>>(basic_istream<charT, traits>& is, lognormal_distribution& x);
48
  };
49
+ }
50
  ```
51
 
52
  ``` cpp
53
  explicit lognormal_distribution(RealType m, RealType s = 1.0);
54
  ```