tmp/tmps73of3me/{from.md → to.md}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
## Header `<numeric>` synopsis <a id="numeric.ops.overview">[[numeric.ops.overview]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
|
|
|
| 4 |
namespace std {
|
| 5 |
// [accumulate], accumulate
|
| 6 |
template<class InputIterator, class T>
|
| 7 |
constexpr T accumulate(InputIterator first, InputIterator last, T init);
|
| 8 |
template<class InputIterator, class T, class BinaryOperation>
|
|
@@ -18,17 +19,17 @@ namespace std {
|
|
| 18 |
template<class InputIterator, class T, class BinaryOperation>
|
| 19 |
constexpr T reduce(InputIterator first, InputIterator last, T init,
|
| 20 |
BinaryOperation binary_op);
|
| 21 |
template<class ExecutionPolicy, class ForwardIterator>
|
| 22 |
typename iterator_traits<ForwardIterator>::value_type
|
| 23 |
-
reduce(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 24 |
ForwardIterator first, ForwardIterator last);
|
| 25 |
template<class ExecutionPolicy, class ForwardIterator, class T>
|
| 26 |
-
T reduce(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 27 |
ForwardIterator first, ForwardIterator last, T init);
|
| 28 |
template<class ExecutionPolicy, class ForwardIterator, class T, class BinaryOperation>
|
| 29 |
-
T reduce(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 30 |
ForwardIterator first, ForwardIterator last, T init, BinaryOperation binary_op);
|
| 31 |
|
| 32 |
// [inner.product], inner product
|
| 33 |
template<class InputIterator1, class InputIterator2, class T>
|
| 34 |
constexpr T inner_product(InputIterator1 first1, InputIterator1 last1,
|
|
@@ -52,23 +53,23 @@ namespace std {
|
|
| 52 |
class BinaryOperation, class UnaryOperation>
|
| 53 |
constexpr T transform_reduce(InputIterator first, InputIterator last, T init,
|
| 54 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 55 |
template<class ExecutionPolicy,
|
| 56 |
class ForwardIterator1, class ForwardIterator2, class T>
|
| 57 |
-
T transform_reduce(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 58 |
ForwardIterator1 first1, ForwardIterator1 last1,
|
| 59 |
ForwardIterator2 first2, T init);
|
| 60 |
template<class ExecutionPolicy,
|
| 61 |
class ForwardIterator1, class ForwardIterator2, class T,
|
| 62 |
class BinaryOperation1, class BinaryOperation2>
|
| 63 |
-
T transform_reduce(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 64 |
ForwardIterator1 first1, ForwardIterator1 last1,
|
| 65 |
ForwardIterator2 first2, T init,
|
| 66 |
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
|
| 67 |
template<class ExecutionPolicy, class ForwardIterator, class T,
|
| 68 |
class BinaryOperation, class UnaryOperation>
|
| 69 |
-
T transform_reduce(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 70 |
ForwardIterator first, ForwardIterator last, T init,
|
| 71 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 72 |
|
| 73 |
// [partial.sum], partial sum
|
| 74 |
template<class InputIterator, class OutputIterator>
|
|
@@ -89,17 +90,17 @@ namespace std {
|
|
| 89 |
constexpr OutputIterator
|
| 90 |
exclusive_scan(InputIterator first, InputIterator last,
|
| 91 |
OutputIterator result, T init, BinaryOperation binary_op);
|
| 92 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
|
| 93 |
ForwardIterator2
|
| 94 |
-
exclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 95 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 96 |
ForwardIterator2 result, T init);
|
| 97 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T,
|
| 98 |
class BinaryOperation>
|
| 99 |
ForwardIterator2
|
| 100 |
-
exclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 101 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 102 |
ForwardIterator2 result, T init, BinaryOperation binary_op);
|
| 103 |
|
| 104 |
// [inclusive.scan], inclusive scan
|
| 105 |
template<class InputIterator, class OutputIterator>
|
|
@@ -114,23 +115,23 @@ namespace std {
|
|
| 114 |
constexpr OutputIterator
|
| 115 |
inclusive_scan(InputIterator first, InputIterator last,
|
| 116 |
OutputIterator result, BinaryOperation binary_op, T init);
|
| 117 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
|
| 118 |
ForwardIterator2
|
| 119 |
-
inclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 120 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 121 |
ForwardIterator2 result);
|
| 122 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 123 |
class BinaryOperation>
|
| 124 |
ForwardIterator2
|
| 125 |
-
inclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 126 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 127 |
ForwardIterator2 result, BinaryOperation binary_op);
|
| 128 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 129 |
class BinaryOperation, class T>
|
| 130 |
ForwardIterator2
|
| 131 |
-
inclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 132 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 133 |
ForwardIterator2 result, BinaryOperation binary_op, T init);
|
| 134 |
|
| 135 |
// [transform.exclusive.scan], transform exclusive scan
|
| 136 |
template<class InputIterator, class OutputIterator, class T,
|
|
@@ -140,11 +141,11 @@ namespace std {
|
|
| 140 |
OutputIterator result, T init,
|
| 141 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 142 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T,
|
| 143 |
class BinaryOperation, class UnaryOperation>
|
| 144 |
ForwardIterator2
|
| 145 |
-
transform_exclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 146 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 147 |
ForwardIterator2 result, T init,
|
| 148 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 149 |
|
| 150 |
// [transform.inclusive.scan], transform inclusive scan
|
|
@@ -161,18 +162,18 @@ namespace std {
|
|
| 161 |
OutputIterator result,
|
| 162 |
BinaryOperation binary_op, UnaryOperation unary_op, T init);
|
| 163 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 164 |
class BinaryOperation, class UnaryOperation>
|
| 165 |
ForwardIterator2
|
| 166 |
-
transform_inclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 167 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 168 |
ForwardIterator2 result, BinaryOperation binary_op,
|
| 169 |
UnaryOperation unary_op);
|
| 170 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 171 |
class BinaryOperation, class UnaryOperation, class T>
|
| 172 |
ForwardIterator2
|
| 173 |
-
transform_inclusive_scan(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 174 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 175 |
ForwardIterator2 result,
|
| 176 |
BinaryOperation binary_op, UnaryOperation unary_op, T init);
|
| 177 |
|
| 178 |
// [adjacent.difference], adjacent difference
|
|
@@ -184,17 +185,17 @@ namespace std {
|
|
| 184 |
constexpr OutputIterator
|
| 185 |
adjacent_difference(InputIterator first, InputIterator last,
|
| 186 |
OutputIterator result, BinaryOperation binary_op);
|
| 187 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
|
| 188 |
ForwardIterator2
|
| 189 |
-
adjacent_difference(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 190 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 191 |
ForwardIterator2 result);
|
| 192 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 193 |
class BinaryOperation>
|
| 194 |
ForwardIterator2
|
| 195 |
-
adjacent_difference(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
|
| 196 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 197 |
ForwardIterator2 result, BinaryOperation binary_op);
|
| 198 |
|
| 199 |
// [numeric.iota], iota
|
| 200 |
template<class ForwardIterator, class T>
|
|
@@ -223,8 +224,20 @@ namespace std {
|
|
| 223 |
// [numeric.ops.midpoint], midpoint
|
| 224 |
template<class T>
|
| 225 |
constexpr T midpoint(T a, T b) noexcept;
|
| 226 |
template<class T>
|
| 227 |
constexpr T* midpoint(T* a, T* b);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
}
|
| 229 |
```
|
| 230 |
|
|
|
|
| 1 |
## Header `<numeric>` synopsis <a id="numeric.ops.overview">[[numeric.ops.overview]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
// mostly freestanding
|
| 5 |
namespace std {
|
| 6 |
// [accumulate], accumulate
|
| 7 |
template<class InputIterator, class T>
|
| 8 |
constexpr T accumulate(InputIterator first, InputIterator last, T init);
|
| 9 |
template<class InputIterator, class T, class BinaryOperation>
|
|
|
|
| 19 |
template<class InputIterator, class T, class BinaryOperation>
|
| 20 |
constexpr T reduce(InputIterator first, InputIterator last, T init,
|
| 21 |
BinaryOperation binary_op);
|
| 22 |
template<class ExecutionPolicy, class ForwardIterator>
|
| 23 |
typename iterator_traits<ForwardIterator>::value_type
|
| 24 |
+
reduce(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 25 |
ForwardIterator first, ForwardIterator last);
|
| 26 |
template<class ExecutionPolicy, class ForwardIterator, class T>
|
| 27 |
+
T reduce(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 28 |
ForwardIterator first, ForwardIterator last, T init);
|
| 29 |
template<class ExecutionPolicy, class ForwardIterator, class T, class BinaryOperation>
|
| 30 |
+
T reduce(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 31 |
ForwardIterator first, ForwardIterator last, T init, BinaryOperation binary_op);
|
| 32 |
|
| 33 |
// [inner.product], inner product
|
| 34 |
template<class InputIterator1, class InputIterator2, class T>
|
| 35 |
constexpr T inner_product(InputIterator1 first1, InputIterator1 last1,
|
|
|
|
| 53 |
class BinaryOperation, class UnaryOperation>
|
| 54 |
constexpr T transform_reduce(InputIterator first, InputIterator last, T init,
|
| 55 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 56 |
template<class ExecutionPolicy,
|
| 57 |
class ForwardIterator1, class ForwardIterator2, class T>
|
| 58 |
+
T transform_reduce(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 59 |
ForwardIterator1 first1, ForwardIterator1 last1,
|
| 60 |
ForwardIterator2 first2, T init);
|
| 61 |
template<class ExecutionPolicy,
|
| 62 |
class ForwardIterator1, class ForwardIterator2, class T,
|
| 63 |
class BinaryOperation1, class BinaryOperation2>
|
| 64 |
+
T transform_reduce(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 65 |
ForwardIterator1 first1, ForwardIterator1 last1,
|
| 66 |
ForwardIterator2 first2, T init,
|
| 67 |
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
|
| 68 |
template<class ExecutionPolicy, class ForwardIterator, class T,
|
| 69 |
class BinaryOperation, class UnaryOperation>
|
| 70 |
+
T transform_reduce(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 71 |
ForwardIterator first, ForwardIterator last, T init,
|
| 72 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 73 |
|
| 74 |
// [partial.sum], partial sum
|
| 75 |
template<class InputIterator, class OutputIterator>
|
|
|
|
| 90 |
constexpr OutputIterator
|
| 91 |
exclusive_scan(InputIterator first, InputIterator last,
|
| 92 |
OutputIterator result, T init, BinaryOperation binary_op);
|
| 93 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
|
| 94 |
ForwardIterator2
|
| 95 |
+
exclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 96 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 97 |
ForwardIterator2 result, T init);
|
| 98 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T,
|
| 99 |
class BinaryOperation>
|
| 100 |
ForwardIterator2
|
| 101 |
+
exclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 102 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 103 |
ForwardIterator2 result, T init, BinaryOperation binary_op);
|
| 104 |
|
| 105 |
// [inclusive.scan], inclusive scan
|
| 106 |
template<class InputIterator, class OutputIterator>
|
|
|
|
| 115 |
constexpr OutputIterator
|
| 116 |
inclusive_scan(InputIterator first, InputIterator last,
|
| 117 |
OutputIterator result, BinaryOperation binary_op, T init);
|
| 118 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
|
| 119 |
ForwardIterator2
|
| 120 |
+
inclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 121 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 122 |
ForwardIterator2 result);
|
| 123 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 124 |
class BinaryOperation>
|
| 125 |
ForwardIterator2
|
| 126 |
+
inclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 127 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 128 |
ForwardIterator2 result, BinaryOperation binary_op);
|
| 129 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 130 |
class BinaryOperation, class T>
|
| 131 |
ForwardIterator2
|
| 132 |
+
inclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 133 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 134 |
ForwardIterator2 result, BinaryOperation binary_op, T init);
|
| 135 |
|
| 136 |
// [transform.exclusive.scan], transform exclusive scan
|
| 137 |
template<class InputIterator, class OutputIterator, class T,
|
|
|
|
| 141 |
OutputIterator result, T init,
|
| 142 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 143 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T,
|
| 144 |
class BinaryOperation, class UnaryOperation>
|
| 145 |
ForwardIterator2
|
| 146 |
+
transform_exclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 147 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 148 |
ForwardIterator2 result, T init,
|
| 149 |
BinaryOperation binary_op, UnaryOperation unary_op);
|
| 150 |
|
| 151 |
// [transform.inclusive.scan], transform inclusive scan
|
|
|
|
| 162 |
OutputIterator result,
|
| 163 |
BinaryOperation binary_op, UnaryOperation unary_op, T init);
|
| 164 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 165 |
class BinaryOperation, class UnaryOperation>
|
| 166 |
ForwardIterator2
|
| 167 |
+
transform_inclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 168 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 169 |
ForwardIterator2 result, BinaryOperation binary_op,
|
| 170 |
UnaryOperation unary_op);
|
| 171 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 172 |
class BinaryOperation, class UnaryOperation, class T>
|
| 173 |
ForwardIterator2
|
| 174 |
+
transform_inclusive_scan(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 175 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 176 |
ForwardIterator2 result,
|
| 177 |
BinaryOperation binary_op, UnaryOperation unary_op, T init);
|
| 178 |
|
| 179 |
// [adjacent.difference], adjacent difference
|
|
|
|
| 185 |
constexpr OutputIterator
|
| 186 |
adjacent_difference(InputIterator first, InputIterator last,
|
| 187 |
OutputIterator result, BinaryOperation binary_op);
|
| 188 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
|
| 189 |
ForwardIterator2
|
| 190 |
+
adjacent_difference(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 191 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 192 |
ForwardIterator2 result);
|
| 193 |
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
| 194 |
class BinaryOperation>
|
| 195 |
ForwardIterator2
|
| 196 |
+
adjacent_difference(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
|
| 197 |
ForwardIterator1 first, ForwardIterator1 last,
|
| 198 |
ForwardIterator2 result, BinaryOperation binary_op);
|
| 199 |
|
| 200 |
// [numeric.iota], iota
|
| 201 |
template<class ForwardIterator, class T>
|
|
|
|
| 224 |
// [numeric.ops.midpoint], midpoint
|
| 225 |
template<class T>
|
| 226 |
constexpr T midpoint(T a, T b) noexcept;
|
| 227 |
template<class T>
|
| 228 |
constexpr T* midpoint(T* a, T* b);
|
| 229 |
+
|
| 230 |
+
// [numeric.sat], saturation arithmetic
|
| 231 |
+
template<class T>
|
| 232 |
+
constexpr T add_sat(T x, T y) noexcept;
|
| 233 |
+
template<class T>
|
| 234 |
+
constexpr T sub_sat(T x, T y) noexcept;
|
| 235 |
+
template<class T>
|
| 236 |
+
constexpr T mul_sat(T x, T y) noexcept;
|
| 237 |
+
template<class T>
|
| 238 |
+
constexpr T div_sat(T x, T y) noexcept;
|
| 239 |
+
template<class T, class U>
|
| 240 |
+
constexpr T saturate_cast(U x) noexcept;
|
| 241 |
}
|
| 242 |
```
|
| 243 |
|