From 8c64423052c3d745ecffc19b229e8b703e69c695 Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Fri, 1 Oct 2021 17:42:57 +0200 Subject: [PATCH] Fix accumulate bug --- atrip.org | 6 +++--- include/atrip/RankMap.hpp | 2 +- include/atrip/SliceUnion.hpp | 2 +- include/atrip/Tuples.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/atrip.org b/atrip.org index 3343246..e5529fd 100644 --- a/atrip.org +++ b/atrip.org @@ -546,7 +546,7 @@ namespace atrip { : lengths(lens) , np(np_) , size(std::accumulate(lengths.begin(), lengths.end(), - 1, std::multiplies())) + 1UL, std::multiplies())) { assert(lengths.size() <= 2); } size_t find(Slice::Location const& p) const noexcept { @@ -933,7 +933,7 @@ namespace atrip { std::vector (std::accumulate(sliceLength.begin(), sliceLength.end(), - 1, std::multiplies()))) + 1UL, std::multiplies()))) , name(name_) , sliceTypes(sliceTypes_) , sliceBuffers(nSliceBuffers, sources[0]) @@ -1190,7 +1190,7 @@ namespace atrip { == ( std::accumulate(n_tuples_per_rank.begin(), n_tuples_per_rank.end(), - 0) + 0UL) + nExtraInvalid )); #endif diff --git a/include/atrip/RankMap.hpp b/include/atrip/RankMap.hpp index d438234..82bb674 100644 --- a/include/atrip/RankMap.hpp +++ b/include/atrip/RankMap.hpp @@ -16,7 +16,7 @@ namespace atrip { : lengths(lens) , np(np_) , size(std::accumulate(lengths.begin(), lengths.end(), - 1, std::multiplies())) + 1UL, std::multiplies())) { assert(lengths.size() <= 2); } size_t find(Slice::Location const& p) const noexcept { diff --git a/include/atrip/SliceUnion.hpp b/include/atrip/SliceUnion.hpp index 66d149e..060dcc2 100644 --- a/include/atrip/SliceUnion.hpp +++ b/include/atrip/SliceUnion.hpp @@ -340,7 +340,7 @@ namespace atrip { std::vector (std::accumulate(sliceLength.begin(), sliceLength.end(), - 1, std::multiplies()))) + 1UL, std::multiplies()))) , name(name_) , sliceTypes(sliceTypes_) , sliceBuffers(nSliceBuffers, sources[0]) diff --git a/include/atrip/Tuples.hpp b/include/atrip/Tuples.hpp index d32bf33..83f6237 100644 --- a/include/atrip/Tuples.hpp +++ b/include/atrip/Tuples.hpp @@ -51,7 +51,7 @@ namespace atrip { == ( std::accumulate(n_tuples_per_rank.begin(), n_tuples_per_rank.end(), - 0) + 0UL) + nExtraInvalid )); #endif