From Jason Turner

[rand.dist.uni.real]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpkbzy12ku/{from.md → to.md} +14 -0
tmp/tmpkbzy12ku/{from.md → to.md} RENAMED
@@ -6,10 +6,11 @@ density function $$p(x\,|\,a,b) = 1 / (b - a) \text{ .}$$
6
 
7
  [*Note 1*: This implies that p(x | a,b) is undefined when
8
  `a == b`. — *end note*]
9
 
10
  ``` cpp
 
11
  template<class RealType = double>
12
  class uniform_real_distribution {
13
  public:
14
  // types
15
  using result_type = RealType;
@@ -19,10 +20,14 @@ template<class RealType = double>
19
  uniform_real_distribution() : uniform_real_distribution(0.0) {}
20
  explicit uniform_real_distribution(RealType a, RealType b = 1.0);
21
  explicit uniform_real_distribution(const param_type& parm);
22
  void reset();
23
 
 
 
 
 
24
  // generating functions
25
  template<class URBG>
26
  result_type operator()(URBG& g);
27
  template<class URBG>
28
  result_type operator()(URBG& g, const param_type& parm);
@@ -32,11 +37,20 @@ template<class RealType = double>
32
  result_type b() 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
  ```
39
 
40
  ``` cpp
41
  explicit uniform_real_distribution(RealType a, RealType b = 1.0);
42
  ```
 
6
 
7
  [*Note 1*: This implies that p(x | a,b) is undefined when
8
  `a == b`. — *end note*]
9
 
10
  ``` cpp
11
+ namespace std {
12
  template<class RealType = double>
13
  class uniform_real_distribution {
14
  public:
15
  // types
16
  using result_type = RealType;
 
20
  uniform_real_distribution() : uniform_real_distribution(0.0) {}
21
  explicit uniform_real_distribution(RealType a, RealType b = 1.0);
22
  explicit uniform_real_distribution(const param_type& parm);
23
  void reset();
24
 
25
+ // equality operators
26
+ friend bool operator==(const uniform_real_distribution& x,
27
+ const uniform_real_distribution& y);
28
+
29
  // generating functions
30
  template<class URBG>
31
  result_type operator()(URBG& g);
32
  template<class URBG>
33
  result_type operator()(URBG& g, const param_type& parm);
 
37
  result_type b() const;
38
  param_type param() const;
39
  void param(const param_type& parm);
40
  result_type min() const;
41
  result_type max() const;
42
+
43
+ // inserters and extractors
44
+ template<class charT, class traits>
45
+ friend basic_ostream<charT, traits>&
46
+ operator<<(basic_ostream<charT, traits>& os, const uniform_real_distribution& x);
47
+ template<class charT, class traits>
48
+ friend basic_istream<charT, traits>&
49
+ operator>>(basic_istream<charT, traits>& is, uniform_real_distribution& x);
50
  };
51
+ }
52
  ```
53
 
54
  ``` cpp
55
  explicit uniform_real_distribution(RealType a, RealType b = 1.0);
56
  ```