From c71dce7fe646cd4ca4da5f385cb0d97535e4d941 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 16 Oct 2018 13:57:50 +0000 Subject: Add lazy_toplex_map_unit_test Class documentation rewrite Fix conventions in code git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@3956 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 65f79ee3c0f22157b2cedfc498e5d9c97dd055f6 --- src/Toplex_map/include/gudhi/Toplex_map.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/Toplex_map/include/gudhi/Toplex_map.h') diff --git a/src/Toplex_map/include/gudhi/Toplex_map.h b/src/Toplex_map/include/gudhi/Toplex_map.h index 7cde8ea1..b7a5db41 100644 --- a/src/Toplex_map/include/gudhi/Toplex_map.h +++ b/src/Toplex_map/include/gudhi/Toplex_map.h @@ -10,8 +10,11 @@ namespace Gudhi { -/** A Toplex_map represents the simplicial complex. - * A "toplex" is a maximal simplex. +/** + * \brief Toplex map data structure for representing unfiltered simplicial complexes. + * + * \details A Toplex_map is an unordered map from vertices to maximal simplices (aka. toplices). + * * \ingroup toplex_map */ class Toplex_map { @@ -100,7 +103,7 @@ protected: /** \internal The map from vertices to toplices */ std::unordered_map t0; - const Toplex_map::Vertex vertex_upper_bound = std::numeric_limits::max(); + const Toplex_map::Vertex VERTEX_UPPER_BOUND = std::numeric_limits::max(); /** \internal Removes a toplex without adding facets after. */ void erase_maximal(const Toplex_map::Simplex_ptr& sptr); @@ -258,7 +261,7 @@ void Toplex_map::remove_vertex(const Toplex_map::Vertex x){ inline void Toplex_map::erase_maximal(const Toplex_map::Simplex_ptr& sptr){ Simplex sigma(*sptr); if (sptr->size()==0) - sigma.insert(vertex_upper_bound); + sigma.insert(VERTEX_UPPER_BOUND); for(const Toplex_map::Vertex& v : sigma){ t0.at(v).erase(sptr); if(t0.at(v).size()==0) t0.erase(v); @@ -268,7 +271,7 @@ inline void Toplex_map::erase_maximal(const Toplex_map::Simplex_ptr& sptr){ template Toplex_map::Vertex Toplex_map::best_index(const Input_vertex_range &vertex_range) const{ std::size_t min = std::numeric_limits::max(); - Vertex arg_min = vertex_upper_bound; + Vertex arg_min = VERTEX_UPPER_BOUND; for(const Toplex_map::Vertex& v : vertex_range) if(!t0.count(v)) return v; else if(t0.at(v).size() < min) -- cgit v1.2.3