From d228be4eb8af79872dacd557e0538a3697ed7a41 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 20 Mar 2017 16:22:39 +0000 Subject: using Base instead of full template class name git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2207 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3471adcb19df0859b5d905f5c5ba7e6e11ba2613 --- src/cython/include/Simplex_tree_interface.h | 53 +++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'src/cython') diff --git a/src/cython/include/Simplex_tree_interface.h b/src/cython/include/Simplex_tree_interface.h index 4f3096c0..65a9e6fc 100644 --- a/src/cython/include/Simplex_tree_interface.h +++ b/src/cython/include/Simplex_tree_interface.h @@ -39,10 +39,11 @@ namespace Gudhi { template class Simplex_tree_interface : public Simplex_tree { public: - typedef typename Simplex_tree::Filtration_value Filtration_value; - typedef typename Simplex_tree::Vertex_handle Vertex_handle; - typedef typename Simplex_tree::Simplex_handle Simplex_handle; - typedef typename std::pair Insertion_result; + using Base = Simplex_tree; + using Filtration_value = typename Base::Filtration_value; + using Vertex_handle = typename Base::Vertex_handle; + using Simplex_handle = typename Base::Simplex_handle; + using Insertion_result = typename std::pair; using Simplex = std::vector; using Filtered_complex = std::pair; using Complex_tree = std::vector; @@ -50,39 +51,39 @@ class Simplex_tree_interface : public Simplex_tree { public: bool find_simplex(const Simplex& vh) { - return (Simplex_tree::find(vh) != Simplex_tree::null_simplex()); + return (Base::find(vh) != Base::null_simplex()); } bool insert_simplex_and_subfaces(const Simplex& complex, Filtration_value filtration = 0) { - Insertion_result result = Simplex_tree::insert_simplex_and_subfaces(complex, filtration); - Simplex_tree::initialize_filtration(); + Insertion_result result = Base::insert_simplex_and_subfaces(complex, filtration); + Base::initialize_filtration(); return (result.second); } // Do not interface this function, only used in strong witness interface for complex creation bool insert_simplex_and_subfaces(const std::vector& complex, Filtration_value filtration = 0) { - Insertion_result result = Simplex_tree::insert_simplex_and_subfaces(complex, filtration); - Simplex_tree::initialize_filtration(); + Insertion_result result = Base::insert_simplex_and_subfaces(complex, filtration); + Base::initialize_filtration(); return (result.second); } Filtration_value simplex_filtration(const Simplex& complex) { - return Simplex_tree::filtration(Simplex_tree::find(complex)); + return Base::filtration(Base::find(complex)); } void remove_maximal_simplex(const Simplex& complex) { - Simplex_tree::remove_maximal_simplex(Simplex_tree::find(complex)); - Simplex_tree::initialize_filtration(); + Base::remove_maximal_simplex(Base::find(complex)); + Base::initialize_filtration(); } Complex_tree get_filtered_tree() { Complex_tree filtered_tree; - for (auto f_simplex : Simplex_tree::filtration_simplex_range()) { + for (auto f_simplex : Base::filtration_simplex_range()) { Simplex simplex; - for (auto vertex : Simplex_tree::simplex_vertex_range(f_simplex)) { + for (auto vertex : Base::simplex_vertex_range(f_simplex)) { simplex.insert(simplex.begin(), vertex); } - filtered_tree.push_back(std::make_pair(simplex, Simplex_tree::filtration(f_simplex))); + filtered_tree.push_back(std::make_pair(simplex, Base::filtration(f_simplex))); } return filtered_tree; @@ -90,42 +91,42 @@ class Simplex_tree_interface : public Simplex_tree { Complex_tree get_skeleton_tree(int dimension) { Complex_tree skeleton_tree; - for (auto f_simplex : Simplex_tree::skeleton_simplex_range(dimension)) { + for (auto f_simplex : Base::skeleton_simplex_range(dimension)) { Simplex simplex; - for (auto vertex : Simplex_tree::simplex_vertex_range(f_simplex)) { + for (auto vertex : Base::simplex_vertex_range(f_simplex)) { simplex.insert(simplex.begin(), vertex); } - skeleton_tree.push_back(std::make_pair(simplex, Simplex_tree::filtration(f_simplex))); + skeleton_tree.push_back(std::make_pair(simplex, Base::filtration(f_simplex))); } return skeleton_tree; } Complex_tree get_star_tree(const Simplex& complex) { Complex_tree star_tree; - for (auto f_simplex : Simplex_tree::star_simplex_range(Simplex_tree::find(complex))) { + for (auto f_simplex : Base::star_simplex_range(Base::find(complex))) { Simplex simplex; - for (auto vertex : Simplex_tree::simplex_vertex_range(f_simplex)) { + for (auto vertex : Base::simplex_vertex_range(f_simplex)) { simplex.insert(simplex.begin(), vertex); } - star_tree.push_back(std::make_pair(simplex, Simplex_tree::filtration(f_simplex))); + star_tree.push_back(std::make_pair(simplex, Base::filtration(f_simplex))); } return star_tree; } Complex_tree get_coface_tree(const Simplex& complex, int dimension) { Complex_tree coface_tree; - for (auto f_simplex : Simplex_tree::cofaces_simplex_range(Simplex_tree::find(complex), dimension)) { + for (auto f_simplex : Base::cofaces_simplex_range(Base::find(complex), dimension)) { Simplex simplex; - for (auto vertex : Simplex_tree::simplex_vertex_range(f_simplex)) { + for (auto vertex : Base::simplex_vertex_range(f_simplex)) { simplex.insert(simplex.begin(), vertex); } - coface_tree.push_back(std::make_pair(simplex, Simplex_tree::filtration(f_simplex))); + coface_tree.push_back(std::make_pair(simplex, Base::filtration(f_simplex))); } return coface_tree; } - void create_persistence(Gudhi::Persistent_cohomology_interface>* pcoh) { - pcoh = new Gudhi::Persistent_cohomology_interface>(*this); + void create_persistence(Gudhi::Persistent_cohomology_interface* pcoh) { + pcoh = new Gudhi::Persistent_cohomology_interface(*this); } }; -- cgit v1.2.3