From d965a53c39266dd37cd9058837b80469347fc5d3 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 25 Sep 2017 08:47:06 +0000 Subject: Fix weighted alpha complex 3d git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/weighted_alpha_complex_fix@2709 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3e7d1f73038d193b566e790a3095b6f802c48b48 --- .../example/weighted_alpha_complex_3d_persistence.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Persistent_cohomology/example') diff --git a/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp index 34b90933..ce45d16d 100644 --- a/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp @@ -115,6 +115,7 @@ int main(int argc, char * const argv[]) { if (weights_ifstr.good()) { double weight = 0.0; std::size_t index = 0; + wp.reserve(lp.size()); // Attempt read the weight in a double format, return false if it fails while ((weights_ifstr >> weight) && (index < lp.size())) { wp.push_back(Weighted_point_3(lp[index], weight)); @@ -130,7 +131,7 @@ int main(int argc, char * const argv[]) { } // alpha shape construction from points. CGAL has a strange behavior in REGULARIZED mode. - Alpha_shape_3 as(lp.begin(), lp.end(), 0, Alpha_shape_3::GENERAL); + Alpha_shape_3 as(wp.begin(), wp.end(), 0, Alpha_shape_3::GENERAL); #ifdef DEBUG_TRACES std::cout << "Alpha shape computed in GENERAL mode" << std::endl; #endif // DEBUG_TRACES -- cgit v1.2.3