From f2481a51d45a9365906208726b923a877d7fa327 Mon Sep 17 00:00:00 2001 From: Roland Haas Date: Tue, 23 Jun 2020 15:39:37 -0500 Subject: [PATCH 1/2] CarpetLib: add std namespace to CARPET_AVOID_LAMBDA code --- CarpetLib/src/bboxset2.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CarpetLib/src/bboxset2.hh b/CarpetLib/src/bboxset2.hh index 4d8dc93a7..ea8a7ec9b 100644 --- a/CarpetLib/src/bboxset2.hh +++ b/CarpetLib/src/bboxset2.hh @@ -219,7 +219,7 @@ template class bboxset { iter0 != end0 ? iter0->first : numeric_limits::max(); \ const T next_pos1 = \ iter1 != end1 ? iter1->first : numeric_limits::max(); \ - const T pos = min(next_pos0, next_pos1); \ + const T pos = std::min(next_pos0, next_pos1); \ const bool active0 = next_pos0 == pos; \ const bool active1 = next_pos1 == pos; \ const bboxset1 *const subset0p = active0 ? iter0->second.get() : 0; \ From 4c15abdd6eab358d23584bb289b9f5e35d6cc3be Mon Sep 17 00:00:00 2001 From: Roland Haas Date: Tue, 23 Jun 2020 15:40:01 -0500 Subject: [PATCH 2/2] CarpetLib: provide shift and expand by int wrappers for bboxset1 --- CarpetLib/src/bboxset1.hh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CarpetLib/src/bboxset1.hh b/CarpetLib/src/bboxset1.hh index 96fa77015..dd4746684 100644 --- a/CarpetLib/src/bboxset1.hh +++ b/CarpetLib/src/bboxset1.hh @@ -190,12 +190,25 @@ public: return expand(lohi[0], lohi[1], denom); } + /** Expand the set (convolute with a bbox) */ + bboxset expand(const T &lo, const T &hi) const { + return expand(vect(lo), vect(hi)); + } + + /** Expand the set (convolute with a bbox) */ + bboxset expand(const T &lohi) const { return expand(lohi, lohi); } + /** Shift the bboxset by multiples of a fraction of the stride. */ // cost: O(n) bboxset shift(const vect &v, const vect &denom) const { return expand(-v, v, denom); } + /** Shift all points */ + bboxset shift(const vect &dist, const T &dist_denom) const { + return shift(dist, vect(dist_denom)); + } + /** Find the smallest b-compatible box around this bbox. ("compatible" means having the same stride.) */ bboxset expanded_for(const box &b) const CCTK_MEMBER_ATTRIBUTE_PURE;