28 const Eigen::VectorXd& overlap,
Index offset,
double threshold)
const {
29 std::vector<Index> index = std::vector<Index>(overlap.size());
30 std::iota(index.begin(), index.end(), offset);
31 std::stable_sort(index.begin(), index.end(), [&overlap](
Index i1,
Index i2) {
33 return overlap[i1] > overlap[i2];
35 return overlap[i1] < overlap[i2];
40 validelements = (overlap.array() > threshold).sum();
42 validelements = (overlap.array() < threshold).sum();
45 std::vector<Index> indexes(validelements);
46 std::copy_n(index.begin(), validelements, indexes.begin());