571{
572 const auto segments = static_cast<size_t>(num_segments);
573
576
577 for (Eigen::Index i = 0; i < num_samples; ++i) {
578 const double t_global = static_cast<double>(i) / static_cast<double>(num_samples - 1);
579 const double segment_float = t_global * static_cast<double>(num_segments);
580 auto seg_idx = static_cast<Eigen::Index>(std::floor(segment_float));
581
582 if (i == num_samples - 1 || seg_idx >= num_segments) {
583 seg_idx = num_segments - 1;
584 }
585
586 const auto s = static_cast<size_t>(seg_idx);
589 }
591 }
592
594
595 for (Eigen::Index seg_idx = 0; seg_idx < num_segments; ++seg_idx) {
596 const auto s = static_cast<size_t>(seg_idx);
598 continue;
599 }
600
603 if (clamp) {
605 }
606
607 for (Eigen::Index off = 0; off <
m_seg_total[s]; off += k_chunk_samples) {
608 m_chunks.push_back({ .segment = seg_idx,
609 .start_col = start_col,
611 .sample_count = std::min(k_chunk_samples,
m_seg_total[s] - off),
612 .clamp_t_high =
clamp });
613 }
614 }
615}
std::vector< Eigen::Index > m_seg_total
std::vector< CurveChunk > m_chunks
std::vector< Eigen::Index > m_seg_first
Eigen::Index m_points_per_segment
void clamp(std::span< double > data, double lo, double hi) noexcept
Clamp values to [lo, hi] in-place.