From 4543e712b3b576535991d1210bdb6a645abd823d Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Thu, 27 Jan 2022 20:41:08 +0100 Subject: [PATCH] Templatize RankMap --- atrip.org | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/atrip.org b/atrip.org index 8d06e58..e38133b 100644 --- a/atrip.org +++ b/atrip.org @@ -549,6 +549,8 @@ namespace atrip { #include namespace atrip { + + template struct RankMap { std::vector const lengths; @@ -561,7 +563,7 @@ namespace atrip { 1UL, std::multiplies())) { assert(lengths.size() <= 2); } - size_t find(Slice::Location const& p) const noexcept { + size_t find(typename Slice::Location const& p) const noexcept { return p.source * np + p.rank; } @@ -581,10 +583,10 @@ namespace atrip { return source == nSources() && isPaddingRank(rank); } - Slice::Location - find(ABCTuple const& abc, Slice::Type sliceType) const noexcept { + typename Slice::Location + find(ABCTuple const& abc, typename Slice::Type sliceType) const noexcept { // tuple = {11, 8} when abc = {11, 8, 9} and sliceType = AB - const auto tuple = Slice::subtupleBySlice(abc, sliceType); + const auto tuple = Slice::subtupleBySlice(abc, sliceType); const size_t index = tuple[0]