42 std::vector<Index> sorted_ids(chart_ids.begin(), chart_ids.end());
43 tbb::parallel_sort(sorted_ids.begin(), sorted_ids.end());
44 sorted_ids.erase(std::unique(sorted_ids.begin(), sorted_ids.end()), sorted_ids.end());
45 const Index num_charts =
static_cast<Index
>(sorted_ids.size());
47 std::vector<Index> dense_chart_ids(chart_ids.size());
48 tbb::parallel_for(Index(0),
static_cast<Index
>(chart_ids.size()), [&](Index f) {
49 dense_chart_ids[f] = static_cast<Index>(
50 std::lower_bound(sorted_ids.begin(), sorted_ids.end(), chart_ids[f]) -
53 return {std::move(dense_chart_ids), num_charts};
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition attribute_string_utils.h:21
std::pair< std::vector< Index >, Index > compact_chart_ids(span< const Index > chart_ids)
Compact chart ids to a dense [0, N) range so per-chart storage is bounded by the number of distinct c...
Definition compact_chart_ids.h:40