summaryrefslogtreecommitdiff
path: root/src/Alpha_complex
diff options
context:
space:
mode:
Diffstat (limited to 'src/Alpha_complex')
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex.h6
-rw-r--r--src/Alpha_complex/test/Alpha_complex_unit_test.cpp10
2 files changed, 11 insertions, 5 deletions
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h
index 330b3b34..33830175 100644
--- a/src/Alpha_complex/include/gudhi/Alpha_complex.h
+++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h
@@ -230,8 +230,6 @@ class Alpha_complex : public Simplex_tree<> {
}
set_dimension(triangulation_->maximal_dimension());
- // set_filtration to +inf for prune_above_filtration to be done (if necessary)
- set_filtration(std::numeric_limits<Filtration_value>::infinity());
// --------------------------------------------------------------------------------------------
// double map to retrieve simplex tree vertex handles from CGAL vertex iterator and vice versa
@@ -323,7 +321,9 @@ class Alpha_complex : public Simplex_tree<> {
initialize_filtration();
}
// Remove all simplices that have a filtration value greater than max_alpha_square
- prune_above_filtration(max_alpha_square);
+ if (prune_above_filtration(max_alpha_square)) {
+ initialize_filtration();
+ }
// --------------------------------------------------------------------------------------------
}
diff --git a/src/Alpha_complex/test/Alpha_complex_unit_test.cpp b/src/Alpha_complex/test/Alpha_complex_unit_test.cpp
index 2912019d..315582d1 100644
--- a/src/Alpha_complex/test/Alpha_complex_unit_test.cpp
+++ b/src/Alpha_complex/test/Alpha_complex_unit_test.cpp
@@ -78,7 +78,8 @@ BOOST_AUTO_TEST_CASE(ALPHA_DOC_OFF_file_filtered) {
std::cout << "========== OFF FILE NAME = " << off_file_name << " - alpha²=" <<
max_alpha_square_value << "==========" << std::endl;
- Gudhi::alphacomplex::Alpha_complex<Kernel_d> alpha_complex_from_file(off_file_name, max_alpha_square_value);
+ // Use of the default dynamic kernel
+ Gudhi::alphacomplex::Alpha_complex<> alpha_complex_from_file(off_file_name, max_alpha_square_value);
const int DIMENSION = 2;
std::cout << "alpha_complex_from_file.dimension()=" << alpha_complex_from_file.dimension() << std::endl;
@@ -200,7 +201,12 @@ BOOST_AUTO_TEST_CASE(Alpha_complex_from_points) {
BOOST_CHECK_THROW (alpha_complex_from_points.get_point(1234), std::out_of_range);
// Test after prune_above_filtration
- alpha_complex_from_points.prune_above_filtration(0.6);
+ bool modified = alpha_complex_from_points.prune_above_filtration(0.6);
+ if (modified) {
+ alpha_complex_from_points.initialize_filtration();
+ }
+ BOOST_CHECK(modified);
+
// Another way to check num_simplices
std::cout << "Iterator on alpha complex simplices in the filtration order, with [filtration value]:" << std::endl;
num_simplices = 0;