Skip to content

Commit 0194fbc

Browse files
author
Colin Robertson
committed
More F1 TR1 fixes.
1 parent f293f07 commit 0194fbc

4 files changed

Lines changed: 263 additions & 90 deletions

File tree

docs/standard-library/functional-functions.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,51 @@ ms.custom: ""
44
ms.date: "11/04/2016"
55
ms.reviewer: ""
66
ms.suite: ""
7+
ms.technology:
8+
- "devlang-cpp"
79
ms.tgt_pltfrm: ""
810
ms.topic: "article"
11+
f1_keywords:
12+
- "std::bind"
13+
- "functional/std::bind"
14+
- "std::bind1st"
15+
- "functional/std::bind1st"
16+
- "std::bind2nd"
17+
- "functional/std::bind2nd"
18+
- "std::bit_and"
19+
- "functional/std::bit_and"
20+
- "std::bit_not"
21+
- "functional/std::bit_not"
22+
- "std::bit_or"
23+
- "functional/std::bit_or"
24+
- "std::bit_xor"
25+
- "functional/std::bit_xor"
26+
- "std::cref"
27+
- "functional/std::cref"
28+
- "std::mem_fn"
29+
- "functional/std::mem_fn"
30+
- "std::mem_fun"
31+
- "functional/std::mem_fun"
32+
- "std::mem_fun_ref"
33+
- "functional/std::mem_fun_ref"
34+
- "std::not1"
35+
- "functional/std::not1"
36+
- "std::not2"
37+
- "functional/std::not2"
38+
- "std::ptr_fun"
39+
- "functional/std::ptr_fun"
40+
- "std::ref"
41+
- "functional/std::ref"
42+
- "std::swap"
43+
- "functional/std::swap"
44+
dev_langs:
45+
- "C++"
46+
helpviewer_keywords:
47+
- "functional functions"
948
ms.assetid: c34d0b45-50a7-447a-9368-2210d06339a4
1049
caps.latest.revision: 12
50+
author: "corob-msft"
51+
ms.author: "corob"
1152
manager: "ghogen"
1253
---
1354
# <functional> functions
@@ -926,7 +967,7 @@ reference_wrapper<Ty> ref(reference_wrapper<Ty>& arg);
926967
### Example
927968
The following example defines two functions: one bound to a string variable, the other bound to a reference of the string variable computed by a call to `ref`. When the value of the variable changes, the first function continues to use the old value and the second function uses the new value.
928969

929-
```
970+
```cpp
930971
#include <algorithm>
931972
#include <functional>
932973
#include <iostream>

docs/standard-library/functional-operators.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@ ms.custom: ""
44
ms.date: "11/04/2016"
55
ms.reviewer: ""
66
ms.suite: ""
7+
ms.technology:
8+
- "devlang-cpp"
79
ms.tgt_pltfrm: ""
810
ms.topic: "article"
11+
f1_keywords:
12+
- "std::operator!="
13+
- "functional/std::operator!="
14+
- "std::operator=="
15+
- "functional/std::operator=="
16+
dev_langs:
17+
- "C++"
18+
helpviewer_keywords:
19+
- "functional operators"
920
ms.assetid: d4b3c760-f3e2-4b65-bdaa-d42e8dd6f5e1
1021
caps.latest.revision: 13
22+
author: "corob-msft"
23+
ms.author: "corob"
1124
manager: "ghogen"
1225
---
1326
# &lt;functional&gt; operators
@@ -42,7 +55,7 @@ bool operator==(null_ptr_type npc, const function<Fty>& f);
4255
### Example
4356

4457
```cpp
45-
// std_tr1__functional__operator_eq.cpp
58+
// std__functional__operator_eq.cpp
4659
// compile with: /EHsc
4760
#include <functional>
4861
#include <iostream>
@@ -99,7 +112,7 @@ bool operator!=(null_ptr_type npc, const function<Fty>& f);
99112
### Example
100113

101114
```cpp
102-
// std_tr1__functional__operator_ne.cpp
115+
// std__functional__operator_ne.cpp
103116
// compile with: /EHsc
104117
#include <functional>
105118
#include <iostream>

docs/standard-library/gamma-distribution-class.md

Lines changed: 84 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,37 @@ ms.technology:
99
ms.tgt_pltfrm: ""
1010
ms.topic: "article"
1111
f1_keywords:
12-
- "random/std::tr1::gamma_distribution"
13-
- "std::tr1::gamma_distribution"
14-
- "std.tr1.gamma_distribution"
15-
- "tr1.gamma_distribution"
16-
- "tr1::gamma_distribution"
1712
- "gamma_distribution"
13+
- "std::gamma_distribution"
14+
- "random/std::gamma_distribution"
15+
- "std::gamma_distribution::reset"
16+
- "random/std::gamma_distribution::reset"
17+
- "std::gamma_distribution::alpha"
18+
- "random/std::gamma_distribution::alpha"
19+
- "std::gamma_distribution::beta"
20+
- "random/std::gamma_distribution::beta"
21+
- "std::gamma_distribution::param"
22+
- "random/std::gamma_distribution::param"
23+
- "std::gamma_distribution::min"
24+
- "random/std::gamma_distribution::min"
25+
- "std::gamma_distribution::max"
26+
- "random/std::gamma_distribution::max"
27+
- "std::gamma_distribution::operator()"
28+
- "random/std::gamma_distribution::operator()"
29+
- "std::gamma_distribution::param_type"
30+
- "random/std::gamma_distribution::param_type"
31+
- "std::gamma_distribution::param_type::alpha"
32+
- "random/std::gamma_distribution::param_type::alpha"
33+
- "std::gamma_distribution::param_type::beta"
34+
- "random/std::gamma_distribution::param_type::beta"
35+
- "std::gamma_distribution::param_type::operator=="
36+
- "random/std::gamma_distribution::param_type::operator=="
37+
- "std::gamma_distribution::param_type::operator!="
38+
- "random/std::gamma_distribution::param_type::operator!="
1839
dev_langs:
1940
- "C++"
2041
helpviewer_keywords:
21-
- "gamma_distribution class [TR1]"
42+
- "gamma_distribution"
2243
- "gamma_distribution class"
2344
ms.assetid: 2a6798ac-6152-41d7-8ef6-d684d92f1572
2445
caps.latest.revision: 18
@@ -45,46 +66,61 @@ Generates a gamma distribution.
4566

4667
## Syntax
4768
```
69+
template<class RealType = double>
4870
class gamma_distribution {
4971
public:
5072
// types
5173
typedef RealType result_type;
52-
struct param_type;
74+
struct param_type;
75+
5376
// constructors and reset functions
54-
explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
77+
explicit gamma_distribution(result_type alpha = 1.0, result_type beta = 1.0);
5578
explicit gamma_distribution(const param_type& parm);
5679
void reset();
80+
5781
// generating functions
5882
template <class URNG>
5983
result_type operator()(URNG& gen);
6084
template <class URNG>
6185
result_type operator()(URNG& gen, const param_type& parm);
86+
6287
// property functions
63-
RealType alpha() const;
64-
RealType beta() const;
88+
result_type alpha() const;
89+
result_type beta() const;
6590
param_type param() const;
6691
void param(const param_type& parm);
6792
result_type min() const;
6893
result_type max() const;
6994
};
7095
```
7196
#### Parameters
72-
`RealType`
73-
The floating-point result type, defaults to `double`. For possible types, see [\<random>](../standard-library/random.md).
97+
*RealType*
98+
The floating-point result type, defaults to `double`. For possible types, see [\<random>](../standard-library/random.md).
99+
100+
*URNG*
101+
The uniform random number generator engine. For possible types, see [\<random>](../standard-library/random.md).
74102

75103
## Remarks
76-
The template class describes a distribution that produces values of a user-specified integral type, or type `double` if none is provided, distributed according to the Gamma Distribution. The following table links to articles about individual members.
104+
The template class describes a distribution that produces values of a user-specified floating-point type, or type `double` if none is provided, distributed according to the Gamma Distribution. The following table links to articles about individual members.
77105

78106
||||
79107
|-|-|-|
80108
|[gamma_distribution::gamma_distribution](#gamma_distribution__gamma_distribution)|`gamma_distribution::alpha`|`gamma_distribution::param`|
81109
|`gamma_distribution::operator()`|`gamma_distribution::beta`|[gamma_distribution::param_type](#gamma_distribution__param_type)|
82110

83-
The property functions `alpha()` and `beta()` return their respective values for stored distribution parameters `alpha` and `beta`.
111+
The property functions `alpha()` and `beta()` return their respective values for stored distribution parameters *alpha* and *beta*.
112+
113+
The property member `param()` sets or returns the `param_type` stored distribution parameter package.
114+
115+
The `min()` and `max()` member functions return the smallest possible result and largest possible result, respectively.
116+
117+
The `reset()` member function discards any cached values, so that the result of the next call to `operator()` does not depend on any values obtained from the engine before the call.
84118

85-
For more information about distribution classes and their members, see [\<random>](../standard-library/random.md).
119+
The `operator()` member functions return the next generated value based on the URNG engine, either from the current parameter package, or the specified parameter package.
86120

87-
For detailed information about the gamma distribution, see the Wolfram MathWorld article [Gamma Distribution](http://go.microsoft.com/fwlink/LinkId=401111).
121+
For more information about distribution classes and their members, see [\<random>](../standard-library/random.md).
122+
123+
For detailed information about the gamma distribution, see the Wolfram MathWorld article [Gamma Distribution](http://go.microsoft.com/fwlink/LinkId=401111).
88124

89125
## Example
90126

@@ -144,12 +180,9 @@ int main()
144180

145181
test(a_dist, b_dist, samples);
146182
}
147-
148183
```
149184
150-
## Output
151-
152-
```
185+
```Output
153186
Use CTRL-Z to bypass data entry and run using default values.
154187
Enter a floating point value for the 'alpha' distribution parameter (must be greater than zero): 1
155188
Enter a floating point value for the 'beta' distribution parameter (must be greater than zero): 1
@@ -173,60 +206,66 @@ Distribution for 10 samples:
173206
```
174207

175208
## Requirements
176-
**Header:** \<random>
209+
**Header:** \<random>
177210

178-
**Namespace:** std
211+
**Namespace:** std
179212

180213
## <a name="gamma_distribution__gamma_distribution"></a> gamma_distribution::gamma_distribution
181-
Constructs the distribution.
214+
Constructs the distribution.
182215

183216
```
184-
explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
185-
186-
217+
explicit gamma_distribution(result_type alpha = 1.0, result_type beta = 1.0);
187218
explicit gamma_distribution(const param_type& parm);
188219
```
189220

190221
### Parameters
191-
`alpha`
192-
The `alpha` distribution parameter.
222+
*alpha*
223+
The `alpha` distribution parameter.
193224

194-
`beta`
195-
The `beta` distribution parameter.
225+
*beta*
226+
The `beta` distribution parameter.
196227

197-
`parm`
198-
The parameter structure used to construct the distribution.
228+
*parm*
229+
The parameter structure used to construct the distribution.
199230

200231
### Remarks
201-
**Precondition:** `0.0 < alpha` and `0.0 < beta`
232+
**Precondition:** `0.0 < alpha` and `0.0 < beta`
202233

203-
The first constructor constructs an object whose stored `alpha` value holds the value `alpha` and whose stored `beta` value holds the value `beta`.
234+
The first constructor constructs an object whose stored `alpha` value holds the value *alpha* and whose stored `beta` value holds the value *beta*.
204235

205-
The second constructor constructs an object whose stored parameters are initialized from `parm`. You can obtain and set the current parameters of an existing distribution by calling the `param()` member function.
236+
The second constructor constructs an object whose stored parameters are initialized from *parm*. You can obtain and set the current parameters of an existing distribution by calling the `param()` member function.
206237

207238
## <a name="gamma_distribution__param_type"></a> gamma_distribution::param_type
208-
Stores the parameters of the distribution.
239+
Stores the parameters of the distribution.
240+
209241
```cpp
210242
struct param_type {
211-
typedef gamma_distribution<RealType> distribution_type;
212-
param_type(RealType alpha = 1.0, RealType beta 1.0);
213-
RealType alpha() const;
214-
RealType beta() const;
215-
.....
243+
typedef gamma_distribution<result_type> distribution_type;
244+
param_type(result_type alpha = 1.0, result_type beta 1.0);
245+
result_type alpha() const;
246+
result_type beta() const;
247+
216248
bool operator==(const param_type& right) const;
217249
bool operator!=(const param_type& right) const;
218250
};
219251
```
220252
### Parameters
221-
See parent topic [gamma_distribution Class](../standard-library/gamma-distribution-class.md).
253+
*alpha*
254+
The `alpha` distribution parameter.
255+
256+
*beta*
257+
The `beta` distribution parameter.
258+
259+
*right*
260+
The `param_type` instance to compare this to.
222261
223262
### Remarks
224-
**Precondition:** `0.0 < alpha` and `0.0 < beta`
263+
**Precondition:** `0.0 < alpha` and `0.0 < beta`
225264
226-
This structure can be passed to the distribution's class constructor at instantiation, to the `param()` member function to set the stored parameters of an existing distribution, and to `operator()` to be used in place of the stored parameters.
265+
This structure can be passed to the distribution's class constructor at instantiation, to the `param()` member function to set the stored parameters of an existing distribution, and to `operator()` to be used in place of the stored parameters.
227266
228267
## See Also
229-
[\<random>](../standard-library/random.md)
268+
[\<random>](../standard-library/random.md)
230269
231270
232271

0 commit comments

Comments
 (0)