From cb82907d03e3f875a418efc52570970c01c2677d Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 31 Aug 2015 14:21:29 +0000 Subject: insert_simplex_and_subfaces no more factoriel complexity. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@764 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 34fd4f5e0221a3899ec98a0cdcbdc83fb83bf463 --- src/Alpha_complex/include/gudhi/Alpha_complex.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/Alpha_complex/include') diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h index 04fb185c..d8568be0 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h @@ -219,7 +219,7 @@ class Alpha_complex : public Simplex_tree<> { } } // -------------------------------------------------------------------------------------------- - + // -------------------------------------------------------------------------------------------- // Simplex_tree construction from loop on triangulation finite full cells list for (auto cit = triangulation_->finite_full_cells_begin(); cit != triangulation_->finite_full_cells_end(); ++cit) { @@ -242,10 +242,6 @@ class Alpha_complex : public Simplex_tree<> { // Insert each simplex and its subfaces in the simplex tree - filtration is NaN Simplex_result insert_result = insert_simplex_and_subfaces(vertexVector, std::numeric_limits::quiet_NaN()); - if (!insert_result.second) { - std::cerr << "Alpha_complex::init insert_simplex_and_subfaces failed" << std::endl; - exit(-1); // ----->> - } } // -------------------------------------------------------------------------------------------- @@ -324,8 +320,10 @@ class Alpha_complex : public Simplex_tree<> { pointVector.push_back(get_point(vertex)); } // Retrieve the Sigma point that is not part of Tau - parameter for is_gabriel function + Point_d point_for_gabriel; for (auto vertex : simplex_vertex_range(f_simplex)) { - if (std::find(pointVector.begin(), pointVector.end(), get_point(vertex)) == pointVector.end()) { + point_for_gabriel = get_point(vertex); + if (std::find(pointVector.begin(), pointVector.end(), point_for_gabriel) == pointVector.end()) { // vertex is not found in Tau vertexForGabriel = vertex; // No need to continue loop @@ -334,7 +332,7 @@ class Alpha_complex : public Simplex_tree<> { } // is_gabriel function initialization Is_Gabriel is_gabriel = kernel_.side_of_bounded_sphere_d_object(); - bool is_gab = is_gabriel(pointVector.begin(), pointVector.end(), get_point(vertexForGabriel)) + bool is_gab = is_gabriel(pointVector.begin(), pointVector.end(), point_for_gabriel) != CGAL::ON_BOUNDED_SIDE; #ifdef DEBUG_TRACES std::cout << " | Tau is_gabriel(Sigma)=" << is_gab << " - vertexForGabriel=" << vertexForGabriel << std::endl; -- cgit v1.2.3