summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-23 14:42:02 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-23 14:42:02 +0000
commit86ed4085d26398aed26dfd9c365f8f3ee187c92e (patch)
treef49b0ac3108bacbbb87df82f0fa161b0cb1230e8
parent75a9dfbec0db666b566278f17313297dc18619d4 (diff)
parentfb1c4cd4e98f979e7aa5042fb16da1c3884efe7f (diff)
Add of Hasse complex example compilation. Insert_simplex_with_subfaces must increment number of simplices on each insertion
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@470 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 325d24d0919e216e3b2d816521749e406f0a8f98
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt17
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h10
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
}