diff options
author | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-03-27 18:46:18 +0000 |
---|---|---|
committer | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-03-27 18:46:18 +0000 |
commit | 7f3ea79d26c78c8b2107a6a85feba933bd5512ac (patch) | |
tree | adef85730a69005fa532165877accf9c57bee7ae /src/Toplex_map/include/gudhi/Filtered_toplex_map.h | |
parent | 6485e6957ef3c9310f618db6caaf2858cc56db66 (diff) |
sb_wrapper working
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@3308 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: c7400a11583b8b67483974664e410f4c77232fb1
Diffstat (limited to 'src/Toplex_map/include/gudhi/Filtered_toplex_map.h')
-rw-r--r-- | src/Toplex_map/include/gudhi/Filtered_toplex_map.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h b/src/Toplex_map/include/gudhi/Filtered_toplex_map.h index 379c65dd..a3653acd 100644 --- a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h +++ b/src/Toplex_map/include/gudhi/Filtered_toplex_map.h @@ -50,15 +50,15 @@ public: bool membership(const Input_vertex_range &vertex_range) const; protected: - std::map<Filtration_value, Toplex_map> toplex_maps; + std::map<Filtration_value, Toplex_map*> toplex_maps; }; template <typename Input_vertex_range> std::pair<Toplex_map::Simplex, bool> Filtered_toplex_map::insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f){ Simplex s(vertex_range.begin(),vertex_range.end()); if(membership(s)) return make_pair(s,false); - if(!toplex_maps.count(f)) toplex_maps.emplace(f,Toplex_map()); - toplex_maps.at(f).insert_simplex(vertex_range); + if(!toplex_maps.count(f)) toplex_maps.emplace(f,new Toplex_map()); + toplex_maps.at(f)->insert_simplex(vertex_range); return make_pair(s,true); } @@ -66,7 +66,7 @@ std::pair<Toplex_map::Simplex, bool> Filtered_toplex_map::insert_simplex_and_sub 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)) + if(kv.second->membership(vertex_range)) return kv.first; //min only because a map is ordered return nan(""); } @@ -74,7 +74,7 @@ Filtered_toplex_map::Filtration_value Filtered_toplex_map::filtration(const Inpu template <typename Input_vertex_range> bool Filtered_toplex_map::membership(const Input_vertex_range &vertex_range) const{ for(auto kv : toplex_maps) - if(kv.second.membership(vertex_range)) + if(kv.second->membership(vertex_range)) return true; return false; } |