Template Function navtk::utils::find_duplicates(const std::vector<T>&)

Function Documentation

template<typename T>
std::vector<Size> navtk::utils::find_duplicates(const std::vector<T> &data)

Generate a vector of indices marking consecutive duplicates.

Template Parameters

T – Data type stored in vector; must have == operator defined.

Parameters

data – The data to check.

Returns

A vector of indices where the index k will be included if data[k-1] == data[k]. Return vector will be empty of no duplicates are found.