diff options
author | pavelgur <pavelgur@yandex-team.ru> | 2022-02-10 16:50:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:19 +0300 |
commit | db222959b3748242024c781f563f31a342492476 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/accurate_accumulate | |
parent | 173c6a0fa7f439b2c207c2f258e52ccb4ac181cf (diff) | |
download | ydb-db222959b3748242024c781f563f31a342492476.tar.gz |
Restoring authorship annotation for <pavelgur@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/accurate_accumulate')
-rw-r--r-- | library/cpp/accurate_accumulate/accurate_accumulate.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/accurate_accumulate/accurate_accumulate.h b/library/cpp/accurate_accumulate/accurate_accumulate.h index 53ff04ef09..dacced17e9 100644 --- a/library/cpp/accurate_accumulate/accurate_accumulate.h +++ b/library/cpp/accurate_accumulate/accurate_accumulate.h @@ -143,41 +143,41 @@ static inline TAccumulatorType TypedFastAccumulate(It begin, It end) { return accumulator; } -template <class TOperation, typename TAccumulatorType, typename It1, typename It2> -static inline TAccumulatorType TypedFastInnerOperation(It1 begin1, It1 end1, It2 begin2) { +template <class TOperation, typename TAccumulatorType, typename It1, typename It2> +static inline TAccumulatorType TypedFastInnerOperation(It1 begin1, It1 end1, It2 begin2) { TAccumulatorType accumulator = TAccumulatorType(); - const TOperation op; + const TOperation op; for (; begin1 + 15 < end1; begin1 += 16, begin2 += 16) { - accumulator += op(*(begin1 + 0), *(begin2 + 0)) + - op(*(begin1 + 1), *(begin2 + 1)) + - op(*(begin1 + 2), *(begin2 + 2)) + - op(*(begin1 + 3), *(begin2 + 3)) + - op(*(begin1 + 4), *(begin2 + 4)) + - op(*(begin1 + 5), *(begin2 + 5)) + - op(*(begin1 + 6), *(begin2 + 6)) + - op(*(begin1 + 7), *(begin2 + 7)) + - op(*(begin1 + 8), *(begin2 + 8)) + - op(*(begin1 + 9), *(begin2 + 9)) + - op(*(begin1 + 10), *(begin2 + 10)) + - op(*(begin1 + 11), *(begin2 + 11)) + - op(*(begin1 + 12), *(begin2 + 12)) + - op(*(begin1 + 13), *(begin2 + 13)) + - op(*(begin1 + 14), *(begin2 + 14)) + - op(*(begin1 + 15), *(begin2 + 15)); + accumulator += op(*(begin1 + 0), *(begin2 + 0)) + + op(*(begin1 + 1), *(begin2 + 1)) + + op(*(begin1 + 2), *(begin2 + 2)) + + op(*(begin1 + 3), *(begin2 + 3)) + + op(*(begin1 + 4), *(begin2 + 4)) + + op(*(begin1 + 5), *(begin2 + 5)) + + op(*(begin1 + 6), *(begin2 + 6)) + + op(*(begin1 + 7), *(begin2 + 7)) + + op(*(begin1 + 8), *(begin2 + 8)) + + op(*(begin1 + 9), *(begin2 + 9)) + + op(*(begin1 + 10), *(begin2 + 10)) + + op(*(begin1 + 11), *(begin2 + 11)) + + op(*(begin1 + 12), *(begin2 + 12)) + + op(*(begin1 + 13), *(begin2 + 13)) + + op(*(begin1 + 14), *(begin2 + 14)) + + op(*(begin1 + 15), *(begin2 + 15)); } for (; begin1 != end1; ++begin1, ++begin2) { - accumulator += op(*begin1, *begin2); + accumulator += op(*begin1, *begin2); } return accumulator; } -template <typename TAccumulatorType, typename It1, typename It2> -static inline TAccumulatorType TypedFastInnerProduct(It1 begin1, It1 end1, It2 begin2) { - return TypedFastInnerOperation<std::multiplies<>, TAccumulatorType>(begin1, end1, begin2); -} - +template <typename TAccumulatorType, typename It1, typename It2> +static inline TAccumulatorType TypedFastInnerProduct(It1 begin1, It1 end1, It2 begin2) { + return TypedFastInnerOperation<std::multiplies<>, TAccumulatorType>(begin1, end1, begin2); +} + template <typename It> static inline double FastAccumulate(It begin, It end) { return TypedFastAccumulate<double>(begin, end); |