diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-09-25 08:47:06 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-09-25 08:47:06 +0000 |
commit | d965a53c39266dd37cd9058837b80469347fc5d3 (patch) | |
tree | 5e63fdc53b82dce437d87c1d3697d0b9b2facd7d /src/Persistent_cohomology | |
parent | 10b516cd208e9fcf0055e399e8d319ea42e02212 (diff) |
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
Diffstat (limited to 'src/Persistent_cohomology')
-rw-r--r-- | src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 |