diff options
author | alex-sh <alex-sh@yandex-team.ru> | 2022-02-10 16:50:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:03 +0300 |
commit | 88ee78b1a163eaddee7e880ac73943456040fce0 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/algorithm.h | |
parent | 3196904c9f5bf7aff7374eeadcb0671589581f61 (diff) | |
download | ydb-88ee78b1a163eaddee7e880ac73943456040fce0.tar.gz |
Restoring authorship annotation for <alex-sh@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/algorithm.h')
-rw-r--r-- | util/generic/algorithm.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h index 86e8583047..badfb88993 100644 --- a/util/generic/algorithm.h +++ b/util/generic/algorithm.h @@ -469,34 +469,34 @@ template <typename C, typename Val> Val Accumulate(const C& c, Val val) { // std::move since C++20 return Accumulate(std::begin(c), std::end(c), std::move(val)); -} - +} + template <typename C, typename Val, typename BinOp> Val Accumulate(const C& c, Val val, BinOp binOp) { // std::move since C++20 return Accumulate(std::begin(c), std::end(c), std::move(val), binOp); -} - +} + template <typename It1, typename It2, typename Val> static inline Val InnerProduct(It1 begin1, It1 end1, It2 begin2, Val val) { return std::inner_product(begin1, end1, begin2, val); } template <typename It1, typename It2, typename Val, typename BinOp1, typename BinOp2> -static inline Val InnerProduct(It1 begin1, It1 end1, It2 begin2, Val val, BinOp1 binOp1, BinOp2 binOp2) { +static inline Val InnerProduct(It1 begin1, It1 end1, It2 begin2, Val val, BinOp1 binOp1, BinOp2 binOp2) { return std::inner_product(begin1, end1, begin2, val, binOp1, binOp2); -} - +} + template <typename TVectorType> static inline typename TVectorType::value_type InnerProduct(const TVectorType& lhs, const TVectorType& rhs, typename TVectorType::value_type val = typename TVectorType::value_type()) { return std::inner_product(lhs.begin(), lhs.end(), rhs.begin(), val); -} - +} + template <typename TVectorType, typename BinOp1, typename BinOp2> static inline typename TVectorType::value_type InnerProduct(const TVectorType& lhs, const TVectorType& rhs, typename TVectorType::value_type val, BinOp1 binOp1, BinOp2 binOp2) { return std::inner_product(lhs.begin(), lhs.end(), rhs.begin(), val, binOp1, binOp2); -} - +} + template <class T> static inline T MinElement(T begin, T end) { return std::min_element(begin, end); |