39 static_assert(std::is_integral_v<T>);
47 BLI_assert(offsets_.size() < 2 || std::is_sorted(offsets_.begin(), offsets_.end()));
60 return offsets_.size() > 1 ? offsets_.last() - offsets_.first() : 0;
69 return std::max<int64_t>(offsets_.size() - 1, 0);
74 return this->
size() == 0;
135 return this->data.
slice(this->offsets[
index]);
140 return this->offsets.
size();
150 return this->data.
size() == 0;
158 int start_offset = 0);
252 int value_group_size);
281using offset_indices::GroupedSpan;
282using offset_indices::OffsetIndices;
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
constexpr int64_t one_after_last() const
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 IndexRange()=default
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
void sort_groups(OffsetIndices< int > groups, MutableSpan< int > indices)
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)
GroupedSpan< int > build_groups_from_indices(Span< int > indices, int groups_num, Array< int > &offset_data, Array< int > &index_data)
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)
OffsetIndices< int > build_reverse_offsets(Span< int > indices, MutableSpan< int > offsets)
void fill_constant_group_size(int size, int start_offset, MutableSpan< int > offsets)
void reverse_indices_in_groups(Span< int > group_indices, OffsetIndices< int > offsets, MutableSpan< int > results, bool sort=true)
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)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
GroupedSpan(OffsetIndices< int > offsets, Span< T > data)
OffsetIndices< int > offsets
IndexRange index_range() const
Span< T > operator[](const int64_t index) const