diff --git a/include/ddc/chunk.hpp b/include/ddc/chunk.hpp index a4137995a..b6115cfb9 100644 --- a/include/ddc/chunk.hpp +++ b/include/ddc/chunk.hpp @@ -449,7 +449,7 @@ class Chunk : public ChunkCommon SupportType::rank() == (0 + ... + DElems::size()), "Invalid number of dimensions"); static_assert((is_discrete_element_v && ...), "Expected DiscreteElements"); - assert(this->m_domain.is_inside(delems...)); + assert(this->m_domain.contains(delems...)); return DDC_MDSPAN_ACCESS_OP( this->m_allocation_mdspan, detail::array(this->m_domain.distance_from_front(delems...))); @@ -466,7 +466,7 @@ class Chunk : public ChunkCommon SupportType::rank() == (0 + ... + DElems::size()), "Invalid number of dimensions"); static_assert((is_discrete_element_v && ...), "Expected DiscreteElements"); - assert(this->m_domain.is_inside(delems...)); + assert(this->m_domain.contains(delems...)); return DDC_MDSPAN_ACCESS_OP( this->m_allocation_mdspan, detail::array(this->m_domain.distance_from_front(delems...))); diff --git a/include/ddc/chunk_span.hpp b/include/ddc/chunk_span.hpp index 0f25f6dd9..0594dc9e3 100644 --- a/include/ddc/chunk_span.hpp +++ b/include/ddc/chunk_span.hpp @@ -603,7 +603,7 @@ class ChunkSpan : public ChunkCommon && ...), "Expected DiscreteElements"); - assert(this->m_domain.is_inside(delems...)); + assert(this->m_domain.contains(delems...)); return DDC_MDSPAN_ACCESS_OP( this->m_allocation_mdspan, detail::array(this->m_domain.distance_from_front(delems...))); diff --git a/include/ddc/discrete_domain.hpp b/include/ddc/discrete_domain.hpp index 98eb37877..7b3beca6f 100644 --- a/include/ddc/discrete_domain.hpp +++ b/include/ddc/discrete_domain.hpp @@ -194,7 +194,7 @@ class DiscreteDomain } template - bool is_inside(DElems const&... delems) const noexcept + bool contains(DElems const&... delems) const noexcept { static_assert( sizeof...(DDims) == (0 + ... + DElems::size()), @@ -400,12 +400,12 @@ class DiscreteDomain<> return *this; } - static bool is_inside() noexcept + static bool contains() noexcept { return true; } - static bool is_inside(DiscreteElement<>) noexcept + static bool contains(DiscreteElement<>) noexcept { return true; } diff --git a/include/ddc/storage_discrete_domain.hpp b/include/ddc/storage_discrete_domain.hpp index 929197c33..79ba7fa32 100644 --- a/include/ddc/storage_discrete_domain.hpp +++ b/include/ddc/storage_discrete_domain.hpp @@ -274,7 +274,7 @@ class StorageDiscreteDomain // } template - KOKKOS_FUNCTION bool is_inside(DElems const&... delems) const noexcept + KOKKOS_FUNCTION bool contains(DElems const&... delems) const noexcept { static_assert( sizeof...(DDims) == (0 + ... + DElems::size()), @@ -296,7 +296,7 @@ class StorageDiscreteDomain sizeof...(DDims) == (0 + ... + DElems::size()), "Invalid number of dimensions"); static_assert((is_discrete_element_v && ...), "Expected DiscreteElements"); - assert(is_inside(delems...)); + assert(contains(delems...)); return DiscreteVector( (detail::lower_bound( get(m_views).data(), @@ -502,12 +502,12 @@ class StorageDiscreteDomain // return *this; // } -// static bool is_inside() noexcept +// static bool contains() noexcept // { // return true; // } -// static bool is_inside(DiscreteElement<>) noexcept +// static bool contains(DiscreteElement<>) noexcept // { // return true; // } diff --git a/include/ddc/strided_discrete_domain.hpp b/include/ddc/strided_discrete_domain.hpp index 74b3b4fec..2b2b793e9 100644 --- a/include/ddc/strided_discrete_domain.hpp +++ b/include/ddc/strided_discrete_domain.hpp @@ -219,7 +219,7 @@ class StridedDiscreteDomain // } template - KOKKOS_FUNCTION bool is_inside(DElems const&... delems) const noexcept + KOKKOS_FUNCTION bool contains(DElems const&... delems) const noexcept { static_assert( sizeof...(DDims) == (0 + ... + DElems::size()), @@ -251,7 +251,7 @@ class StridedDiscreteDomain sizeof...(DDims) == (0 + ... + DElems::size()), "Invalid number of dimensions"); static_assert((is_discrete_element_v && ...), "Expected DiscreteElements"); - assert(is_inside(delems...)); + assert(contains(delems...)); return DiscreteVector( ((DiscreteElement(take(delems...)) - DiscreteElement(m_element_begin)) @@ -455,12 +455,12 @@ class StridedDiscreteDomain<> return *this; } - static bool is_inside() noexcept + static bool contains() noexcept { return true; } - static bool is_inside(DiscreteElement<>) noexcept + static bool contains(DiscreteElement<>) noexcept { return true; } diff --git a/tests/discrete_domain.cpp b/tests/discrete_domain.cpp index 41b5908fc..c51ad4b78 100644 --- a/tests/discrete_domain.cpp +++ b/tests/discrete_domain.cpp @@ -248,8 +248,8 @@ TEST(DiscreteDomainTest, Remove) TEST(DiscreteDomainTest, IsInside) { DDomXY const dom_x_y(lbound_x_y, nelems_x_y); - EXPECT_TRUE(dom_x_y.is_inside(lbound_x_y)); - EXPECT_FALSE(dom_x_y.is_inside(lbound_x_y + nelems_x_y)); + EXPECT_TRUE(dom_x_y.contains(lbound_x_y)); + EXPECT_FALSE(dom_x_y.contains(lbound_x_y + nelems_x_y)); } TEST(DiscreteDomainTest, DistanceFromFront) diff --git a/tests/storage_discrete_domain.cpp b/tests/storage_discrete_domain.cpp index 6696deeb6..22845b7a2 100644 --- a/tests/storage_discrete_domain.cpp +++ b/tests/storage_discrete_domain.cpp @@ -97,5 +97,5 @@ TEST(StorageDiscreteDomainTest, Constructor) EXPECT_EQ(dom_xy.distance_from_front(lbound_x + 2, lbound_y + 0), DVectXY(1, 0)); EXPECT_EQ(dom_xy.distance_from_front(lbound_x + 2, lbound_y + 2), DVectXY(1, 1)); EXPECT_EQ(dom_xy.distance_from_front(lbound_x + 2, lbound_y + 5), DVectXY(1, 2)); - EXPECT_FALSE(dom_xy.is_inside(lbound_x + 1, lbound_y + 0)); + EXPECT_FALSE(dom_xy.contains(lbound_x + 1, lbound_y + 0)); } diff --git a/tests/strided_discrete_domain.cpp b/tests/strided_discrete_domain.cpp index f4d8cb313..1792e3f42 100644 --- a/tests/strided_discrete_domain.cpp +++ b/tests/strided_discrete_domain.cpp @@ -260,8 +260,8 @@ TEST(StridedDiscreteDomainTest, Remove) TEST(StridedDiscreteDomainTest, IsInside) { DDomXY const dom_x_y(lbound_x_y, nelems_x_y, strides_x_y); - EXPECT_TRUE(dom_x_y.is_inside(lbound_x_y)); - EXPECT_FALSE(dom_x_y.is_inside(lbound_x_y + DVectXY(1, 1))); + EXPECT_TRUE(dom_x_y.contains(lbound_x_y)); + EXPECT_FALSE(dom_x_y.contains(lbound_x_y + DVectXY(1, 1))); } TEST(StridedDiscreteDomainTest, DistanceFromFront)