31 static_assert(std::is_integral_v<T>);
52 return offsets_.
size() > 1 ? offsets_.
last() - offsets_.
first() : 0;
61 return std::max<int64_t>(offsets_.
size() - 1, 0);
66 return this->
size() == 0;
78 const int64_t begin = offsets_[index];
79 const int64_t end = offsets_[index + 1];
85 const int64_t begin = offsets_[indices.start()];
86 const int64_t end = offsets_[indices.one_after_last()];
127 return this->data.
slice(this->offsets[index]);
132 return this->offsets.
size();
142 return this->data.
size() == 0;
150 int start_offset = 0);
194using offset_indices::GroupedSpan;
195using offset_indices::OffsetIndices;
constexpr IndexRange drop_back(int64_t n) const
static constexpr IndexRange from_begin_end(const int64_t begin, const int64_t end)
constexpr bool contains(int64_t value) const
constexpr Span slice(int64_t start, int64_t size) const
constexpr const T & first() const
constexpr int64_t size() const
constexpr const T & last(const int64_t n=0) const
constexpr const T * end() const
constexpr IndexRange index_range() const
constexpr const T * begin() const
OffsetIndices(const Span< T > offsets)
OffsetIndices(const Span< T > offsets, NoSortCheck)
IndexRange index_range() const
IndexRange operator[](const int64_t index) const
OffsetIndices slice(const IndexRange range) const
IndexRange operator[](const IndexRange indices) const
void copy_group_sizes(OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
void build_reverse_map(OffsetIndices< int > offsets, MutableSpan< int > r_map)
OffsetIndices< int > accumulate_counts_to_offsets(MutableSpan< int > counts_to_offsets, int start_offset=0)
std::optional< OffsetIndices< int > > accumulate_counts_to_offsets_with_overflow_check(MutableSpan< int > counts_to_offsets, int start_offset=0)
void gather_group_sizes(OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
void fill_constant_group_size(int size, int start_offset, MutableSpan< int > offsets)
void build_reverse_offsets(Span< int > indices, MutableSpan< int > offsets)
int sum_group_sizes(OffsetIndices< int > offsets, const IndexMask &mask)
OffsetIndices< int > gather_selected_offsets(OffsetIndices< int > src_offsets, const IndexMask &selection, int start_offset, MutableSpan< int > dst_offsets)
GroupedSpan(OffsetIndices< int > offsets, Span< T > data)
OffsetIndices< int > offsets
IndexRange index_range() const
Span< T > operator[](const int64_t index) const