Skip to content

Commit 51a60e3

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#906 from msebolt/class-consolidation-numeric
numeric draft
2 parents becbca6 + bed998c commit 51a60e3

1 file changed

Lines changed: 78 additions & 12 deletions

File tree

‎docs/dotnet/numeric-stl-clr.md‎

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ ms.custom: ""
44
ms.date: "11/04/2016"
55
ms.technology: ["cpp-cli"]
66
ms.topic: "reference"
7-
f1_keywords: ["<cliext/numeric>"]
7+
f1_keywords: ["<cliext/numeric>", "cliext::accumulate", "cliext::adjacent_difference", "cliext::inner_product", "cliext::partial_sum"]
88
dev_langs: ["C++"]
9-
helpviewer_keywords: ["numeric functions [STL/CLR]", "<cliext/numeric> header [STL/CLR]", "<numeric> header [STL/CLR]"]
9+
helpviewer_keywords: ["numeric functions [STL/CLR]", "<cliext/numeric> header [STL/CLR]", "<numeric> header [STL/CLR]", "accumulate function [STL/CLR]", "adjacent_difference function [STL/CLR]", "inner_product function [STL/CLR]", "partial_sum function [STL/CLR]"]
1010
ms.assetid: 1dc4d9a3-e734-459c-9678-5d9be0ef4c79
1111
author: "mikeblome"
1212
ms.author: "mblome"
@@ -20,20 +20,86 @@ Defines container template functions that perform algorithms provided for numeri
2020
```
2121
#include <cliext/numeric>
2222
```
23+
24+
## Requirements
25+
**Header:** \<cliext/numeric>
26+
27+
**Namespace:** cliext
2328

24-
## Functions
29+
## Declarations
2530

2631
|Function|Description|
2732
|--------------|-----------------|
28-
|[accumulate (STL/CLR)](../dotnet/accumulate-stl-clr.md)|Computes the sum of all the elements in a specified range including some initial value by computing successive partial sums or computes the result of successive partial results similarly obtained from using a specified binary operation other than the sum.|
29-
|[adjacent_difference (STL/CLR)](../dotnet/adjacent-difference-stl-clr.md)|Computes the successive differences between each element and its predecessor in an input range and outputs the results to a destination range or computes the result of a generalized procedure where the difference operation is replaced by another, specified binary operation.|
30-
|[inner_product (STL/CLR)](../dotnet/inner-product-stl-clr.md)|Computes the sum of the element-wise product of two ranges and adds it to a specified initial value or computes the result of a generalized procedure where the sum and product binary operations are replaced by other specified binary operations.|
31-
|[partial_sum (STL/CLR)](../dotnet/partial-sum-stl-clr.md)|Computes a series of sums in an input range from the first element through the `i`th element and stores the result of each such sum in `i`th element of a destination range or computes the result of a generalized procedure where the sum operation is replaced by another specified binary operation.|
33+
|[accumulate (STL/CLR)](#accumulate)|Computes the sum of all the elements in a specified range including some initial value by computing successive partial sums or computes the result of successive partial results similarly obtained from using a specified binary operation other than the sum.|
34+
|[adjacent_difference (STL/CLR)](#adjacent_difference)|Computes the successive differences between each element and its predecessor in an input range and outputs the results to a destination range or computes the result of a generalized procedure where the difference operation is replaced by another, specified binary operation.|
35+
|[inner_product (STL/CLR)](#inner_product)|Computes the sum of the element-wise product of two ranges and adds it to a specified initial value or computes the result of a generalized procedure where the sum and product binary operations are replaced by other specified binary operations.|
36+
|[partial_sum (STL/CLR)](#partial_sum)|Computes a series of sums in an input range from the first element through the `i`th element and stores the result of each such sum in `i`th element of a destination range or computes the result of a generalized procedure where the sum operation is replaced by another specified binary operation.|
37+
38+
## Functions
39+
40+
## <a name="accumulate"></a> accumulate (STL/CLR)
41+
Computes the sum of all the elements in a specified range including some initial value by computing successive partial sums or computes the result of successive partial results similarly obtained from using a specified binary operation other than the sum.
3242

33-
## Requirements
34-
**Header:** \<cliext/numeric>
43+
### Syntax
3544

36-
**Namespace:** cliext
45+
```
46+
template<class _InIt, class _Ty> inline
47+
_Ty accumulate(_InIt _First, _InIt _Last, _Ty _Val);
48+
template<class _InIt, class _Ty, class _Fn2> inline
49+
_Ty accumulate(_InIt _First, _InIt _Last, _Ty _Val, _Fn2 _Func);
50+
```
51+
52+
### Remarks
53+
This function behaves the same as the C++ Standard Library numeric function `accumulate`. For more information, see [accumulate](../standard-library/numeric-functions.md#accumulate).
54+
55+
## <a name="adjacent_difference"></a> adjacent_difference (STL/CLR)
56+
Computes the successive differences between each element and its predecessor in an input range and outputs the results to a destination range or computes the result of a generalized procedure where the difference operation is replaced by another, specified binary operation.
57+
58+
### Syntax
59+
60+
```
61+
template<class _InIt, class _OutIt> inline
62+
_OutIt adjacent_difference(_InIt _First, _InIt _Last,
63+
_OutIt _Dest);
64+
template<class _InIt, class _OutIt, class _Fn2> inline
65+
_OutIt adjacent_difference(_InIt _First, _InIt _Last,
66+
_OutIt _Dest, _Fn2 _Func);
67+
```
68+
69+
### Remarks
70+
This function behaves the same as the C++ Standard Library numeric function `adjacent_difference`. For more information, see [adjacent_difference](../standard-library/numeric-functions.md#adjacent_difference).
71+
72+
## <a name="inner_product"></a> inner_product (STL/CLR)
73+
Computes the sum of the element-wise product of two ranges and adds it to a specified initial value or computes the result of a generalized procedure where the sum and product binary operations are replaced by other specified binary operations.
74+
75+
###Syntax
76+
77+
```
78+
template<class _InIt1, class _InIt2, class _Ty> inline
79+
_Ty inner_product(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2,
80+
_Ty _Val);
81+
template<class _InIt1, class _InIt2, class _Ty, class _Fn21,
82+
class _Fn22> inline
83+
_Ty inner_product(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2,
84+
_Ty _Val, _Fn21 _Func1, _Fn22 _Func2);
85+
```
86+
87+
### Remarks
88+
This function behaves the same as the C++ Standard Library numeric function `inner_product`. For more information, see [inner_product](../standard-library/numeric-functions.md#inner_product).
89+
90+
## <a name="partial_sum"></a> partial_sum (STL/CLR)
91+
Computes a series of sums in an input range from the first element through the `i`th element and stores the result of each such sum in `i`th element of a destination range or computes the result of a generalized procedure where the sum operation is replaced by another specified binary operation.
92+
93+
### Syntax
94+
95+
```
96+
template<class _InIt, class _OutIt> inline
97+
_OutIt partial_sum(_InIt _First, _InIt _Last, _OutIt _Dest);
98+
template<class _InIt, class _OutIt, class _Fn2> inline
99+
_OutIt partial_sum(_InIt _First, _InIt _Last,
100+
_OutIt _Dest, _Fn2 _Func);
101+
```
37102

38-
## See Also
39-
[STL/CLR Library Reference](../dotnet/stl-clr-library-reference.md)
103+
### Remarks
104+
This function behaves the same as the C++ Standard Library numeric function `partial_sum`. For more information, see [partial_sum](../standard-library/numeric-functions.md#partial_sum).
105+

0 commit comments

Comments
 (0)