14#ifndef RANGES_V3_NUMERIC_INNER_PRODUCT_HPP
15#define RANGES_V3_NUMERIC_INNER_PRODUCT_HPP
29#include <range/v3/utility/static_const.hpp>
31#include <range/v3/detail/prologue.hpp>
40 template(
typename I1,
typename I2,
typename T,
typename BOp1,
typename BOp2,
41 typename P1,
typename P2)(
42 concept (inner_product_constraints_)(I1, I2, T, BOp1, BOp2, P1, P2),
43 invocable<P1&, iter_value_t<I1>> AND
44 invocable<P2&, iter_value_t<I2>> AND
47 invoke_result_t<P1&, iter_value_t<I1>>,
48 invoke_result_t<P2&, iter_value_t<I2>>> AND
54 invoke_result_t<P1&, iter_value_t<I1>>,
55 invoke_result_t<P2&, iter_value_t<I2>>>> AND
63 invoke_result_t<P1&, iter_value_t<I1>>,
64 invoke_result_t<P2&, iter_value_t<I2>>>>>
68 template<
typename I1,
typename I2,
typename T,
typename BOp1 =
plus,
69 typename BOp2 =
multiplies,
typename P1 = identity,
typename P2 = identity>
70 CPP_concept inner_product_constraints =
78 template(
typename I1,
typename S1,
typename I2,
typename S2,
typename T,
83 T operator()(I1 begin1, S1 end1, I2 begin2, S2 end2, T init,
84 BOp1 bop1 = BOp1{}, BOp2 bop2 = BOp2{}, P1 proj1 = P1{},
85 P2 proj2 = P2{})
const
87 for(; begin1 != end1 && begin2 != end2; ++begin1, ++begin2)
91 invoke(bop2, invoke(proj1, *begin1), invoke(proj2, *begin2)));
95 template(
typename I1,
typename S1,
typename I2,
typename T,
typename BOp1 =
plus,
100 T operator()(I1 begin1, S1 end1, I2 begin2, T init, BOp1 bop1 = BOp1{},
101 BOp2 bop2 = BOp2{}, P1 proj1 = P1{}, P2 proj2 = P2{})
const
103 return (*
this)(std::move(begin1),
114 template(
typename Rng1,
typename I2Ref,
typename T,
typename BOp1 =
plus,
117 typename I2 = uncvref_t<I2Ref>)(
120 T operator()(Rng1 && rng1, I2Ref && begin2, T init, BOp1 bop1 = BOp1{},
121 BOp2 bop2 = BOp2{}, P1 proj1 = P1{}, P2 proj2 = P2{})
const
123 return (*
this)(begin(rng1),
125 static_cast<I2Ref &&
>(begin2),
133 template(
typename Rng1,
typename Rng2,
typename T,
typename BOp1 =
plus,
139 T operator()(Rng1 && rng1, Rng2 && rng2, T init, BOp1 bop1 = BOp1{},
140 BOp2 bop2 = BOp2{}, P1 proj1 = P1{}, P2 proj2 = P2{})
const
142 return (*
this)(begin(rng1),
158#include <range/v3/detail/epilogue.hpp>
The inner_product_constraints_ concept.
The inner_product_constraints concept.
The sentinel_for concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
std::integral_constant< decltype(T::type::value *U::type::value), T::type::value *U::type::value > multiplies
An integral constant wrapper around the result of multiplying the two wrapped integers T::type::value...
Definition meta.hpp:211
std::integral_constant< decltype(T::type::value+U::type::value), T::type::value+U::type::value > plus
An integral constant wrapper around the result of adding the two wrapped integers T::type::value and ...
Definition meta.hpp:197
Definition identity.hpp:25
Definition inner_product.hpp:77
Definition arithmetic.hpp:45
Definition arithmetic.hpp:25