diff --git a/include/cilantro/utilities/nearest_neighbor_graph_utilities.hpp b/include/cilantro/utilities/nearest_neighbor_graph_utilities.hpp index 5899160..28bd2c5 100644 --- a/include/cilantro/utilities/nearest_neighbor_graph_utilities.hpp +++ b/include/cilantro/utilities/nearest_neighbor_graph_utilities.hpp @@ -5,11 +5,11 @@ #include namespace cilantro { - template - std::vector getNNGraphNodeDegrees(const std::vector> &adj_list, - bool remove_self = true) + template + std::vector getNNGraphNodeDegrees(const std::vector> &adj_list, + bool remove_self = true) { - std::vector deg(adj_list.size()); + std::vector deg(adj_list.size()); if (remove_self) { #pragma omp parallel for for (size_t i = 0; i < deg.size(); i++) { diff --git a/include/cilantro/utilities/point_cloud.hpp b/include/cilantro/utilities/point_cloud.hpp index be8e40b..f385045 100644 --- a/include/cilantro/utilities/point_cloud.hpp +++ b/include/cilantro/utilities/point_cloud.hpp @@ -31,18 +31,19 @@ namespace cilantro { : points(points), normals(normals), colors(colors) {} + template PointCloud(const PointCloud &cloud, - const std::vector &indices, + const std::vector &indices, bool negate = false) { - std::set indices_set; + std::set indices_set; if (negate) { - std::vector full_indices(cloud.size()); - for (size_t i = 0; i < cloud.size(); i++) full_indices[i] = i; - std::set indices_to_discard(indices.begin(), indices.end()); + std::vector full_indices(cloud.size()); + for (IndexT i = 0; i < cloud.size(); i++) full_indices[i] = i; + std::set indices_to_discard(indices.begin(), indices.end()); std::set_difference(full_indices.begin(), full_indices.end(), indices_to_discard.begin(), indices_to_discard.end(), std::inserter(indices_set, indices_set.begin())); } else { - indices_set = std::set(indices.begin(), indices.end()); + indices_set = std::set(indices.begin(), indices.end()); } if (cloud.hasNormals() && cloud.hasColors()) { @@ -147,10 +148,11 @@ namespace cilantro { return *this; } - PointCloud& remove(const std::vector &indices) { + template + PointCloud& remove(const std::vector &indices) { if (indices.empty()) return *this; - std::set indices_set(indices.begin(), indices.end()); + std::set indices_set(indices.begin(), indices.end()); if (indices_set.size() >= size()) { clear(); return *this;