summaryrefslogtreecommitdiff
path: root/src/Toplex_map/include/gudhi/Toplex_map.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-10-16 13:57:50 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-10-16 13:57:50 +0000
commitc71dce7fe646cd4ca4da5f385cb0d97535e4d941 (patch)
tree237d99233a51b3707d5880a9e81e07280442c31a /src/Toplex_map/include/gudhi/Toplex_map.h
parentc882b0478d4b0899005bf6c0e9528a1fc8785cf9 (diff)
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
Diffstat (limited to 'src/Toplex_map/include/gudhi/Toplex_map.h')
-rw-r--r--src/Toplex_map/include/gudhi/Toplex_map.h13
1 files changed, 8 insertions, 5 deletions
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<Toplex_map::Vertex, Toplex_map::Simplex_ptr_set> t0;
- const Toplex_map::Vertex vertex_upper_bound = std::numeric_limits<Toplex_map::Vertex>::max();
+ const Toplex_map::Vertex VERTEX_UPPER_BOUND = std::numeric_limits<Toplex_map::Vertex>::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 <typename Input_vertex_range>
Toplex_map::Vertex Toplex_map::best_index(const Input_vertex_range &vertex_range) const{
std::size_t min = std::numeric_limits<size_t>::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)