c_inner_product overloads
Declared in <absl/algorithm/container.h>
Container-based version of the <numeric> std::inner_product() function to compute the cumulative inner product of container element pairs.
template<
typename Sequence1,
typename Sequence2,
typename T>
constexpr
std::decay_t<T>
c_inner_product(
Sequence1 const& factors1,
Sequence2 const& factors2,
T&& sum);
» more...
Overload of c_inner_product() for using binary operations other than operator+ (for computing the accumulation) and operator* (for computing the product between the two container's element pair).
template<
typename Sequence1,
typename Sequence2,
typename T,
typename BinaryOp1,
typename BinaryOp2>
constexpr
std::decay_t<T>
c_inner_product(
Sequence1 const& factors1,
Sequence2 const& factors2,
T&& sum,
BinaryOp1&& op1,
BinaryOp2&& op2);
» more...
The computed inner product.
| Name | Description |
|---|---|
| factors1 | The first container of factors. |
| factors2 | The second container of factors. |
| sum | The initial value of the accumulation. |
| op1 | The binary operation used to accumulate the products. |
| op2 | The binary operation used to combine element pairs. |