diff options
-rw-r--r-- | src/Tangential_complex/example/example_basic.cpp | 7 | ||||
-rw-r--r-- | src/Toplex_map/include/gudhi/Filtered_toplex_map.h | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/Tangential_complex/example/example_basic.cpp b/src/Tangential_complex/example/example_basic.cpp index 4f2b859e..39165397 100644 --- a/src/Tangential_complex/example/example_basic.cpp +++ b/src/Tangential_complex/example/example_basic.cpp @@ -1,5 +1,7 @@ #include <gudhi/Tangential_complex.h> #include <gudhi/sparsify_point_set.h> +#include <gudhi/Fake_simplex_tree.h> + #include <CGAL/Epick_d.h> #include <CGAL/Random.h> @@ -20,7 +22,7 @@ CGAL::Parallel_tag> TC; int main(void) { const int INTRINSIC_DIM = 2; const int AMBIENT_DIM = 3; - const int NUM_POINTS = 1000; + const int NUM_POINTS = 100; Kernel k; @@ -36,7 +38,8 @@ int main(void) { tc.compute_tangential_complex(); // Export the TC into a Simplex_tree - Gudhi::Simplex_tree<> stree; + //Gudhi::Simplex_tree<> stree; + Gudhi::Fake_simplex_tree stree; tc.create_complex(stree); // Display stats about inconsistencies diff --git a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h b/src/Toplex_map/include/gudhi/Filtered_toplex_map.h index 5bf50fc5..3a0064dc 100644 --- a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h +++ b/src/Toplex_map/include/gudhi/Filtered_toplex_map.h @@ -14,7 +14,7 @@ public: typedef double Filtration_value; template <typename Input_vertex_range> - void insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f = filtration_upper_bound); + std::pair<Simplex, bool> insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f = filtration_upper_bound); template <typename Input_vertex_range> Filtration_value filtration(const Input_vertex_range &vertex_range) const; @@ -27,9 +27,12 @@ protected: }; template <typename Input_vertex_range> -void Filtered_toplex_map::insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f){ +std::pair<Simplex, bool> Filtered_toplex_map::insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f){ + Simplex s(vertex_range.begin(),vertex_range.end()); + if(membership(s)) return make_pair(s,false); if(!toplex_maps.count(f)) toplex_maps.emplace(f,Toplex_map()); toplex_maps.at(f).insert_simplex(vertex_range); + return make_pair(s,true); } |