76 static constexpr size_t MAX = std::numeric_limits<size_t>::max();
80 DataRegion(std::pair<size_t, size_t> b,
size_t m_reps,
size_t m_stride)
82 end((b.second!=MAX && b.second+1==b.first+m_stride) ?
83 b.second+m_reps*m_stride : b.second),
84 reps((b.second==MAX || b.second+1==b.first+m_stride) ? 0 : m_reps),
85 stride(reps == 0 ? MAX : m_stride)
87 fenix_assert(start <= end);
88 fenix_assert(stride != MAX || reps == 0);
89 fenix_assert(reps == 0 || start+stride > end);
93 std::pair<size_t, size_t> range()
const;
98 bool operator==(
const DataRegion& other)
const;
99 bool operator!=(
const DataRegion& other)
const;
102 bool operator<(
const DataRegion& other)
const;
105 bool operator&&(
const DataRegion& other)
const;
108 std::set<DataRegion> operator&(
const DataRegion& other)
const;
111 std::set<DataRegion> operator-(
const DataRegion& other)
const;
116 DataRegion get_reps(
size_t first,
size_t last)
const;
122 std::optional<DataRegion> try_merge(
const DataRegion& other)
const;
124 std::string str()
const;
138 static constexpr size_t MAX = detail::DataRegion::MAX;
154 DataSubset(std::pair<size_t, size_t> b,
size_t n,
size_t stride);
156 DataSubset(std::vector<std::pair<size_t, size_t>> bounds);
163 explicit DataSubset(SubsetType special_type) : type(special_type) { };
172 bool operator==(
const DataSubset& other)
const;
173 bool operator!=(
const DataSubset& other)
const;
178 std::pair<size_t, size_t> range()
const;
180 size_t start()
const;
185 size_t count(
size_t max_index)
const;
189 size_t max_count()
const;
200 void deserialize_data(
207 const size_t elm_size,
const size_t src_len,
const char* src,
DataBuffer& dst
211 const size_t elm_size,
const DataBuffer& src,
const size_t dst_len,
216 bool includes(
size_t idx)
const;
218 bool includes_all(
size_t end)
const;
221 std::set<detail::DataRegion> bounded_regions(
size_t max_index)
const;
223 std::set<detail::DataRegion> bounded_regions(
size_t start,
size_t end)
const;
225 std::string str()
const;
228 std::set<detail::DataRegion> regions;
230 SubsetType type = BasicSubset;
234 void merge_regions();