32 template<
typename InputIterator1,
typename InputIterator2,
typename T = value_type_i<InputIterator1>>
33 T
dot(InputIterator1 first_left, InputIterator1 last_left, InputIterator2 first_right, T init = T{})
35 return std::inner_product(first_left, last_left, first_right, init);
42 template<
typename Container1,
typename Container2,
typename T = value_type<Container1>>
43 T
dot(
const Container1& a, Container2& b, T init = T{})
45 assert(a.size() == b.size());
48 return dot(begin(a), end(a), begin(b), init);
54 template<
typename InputIterator,
typename T = value_type_i<InputIterator>>
55 T
squared_norm(InputIterator first, InputIterator last, T init = T{})
57 return dot(first, last, first, init);
63 template<
typename Container,
typename T = value_type<Container>>
75 template<
typename InputIterator,
typename T = value_type_i<InputIterator>>
76 sqrt_type_t<T>
norm(InputIterator first, InputIterator last, T init = T{})
85 template<
typename Container,
typename T = value_type<Container>>
86 sqrt_type_t<T>
norm(
const Container& a, T init = T{})
90 return norm(begin(a), end(a), init);
96 template<
typename InputIterator1,
typename InputIterator2,
typename T = value_type_i<InputIterator1>>
97 T
squared_distance(InputIterator1 first_left, InputIterator1 last_left, InputIterator2 first_right, T init = T{})
99 auto op1 = [](
const T left,
const T right) -> T
103 auto op2 = [](
const auto left,
const auto right) -> T
105 return (left - right) * (left - right);
107 return std::inner_product(first_left, last_left, first_right, init, op1, op2);
114 template<
typename Container1,
typename Container2,
typename T = value_type<Container1>>
117 assert(left.size() == right.size());
127 template<
typename InputIterator1,
typename InputIterator2,
typename T = value_type_i<InputIterator1>>
128 sqrt_type_t<T>
distance(InputIterator1 first_left, InputIterator1 last_left, InputIterator2 first_right, T init = T{})
138 template<
typename Container1,
typename Container2,
typename T = value_type<Container1>>
139 sqrt_type_t<T>
distance(
const Container1& left,
const Container2& right, T init = T{})
141 assert(left.size() == right.size());
144 return distance(begin(left), end(left), begin(right), init);
T dot(const Container1 &a, Container2 &b, T init=T{})
Definition: euclidean_space.hpp:43
T squared_distance(const Container1 &left, const Container2 &right, T init=T{})
Definition: euclidean_space.hpp:115
sqrt_type_t< T > distance(const Container1 &left, const Container2 &right, T init=T{})
Definition: euclidean_space.hpp:139
T squared_norm(const Container &a, T init=T{})
Definition: euclidean_space.hpp:64
sqrt_type_t< T > norm(const Container &a, T init=T{})
Definition: euclidean_space.hpp:86