From 4b619ec130bfa6cff47fbde47a732d890327f465 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 12 Oct 2018 12:54:03 +0000 Subject: Bad comment for lazy num_maximal_simplices git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@3948 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: f0926058af8b0cfc77c9346feda6f6c4db2c9828 --- src/Toplex_map/include/gudhi/Lazy_Toplex_map.h | 4 ++-- src/Toplex_map/test/toplex_map_unit_test.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'src/Toplex_map') diff --git a/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h b/src/Toplex_map/include/gudhi/Lazy_Toplex_map.h index ea10d390..0cae967e 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 @@ public: * \ingroup toplex_map */ Vertex contraction(const Vertex x, const Vertex y); - /** \brief Number of simplices stored. - * \ingroup toplex_map */ + /** \brief Number of maximal simplices. + * \ingroup toplex_map */ std::size_t num_maximal_simplices() const; std::unordered_map gamma0_lbounds; diff --git a/src/Toplex_map/test/toplex_map_unit_test.cpp b/src/Toplex_map/test/toplex_map_unit_test.cpp index 2c584c5d..c1540eb5 100644 --- a/src/Toplex_map/test/toplex_map_unit_test.cpp +++ b/src/Toplex_map/test/toplex_map_unit_test.cpp @@ -55,6 +55,30 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(common_toplex_map_functionnalities, Toplex_map, li } +BOOST_AUTO_TEST_CASE(toplex_map_num_maximal_simplices) { + using Vertex = Gudhi::Toplex_map::Vertex; + + Gudhi::Toplex_map K; + K.insert_simplex({1, 2, 3, 4}); + K.insert_simplex({5, 2, 3, 6}); + K.insert_simplex({4, 5, 3}); + K.insert_simplex({4, 5, 9}); + + std::cout << K.num_maximal_simplices(); + BOOST_CHECK(K.num_maximal_simplices() == 4); + + K.insert_simplex({5, 2, 7}); + + std::cout << K.num_maximal_simplices(); + BOOST_CHECK(K.num_maximal_simplices() == 5); + + auto r = K.contraction(4,5); + + std::cout << K.num_maximal_simplices(); + BOOST_CHECK(K.num_maximal_simplices() == 4); + +} + BOOST_AUTO_TEST_CASE(toplex_map_maximality) { using Vertex = Gudhi::Toplex_map::Vertex; -- cgit v1.2.3