From Jason Turner

[rand.dist.norm.lognormal]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmppzjmf4ub/{from.md → to.md} +9 -15
tmp/tmppzjmf4ub/{from.md → to.md} RENAMED
@@ -1,30 +1,24 @@
1
  ##### Class template `lognormal_distribution` <a id="rand.dist.norm.lognormal">[[rand.dist.norm.lognormal]]</a>
2
 
3
  A `lognormal_distribution` random number distribution produces random
4
  numbers x > 0 distributed according to the probability density function
5
- $$%
6
- p(x\,|\,m,s)
7
- = \frac{1}
8
- {s x \sqrt{2 \pi}}
9
- \cdot
10
- \exp{\left(- \, \frac{(\ln{x} - m)^2}
11
- {2 s^2}
12
- \right)
13
- }
14
- \; \mbox{.}$$
15
 
16
  ``` cpp
17
  template<class RealType = double>
18
  class lognormal_distribution {
19
  public:
20
  // types
21
  using result_type = RealType;
22
  using param_type = unspecified;
23
 
24
  // constructor and reset functions
25
- explicit lognormal_distribution(RealType m = 0.0, RealType s = 1.0);
 
26
  explicit lognormal_distribution(const param_type& parm);
27
  void reset();
28
 
29
  // generating functions
30
  template<class URBG>
@@ -41,17 +35,17 @@ template<class RealType = double>
41
  result_type max() const;
42
  };
43
  ```
44
 
45
  ``` cpp
46
- explicit lognormal_distribution(RealType m = 0.0, RealType s = 1.0);
47
  ```
48
 
49
- *Requires:* 0 < `s`.
50
 
51
- *Effects:* Constructs a `lognormal_distribution` object; `m` and `s`
52
- correspond to the respective parameters of the distribution.
53
 
54
  ``` cpp
55
  RealType m() const;
56
  ```
57
 
 
1
  ##### Class template `lognormal_distribution` <a id="rand.dist.norm.lognormal">[[rand.dist.norm.lognormal]]</a>
2
 
3
  A `lognormal_distribution` random number distribution produces random
4
  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;
15
  using param_type = unspecified;
16
 
17
  // constructor and reset functions
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>
 
35
  result_type max() const;
36
  };
37
  ```
38
 
39
  ``` cpp
40
+ explicit lognormal_distribution(RealType m, RealType s = 1.0);
41
  ```
42
 
43
+ *Preconditions:* 0 < `s`.
44
 
45
+ *Remarks:* `m` and `s` correspond to the respective parameters of the
46
+ distribution.
47
 
48
  ``` cpp
49
  RealType m() const;
50
  ```
51