From 3cf8477c5b259cd83ee869cb2b0913c31566aeda Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 16 Oct 2018 14:09:33 +0000 Subject: Remove Filtered_toplex_map and its derivative git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@3958 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 2833261794ce5bda7a0e120cde6a7851553bd00c --- src/Toplex_map/include/gudhi/Filtered_toplex_map.h | 75 ---------------------- 1 file changed, 75 deletions(-) delete mode 100644 src/Toplex_map/include/gudhi/Filtered_toplex_map.h (limited to 'src/Toplex_map/include/gudhi') diff --git a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h b/src/Toplex_map/include/gudhi/Filtered_toplex_map.h deleted file mode 100644 index 9a35b8b7..00000000 --- a/src/Toplex_map/include/gudhi/Filtered_toplex_map.h +++ /dev/null @@ -1,75 +0,0 @@ - #ifndef FILTERED_TOPLEX_MAP_H -#define FILTERED_TOPLEX_MAP_H - -#include -#include -#include - -namespace Gudhi { - -/** A Filtered_toplex_map represents the simplicial complex with a filtration. - * A "toplex" is a critical simplex. */ -class Filtered_toplex_map { - -public: - /** Vertex is the type of vertices. */ - typedef Toplex_map::Vertex Vertex; - - /** Simplex is the type of simplices. */ - typedef Toplex_map::Simplex Simplex; - - /** The type of the pointers to maximal simplices. */ - typedef Toplex_map::Simplex_ptr Simplex_ptr; - - /** The type of the sets of Simplex_ptr. */ - typedef Toplex_map::Simplex_ptr_set Simplex_ptr_set; - - /** The type of the filtration values. */ - typedef double Filtration_value; - - /** Add a simplex and its subfaces with the given filtration value - * in the Filtered_toplex_map. */ - template - std::pair insert_simplex_and_subfaces(const Input_vertex_range &vertex_range, Filtration_value f = std::numeric_limits::quiet_NaN()); - - /** Gives the filtration of the input simplex. */ - template - Filtration_value filtration(const Input_vertex_range &vertex_range) const; - - /** Is the input simplex member of the complex ? */ - template - bool membership(const Input_vertex_range &vertex_range) const; - -protected: - std::map toplex_maps; -}; - -template -std::pair 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,new Toplex_map()); - toplex_maps.at(f)->insert_simplex(vertex_range); - return make_pair(s,true); -} - - -template -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; //min only because a map is ordered - return std::numeric_limits::quiet_NaN() ; -} - -template -bool Filtered_toplex_map::membership(const Input_vertex_range &vertex_range) const{ - for(auto kv : toplex_maps) - if(kv.second->membership(vertex_range)) - return true; - return false; -} - -} //namespace Gudhi - -#endif /* FILTERED_TOPLEX_MAP_H */ -- cgit v1.2.3