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),
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,
73 CPP_concept_ref(ranges::inner_product_constraints_, I1, I2, T, BOp1, BOp2, P1, P2);
78 template(
typename I1,
typename S1,
typename I2,
typename S2,
typename T,
81 requires sentinel_for<S1, I1> AND sentinel_for<S2, I2> AND
82 inner_product_constraints<I1, I2, T, BOp1, BOp2, P1, P2>)
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)
95 template(
typename I1,
typename S1,
typename I2,
typename T,
typename BOp1 =
plus,
98 requires sentinel_for<S1, I1> AND
99 inner_product_constraints<I1, I2, T, BOp1, BOp2, P1, P2>)
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>)(
118 requires range<Rng1> AND
119 inner_product_constraints<I1, I2, T, BOp1, BOp2, P1, P2>)
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,
137 requires range<Rng1> AND range<Rng2> AND
138 inner_product_constraints<I1, I2, T, BOp1, BOp2, P1, P2>)
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>
CPP_concept invocable
\concept invocable
Definition: concepts.hpp:48
CPP_concept inner_product_constraints
\concept inner_product_constraints
Definition: inner_product.hpp:70
decltype(begin(declval(Rng &))) iterator_t
Definition: access.hpp:698
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector >>, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition: conversion.hpp:399
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition: meta.hpp:541
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