From 97d80185d6ec4d5e8f81b4cd4936d29a6d63b05b Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 29 Nov 2016 16:50:55 +0000 Subject: Fix interface for Alpha complex and Tangential complex git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@1801 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 995b53c7f65057ec155988b90f17299665eab4ae --- src/cython/include/Alpha_complex_interface.h | 6 +++--- src/cython/include/Tangential_complex_interface.h | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/cython/include') diff --git a/src/cython/include/Alpha_complex_interface.h b/src/cython/include/Alpha_complex_interface.h index 15384206..81761c77 100644 --- a/src/cython/include/Alpha_complex_interface.h +++ b/src/cython/include/Alpha_complex_interface.h @@ -69,9 +69,9 @@ class Alpha_complex_interface { return vd; } - void create_simplex_tree(Simplex_tree_interface<>& simplex_tree, double max_alpha_square) { - alpha_complex_->create_complex(simplex_tree, max_alpha_square); - simplex_tree.initialize_filtration(); + void create_simplex_tree(Simplex_tree_interface<>* simplex_tree, double max_alpha_square) { + alpha_complex_->create_complex(*simplex_tree, max_alpha_square); + simplex_tree->initialize_filtration(); } private: diff --git a/src/cython/include/Tangential_complex_interface.h b/src/cython/include/Tangential_complex_interface.h index 49d66476..c7fce557 100644 --- a/src/cython/include/Tangential_complex_interface.h +++ b/src/cython/include/Tangential_complex_interface.h @@ -73,14 +73,12 @@ class Tangential_complex_interface { num_inconsistencies_ = tangential_complex_->number_of_inconsistent_simplices(); } - std::vector get_point(int vh) { + std::vector get_point(unsigned vh) { std::vector vd; - try { + if (vh < tangential_complex_->number_of_vertices()) { Point_d ph = tangential_complex_->get_point(vh); for (auto coord = ph.cartesian_begin(); coord < ph.cartesian_end(); coord++) vd.push_back(*coord); - } catch (std::out_of_range outofrange) { - // std::out_of_range is thrown in case not found. Other exceptions must be re-thrown } return vd; } @@ -101,9 +99,11 @@ class Tangential_complex_interface { return num_inconsistencies_.num_inconsistent_stars; } - void create_simplex_tree(Simplex_tree<>& simplex_tree) { - tangential_complex_->create_complex>(simplex_tree); - simplex_tree.initialize_filtration(); + void create_simplex_tree(Simplex_tree<>* simplex_tree) { + int max_dim = tangential_complex_->create_complex>(*simplex_tree); + // FIXME + simplex_tree->set_dimension(max_dim); + simplex_tree->initialize_filtration(); } private: -- cgit v1.2.3