libstdc++
|
Functions | |
template<typename _InputIterator , typename _Tp > | |
constexpr _Tp | std::accumulate (_InputIterator __first, _InputIterator __last, _Tp __init) |
template<typename _InputIterator , typename _Tp , typename _BinaryOperation > | |
constexpr _Tp | std::accumulate (_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op) |
template<typename _InputIterator , typename _OutputIterator > | |
constexpr _OutputIterator | std::adjacent_difference (_InputIterator __first, _InputIterator __last, _OutputIterator __result) |
template<typename _InputIterator , typename _OutputIterator , typename _BinaryOperation > | |
constexpr _OutputIterator | std::adjacent_difference (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op) |
template<typename _InputIterator , typename _OutputIterator , typename _Tp > | |
constexpr _OutputIterator | std::exclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init) |
template<typename _InputIterator , typename _OutputIterator , typename _Tp , typename _BinaryOperation > | |
constexpr _OutputIterator | std::exclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init, _BinaryOperation __binary_op) |
template<typename _InputIterator , typename _OutputIterator > | |
constexpr _OutputIterator | std::inclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result) |
template<typename _InputIterator , typename _OutputIterator , typename _BinaryOperation > | |
constexpr _OutputIterator | std::inclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op) |
template<typename _InputIterator , typename _OutputIterator , typename _BinaryOperation , typename _Tp > | |
constexpr _OutputIterator | std::inclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op, _Tp __init) |
template<typename _InputIterator1 , typename _InputIterator2 , typename _Tp > | |
constexpr _Tp | std::inner_product (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) |
template<typename _InputIterator1 , typename _InputIterator2 , typename _Tp , typename _BinaryOperation1 , typename _BinaryOperation2 > | |
constexpr _Tp | std::inner_product (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) |
template<typename _ForwardIterator , typename _Tp > | |
constexpr void | std::iota (_ForwardIterator __first, _ForwardIterator __last, _Tp __value) |
template<typename _InputIterator , typename _OutputIterator > | |
constexpr _OutputIterator | std::partial_sum (_InputIterator __first, _InputIterator __last, _OutputIterator __result) |
template<typename _InputIterator , typename _OutputIterator , typename _BinaryOperation > | |
constexpr _OutputIterator | std::partial_sum (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op) |
template<typename _InputIterator > | |
constexpr iterator_traits< _InputIterator >::value_type | std::reduce (_InputIterator __first, _InputIterator __last) |
template<typename _InputIterator , typename _Tp > | |
constexpr _Tp | std::reduce (_InputIterator __first, _InputIterator __last, _Tp __init) |
template<typename _InputIterator , typename _Tp , typename _BinaryOperation > | |
constexpr _Tp | std::reduce (_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op) |
template<typename _InputIterator , typename _OutputIterator , typename _Tp , typename _BinaryOperation , typename _UnaryOperation > | |
constexpr _OutputIterator | std::transform_exclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __unary_op) |
template<typename _InputIterator , typename _OutputIterator , typename _BinaryOperation , typename _UnaryOperation > | |
constexpr _OutputIterator | std::transform_inclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op) |
template<typename _InputIterator , typename _OutputIterator , typename _BinaryOperation , typename _UnaryOperation , typename _Tp > | |
constexpr _OutputIterator | std::transform_inclusive_scan (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op, _Tp __init) |
template<typename _InputIterator , typename _Tp , typename _BinaryOperation , typename _UnaryOperation > | |
constexpr _Tp | std::transform_reduce (_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __unary_op) |
template<typename _InputIterator1 , typename _InputIterator2 , typename _Tp > | |
constexpr _Tp | std::transform_reduce (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) |
template<typename _InputIterator1 , typename _InputIterator2 , typename _Tp , typename _BinaryOperation1 , typename _BinaryOperation2 > | |
constexpr _Tp | std::transform_reduce (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) |
|
inlineconstexpr |
Accumulate values in a range.
Accumulates the values in the range [first,last) using operator+(). The initial value is init. The values are processed in order.
__first | Start of range. |
__last | End of range. |
__init | Starting value to add other values to. |
Definition at line 134 of file stl_numeric.h.
|
inlineconstexpr |
Accumulate values in a range with operation.
Accumulates the values in the range [first,last)
using the function object __binary_op
. The initial value is __init
. The values are processed in order.
__first | Start of range. |
__last | End of range. |
__init | Starting value to add other values to. |
__binary_op | Function object to accumulate with. |
Definition at line 161 of file stl_numeric.h.
|
constexpr |
Return differences between adjacent values.
Computes the difference between adjacent values in the range [first,last) using operator-() and writes the result to __result
.
__first | Start of input range. |
__last | End of input range. |
__result | Output sums. |
Definition at line 337 of file stl_numeric.h.
|
constexpr |
Return differences between adjacent values.
Computes the difference between adjacent values in the range [__first,__last) using the function object __binary_op
and writes the result to __result
.
__first | Start of input range. |
__last | End of input range. |
__result | Output sum. |
__binary_op | Function object. |
Definition at line 380 of file stl_numeric.h.
|
inlineconstexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
__init | Initial value. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements (and the initial value), using std::plus<>
for summation.
This function generates an "exclusive" scan, meaning the Nth element of the output range is the sum of the first N-1 input elements, so the Nth input element is not included.
Definition at line 520 of file numeric.
References std::exclusive_scan(), and std::move().
|
constexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
__init | Initial value. |
__binary_op | Function to perform summation. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements (and the initial value), using binary_op
for summation.
This function generates an "exclusive" scan, meaning the Nth element of the output range is the sum of the first N-1 input elements, so the Nth input element is not included.
Definition at line 486 of file numeric.
References std::move().
Referenced by std::exclusive_scan().
|
inlineconstexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements, using std::plus<>
for summation.
This function generates an "inclusive" scan, meaning the Nth element of the output range is the sum of the first N input elements, so the Nth input element is included.
Definition at line 611 of file numeric.
References std::inclusive_scan().
|
constexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
__binary_op | Function to perform summation. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements, using binary_op
for summation.
This function generates an "inclusive" scan, meaning the Nth element of the output range is the sum of the first N input elements, so the Nth input element is included.
Definition at line 578 of file numeric.
References std::inclusive_scan(), and std::move().
|
constexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
__binary_op | Function to perform summation. |
__init | Initial value. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements (and the initial value), using binary_op
for summation.
This function generates an "inclusive" scan, meaning the Nth element of the output range is the sum of the first N input elements, so the Nth input element is included.
Definition at line 549 of file numeric.
Referenced by std::inclusive_scan(), and std::inclusive_scan().
|
inlineconstexpr |
Compute inner product of two ranges.
Starting with an initial value of __init
, multiplies successive elements from the two ranges and adds each product into the accumulated value using operator+(). The values in the ranges are processed in order.
__first1 | Start of range 1. |
__last1 | End of range 1. |
__first2 | Start of range 2. |
__init | Starting value to add other values to. |
Definition at line 190 of file stl_numeric.h.
|
inlineconstexpr |
Compute inner product of two ranges.
Starting with an initial value of __init
, applies __binary_op2
to successive elements from the two ranges and accumulates each result into the accumulated value using __binary_op1
. The values in the ranges are processed in order.
__first1 | Start of range 1. |
__last1 | End of range 1. |
__first2 | Start of range 2. |
__init | Starting value to add other values to. |
__binary_op1 | Function object to accumulate with. |
__binary_op2 | Function object to apply to pairs of input values. |
Definition at line 223 of file stl_numeric.h.
|
constexpr |
Create a range of sequentially increasing values.
For each element in the range [first,last) assigns
value
and increments value
as if by ++value
.
__first | Start of range. |
__last | End of range. |
__value | Starting value. |
Definition at line 88 of file stl_numeric.h.
References std::iota().
Referenced by std::iota().
|
constexpr |
Return list of partial sums.
Accumulates the values in the range [first,last) using the +
operator. As each successive input value is added into the total, that partial sum is written to __result
. Therefore, the first value in __result
is the first value of the input, the second value in __result
is the sum of the first and second input values, and so on.
__first | Start of input range. |
__last | End of input range. |
__result | Output sum. |
Definition at line 256 of file stl_numeric.h.
Referenced by __gnu_parallel::__parallel_random_shuffle_drs_pu(), and __gnu_parallel::__sequential_random_shuffle().
|
constexpr |
Return list of partial sums.
Accumulates the values in the range [first,last) using __binary_op
. As each successive input value is added into the total, that partial sum is written to __result
. Therefore, the first value in __result
is the first value of the input, the second value in __result
is the sum of the first and second input values, and so on.
__first | Start of input range. |
__last | End of input range. |
__result | Output sum. |
__binary_op | Function object. |
Definition at line 298 of file stl_numeric.h.
|
inlineconstexpr |
Calculate reduction of values in a range.
__first | Start of range. |
__last | End of range. |
Reduce the values in the range [first,last)
using addition, with an initial value of T{}
, where T
is the iterator's value type. Equivalent to calling std::reduce(first, last, T{}, std::plus<>())
.
Definition at line 346 of file numeric.
References std::reduce().
|
inlineconstexpr |
Calculate reduction of values in a range.
__first | Start of range. |
__last | End of range. |
__init | Starting value to add other values to. |
Reduce the values in the range [first,last)
using addition. Equivalent to calling std::reduce(first, last, init, std::plus<>())
.
Definition at line 329 of file numeric.
References std::move(), and std::reduce().
|
constexpr |
Calculate reduction of values in a range.
__first | Start of range. |
__last | End of range. |
__init | Starting value to add other values to. |
__binary_op | A binary function object. |
Reduce the values in the range [first,last)
using a binary operation. The initial value is init
. The values are not necessarily processed in order.
This algorithm is similar to std::accumulate
but is not required to perform the operations in order from first to last. For operations that are commutative and associative the result will be the same as for std::accumulate
, but for other operations (such as floating point arithmetic) the result can be different.
Definition at line 291 of file numeric.
Referenced by std::reduce(), and std::reduce().
|
constexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
__init | Initial value. |
__binary_op | Function to perform summation. |
__unary_op | Function to transform elements of the input range. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements (and the initial value), using __unary_op
to transform the input elements and using __binary_op
for summation.
This function generates an "exclusive" scan, meaning the Nth element of the output range is the sum of the first N-1 input elements, so the Nth input element is not included.
Definition at line 639 of file numeric.
References std::move().
|
constexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
__binary_op | Function to perform summation. |
__unary_op | Function to transform elements of the input range. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements, using __unary_op
to transform the input elements and using __binary_op
for summation.
This function generates an "inclusive" scan, meaning the Nth element of the output range is the sum of the first N input elements, so the Nth input element is included.
Definition at line 712 of file numeric.
References std::move(), and std::transform_inclusive_scan().
|
constexpr |
Output the cumulative sum of one range to a second range.
__first | Start of input range. |
__last | End of input range. |
__result | Start of output range. |
__binary_op | Function to perform summation. |
__unary_op | Function to transform elements of the input range. |
__init | Initial value. |
Write the cumulative sum (aka prefix sum, aka scan) of the input range to the output range. Each element of the output range contains the running total of all earlier elements (and the initial value), using __unary_op
to transform the input elements and using __binary_op
for summation.
This function generates an "inclusive" scan, meaning the Nth element of the output range is the sum of the first N input elements, so the Nth input element is included.
Definition at line 678 of file numeric.
Referenced by std::transform_inclusive_scan().
|
constexpr |
Transform the elements of a range and reduce.
__first | Start of range. |
__last | End of range. |
__init | Starting value to add other values to. |
__binary_op | The function used to perform reduction. |
__unary_op | The function used to transform values from the range. |
Call unary_op(first[n])
for each n
in [0,last-first)
and then use binary_op
to reduce the values returned by unary_op
to a single value of type T
.
|
inlineconstexpr |
Combine elements from two ranges and reduce.
__first1 | Start of first range. |
__last1 | End of first range. |
__first2 | Start of second range. |
__init | Starting value to add other values to. |
Call first1[n]*first2[n]
for each n
in [0,last1-first1)
and then use addition to sum those products to a single value of type T
.
The range beginning at first2
must contain at least last1-first1
elements.
Definition at line 417 of file numeric.
References std::move(), and std::transform_reduce().
|
constexpr |
Combine elements from two ranges and reduce.
__first1 | Start of first range. |
__last1 | End of first range. |
__first2 | Start of second range. |
__init | Starting value to add other values to. |
__binary_op1 | The function used to perform reduction. |
__binary_op2 | The function used to combine values from the ranges. |
Call binary_op2(first1[n],first2[n])
for each n
in [0,last1-first1)
and then use binary_op1
to reduce the values returned by binary_op2
to a single value of type T
.
The range beginning at first2
must contain at least last1-first1
elements.
Definition at line 374 of file numeric.
Referenced by std::transform_reduce().