36 static_assert(std::is_integral_v<T>);
44 BLI_assert(offsets_.size() < 2 || std::is_sorted(offsets_.begin(), offsets_.end()));
57 return offsets_.size() > 1 ? offsets_.last() - offsets_.first() : 0;
66 return std::max<int64_t>(offsets_.size() - 1, 0);
71 return this->
size() == 0;
84 const int64_t end = offsets_[index + 1];
132 return this->data.
slice(this->offsets[index]);
137 return this->offsets.
size();
147 return this->data.
size() == 0;
155 int start_offset = 0);
200using offset_indices::GroupedSpan;
201using offset_indices::OffsetIndices;
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
constexpr int64_t last(const int64_t n=0) const
constexpr int64_t size() const
constexpr bool is_empty() const
static constexpr IndexRange from_begin_end(const int64_t begin, const int64_t end)
constexpr int64_t start() const
constexpr Span slice(int64_t start, int64_t size) const
constexpr int64_t size() 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
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
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