summaryrefslogtreecommitdiff
path: root/src/Toplex_map
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-05-15 15:39:51 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-05-15 15:39:51 +0000
commitdb4d235b9f7995351f3d4559a132dfe15f30b655 (patch)
tree95e8591f931cf93b11cf4e453bab8f75dbf5570f /src/Toplex_map
parent04da883af94d96ea54faf09a1fb87e3b8e0bf847 (diff)
better unit test
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@3444 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0dd6c254d59c71e4bafe7413e87ce0d27c87a4ab
Diffstat (limited to 'src/Toplex_map')
-rw-r--r--src/Toplex_map/include/gudhi/Lazy_Toplex_map.h4
-rw-r--r--src/Toplex_map/test/CMakeLists.txt1
-rw-r--r--src/Toplex_map/test/toplex_map_unit_test.cpp11
3 files changed, 12 insertions, 4 deletions
diff --git a/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h b/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h
index 50785b5a..396961fe 100644
--- a/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h
+++ b/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h
@@ -64,8 +64,8 @@ private:
std::size_t size_lbound = 0;
std::size_t size = 0;
- const double alpha = 2; //time
- const double betta = 4; //memory
+ const double alpha = 4; //time
+ const double betta = 8; //memory
};
template <typename Input_vertex_range>
diff --git a/src/Toplex_map/test/CMakeLists.txt b/src/Toplex_map/test/CMakeLists.txt
index 5ed55e97..8bf5cf14 100644
--- a/src/Toplex_map/test/CMakeLists.txt
+++ b/src/Toplex_map/test/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.6)
project(Toplex_map_tests)
+add_executable(chrono chrono.cpp)
add_executable ( ToplexMapUT toplex_map_unit_test.cpp )
target_link_libraries(ToplexMapUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
diff --git a/src/Toplex_map/test/toplex_map_unit_test.cpp b/src/Toplex_map/test/toplex_map_unit_test.cpp
index 95ee7a02..c12ad094 100644
--- a/src/Toplex_map/test/toplex_map_unit_test.cpp
+++ b/src/Toplex_map/test/toplex_map_unit_test.cpp
@@ -28,10 +28,17 @@ BOOST_AUTO_TEST_CASE(toplexmap) {
K.insert_simplex(sigma6);
K.insert_simplex(sigma7);
BOOST_CHECK(K.membership(sigma4));
- BOOST_CHECK(!K.maximality(sigma5));
+ BOOST_CHECK(!K.maximality(sigma3));
BOOST_CHECK(!K.membership(sigma5));
- K.contraction(4,5);
+ K.insert_simplex(sigma5);
+ std::vector<Vertex> sigma9 = {1, 2, 3};
+ std::vector<Vertex> sigma10 = {2, 7};
+ auto r = K.contraction(4,5);
+ sigma9.emplace_back(r);
+ sigma10.emplace_back(r);
BOOST_CHECK(!K.membership(sigma6));
+ BOOST_CHECK(K.membership(sigma9));
+ BOOST_CHECK(K.membership(sigma10));
}