diff --git a/.gitignore b/.gitignore index 4ba51e0..19e266e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ TAGS GTAGS GRTAGS GPATH +.clang_complete diff --git a/src/utils.h b/src/utils.h index 861c06c..748ad28 100644 --- a/src/utils.h +++ b/src/utils.h @@ -100,24 +100,14 @@ namespace Intsurv { return arma::conv_to::from(res); } // function that returns the indices of the first unique indices - inline arma::uvec find_first_unique(const arma::vec& x, - bool fromLast = false) + inline arma::uvec find_first_unique(const arma::vec& x) { std::unordered_set seen; std::vector res; - if (fromLast) { - for (size_t i {1}; i <= x.n_rows; ++i) { - if (seen.insert(x(x.n_rows - i)).second) { - // if duplicated, add index to vector res - res.push_back(i); - } - } - } else { - for (size_t i {0}; i < x.n_rows; ++i) { - if (seen.insert(x(i)).second) { - // if duplicated, add index to vector res - res.push_back(i); - } + for (size_t i {0}; i < x.n_rows; ++i) { + if (seen.insert(x(i)).second) { + // if duplicated, add index to vector res + res.push_back(i); } } return arma::conv_to::from(res);