diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 17 | ||||
-rw-r--r-- | src/Simplex_tree/include/gudhi/Simplex_tree.h | 10 |
3 files changed, 19 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d6d0c55f..3afec463 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,8 @@ else() add_subdirectory(src/Skeleton_blocker/test) add_subdirectory(src/Skeleton_blocker/example) add_subdirectory(src/Contraction/example) + add_subdirectory(src/Hasse_complex/example) + endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 63a70496..b67ab2f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,13 +28,14 @@ find_package(CGAL) if(NOT Boost_FOUND) message(FATAL_ERROR "NOTICE: This demo requires Boost and will not be compiled.") else() - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) - LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) - include_directories(include/) - - add_subdirectory(example/Simplex_tree) - add_subdirectory(example/Persistent_cohomology) - add_subdirectory(example/Skeleton_blocker) - add_subdirectory(example/Contraction) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + include_directories(include/) + add_subdirectory(example/Simplex_tree) + add_subdirectory(example/Persistent_cohomology) + add_subdirectory(example/Skeleton_blocker) + add_subdirectory(example/Contraction) + add_subdirectory(example/Hasse_complex) + endif() diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index 174f9748..a1758680 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -501,10 +501,16 @@ class Simplex_tree { insert_simplex_and_subfaces(NsimplexMinusOne, filtration); } // N-Simplex insert - insert_simplex(Nsimplex, filtration); + std::pair<Simplex_handle, bool> returned = insert_simplex(Nsimplex, filtration); + if (returned.second == true) { + num_simplices_++; + } } else if (Nsimplex.size() == 1) { // 1-Simplex insert - End of recursivity - insert_simplex(Nsimplex, filtration); + std::pair<Simplex_handle, bool> returned = insert_simplex(Nsimplex, filtration); + if (returned.second == true) { + num_simplices_++; + } } else { // Nothing to insert - empty vector } |