12 const bool include_last_point,
16 const int count = r_segment_indices.
size();
20 std::is_sorted(accumulated_segment_lengths.
begin(), accumulated_segment_lengths.
end()));
23 r_segment_indices[0] = 0;
27 const float total_length = accumulated_segment_lengths.
last();
28 const float step_length = total_length / (
count - include_last_point);
31 for (
const int i :
range) {
33 const float sample_length = std::min(total_length, i * step_length);
35 accumulated_segment_lengths, sample_length, r_segment_indices[i], r_factors[i], &hint);
41 const bool include_first_point,
45 const int count = r_segment_indices.
size();
49 std::is_sorted(accumulated_segment_lengths.
begin(), accumulated_segment_lengths.
end()));
52 r_segment_indices[0] = accumulated_segment_lengths.
size() - 1;
56 const float total_length = accumulated_segment_lengths.
last();
57 const float step_length = total_length / (
count - include_first_point);
60 for (
const int i :
range) {
62 const float sample_length = std::max(0.0f, total_length - i * step_length);
64 accumulated_segment_lengths, sample_length, r_segment_indices[i], r_factors[i], &hint);
75 std::is_sorted(accumulated_segment_lengths.
begin(), accumulated_segment_lengths.
end()));
84 for (
const int i :
range) {
85 const float sample_length = sample_lengths[i];
87 accumulated_segment_lengths, sample_length, r_segment_indices[i], r_factors[i], &hint);
constexpr int64_t size() const
constexpr int64_t size() const
constexpr const T & last(const int64_t n=0) const
constexpr const T * end() const
constexpr const T * begin() const
void sample_at_lengths(Span< float > accumulated_segment_lengths, Span< float > sample_lengths, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factors)
void sample_uniform_reverse(Span< float > accumulated_segment_lengths, bool include_first_point, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factors)
void sample_at_length(const Span< float > accumulated_segment_lengths, const float sample_length, int &r_segment_index, float &r_factor, SampleSegmentHint *hint=nullptr)
void sample_uniform(Span< float > accumulated_segment_lengths, bool include_last_point, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factors)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))