aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/accurate_accumulate/accurate_accumulate.h
diff options
context:
space:
mode:
authorpavelgur <pavelgur@yandex-team.ru>2022-02-10 16:50:19 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:19 +0300
commit173c6a0fa7f439b2c207c2f258e52ccb4ac181cf (patch)
treeccc1431399e20197a8533f3d4bd0eb9a4bb8db62 /library/cpp/accurate_accumulate/accurate_accumulate.h
parentda16e7702d9b0a8a42761ad877f102ef6aa85ec0 (diff)
downloadydb-173c6a0fa7f439b2c207c2f258e52ccb4ac181cf.tar.gz
Restoring authorship annotation for <pavelgur@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/accurate_accumulate/accurate_accumulate.h')
-rw-r--r--library/cpp/accurate_accumulate/accurate_accumulate.h50
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 dacced17e9..53ff04ef09 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);