diff options
author | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-11-21 18:38:25 +0000 |
---|---|---|
committer | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-11-21 18:38:25 +0000 |
commit | bf84494b3e7f3d2a36661b66defb131e515cdc5b (patch) | |
tree | 1e94f295a7285350a95af1e8347fe67787bce93b /src/Toplex_map/include/gudhi/Filtered_toplex_map.h | |
parent | 8d3be7f7008eb06b001797510c965a2b2a4009a9 (diff) |
...
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@2926 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: d872eef9342046002b81f55cc12760e799df0c1d
Diffstat (limited to 'src/Toplex_map/include/gudhi/Filtered_toplex_map.h')
-rw-r--r-- | src/Toplex_map/include/gudhi/Filtered_toplex_map.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h b/src/Toplex_map/include/gudhi/Filtered_toplex_map.h index 3a0064dc..a0c24304 100644 --- a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h +++ b/src/Toplex_map/include/gudhi/Filtered_toplex_map.h @@ -2,10 +2,9 @@ #define FILTERED_TOPLEX_MAP_H #include <gudhi/Toplex_map.h> +#include <map> #include <limits> -#define filtration_upper_bound std::numeric_limits<Filtration_value>::max() - namespace Gudhi { class Filtered_toplex_map { @@ -14,7 +13,7 @@ public: typedef double Filtration_value; template <typename Input_vertex_range> - std::pair<Simplex, bool> insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f = filtration_upper_bound); + std::pair<Simplex, bool> insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f = nan("")); template <typename Input_vertex_range> Filtration_value filtration(const Input_vertex_range &vertex_range) const; @@ -23,7 +22,7 @@ public: bool membership(const Input_vertex_range &vertex_range) const; protected: - std::unordered_map<Filtration_value, Toplex_map> toplex_maps; + std::map<Filtration_value, Toplex_map> toplex_maps; }; template <typename Input_vertex_range> @@ -40,8 +39,8 @@ template <typename Input_vertex_range> Filtered_toplex_map::Filtration_value Filtered_toplex_map::filtration(const Input_vertex_range &vertex_range) const{ for(auto kv : toplex_maps) if(kv.second.membership(vertex_range)) - return kv.first; - return filtration_upper_bound; + return kv.first; //min only because a map is ordered + return nan(""); } template <typename Input_vertex_range> |