inline void Assign(RawVector<T>& dst, const U& src, int point_count) { dst.resize_discard(point_count); size_t count = std::min<size_t>(point_count, src->size()); auto src_data = src->get(); for (size_t i = 0; i < count; ++i) dst[i] = (T)src_data[i]; }
inline void Remap(RawVector<T>& dst, const U& src, const RawVector<std::pair<float, int>>& sort_data) { dst.resize_discard(sort_data.size()); size_t count = std::min<size_t>(sort_data.size(), src->size()); auto src_data = src->get(); for (size_t i = 0; i < count; ++i) dst[i] = (T)src_data[sort_data[i].second]; }