diff options
-rw-r--r-- | src/Tangential_complex/include/gudhi/Tangential_complex.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index b448db2d..ab203ca5 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -56,6 +56,7 @@ #include <string> #include <cstddef> // for std::size_t #include <optional> +#include <numeric> // for std::iota #ifdef GUDHI_USE_TBB #include <tbb/parallel_for.h> @@ -624,6 +625,11 @@ class Tangential_complex { int max_dim = -1; + // Ordered vertices to be inserted first by the create_complex method to avoid quadratic complexity. + std::vector<typename Simplex_tree_::Vertex_handle> vertices(m_points.size()); + std::iota(vertices.begin(), vertices.end(), 0); + tree.insert_batch_vertices(vertices); + // For each triangulation for (std::size_t idx = 0; idx < m_points.size(); ++idx) { // For each cell of the star |