Template Function navtk::utils::condition_source_data

Function Documentation

template<typename T>
std::vector<Size> navtk::utils::condition_source_data(std::vector<double> &time_source, std::vector<T> &data_source, std::vector<double> &time_interp)

Modifies vector inputs so that they can be used to generate a valid interpolation.

Inputs are sorted in time; elements with identical time tags are removed, keeping only the first occurrence; and time_interp elements that do not overlap with time_source elements are removed.

Parameters
  • time_source – The base times, size N.

  • data_source – The interpolation base data, size N.

  • time_interp – The times to interpolate to.

Throws

std::runtime_error – if time_source.size() != data_source.size() or data_source.size < 2 and the error mode is ErrorMode::DIE for either case.

Returns

A vector of indices of elements that were removed from the sorted time_interp vector due to being duplicates or not overlapping with time_source.