summaryrefslogtreecommitdiff
path: root/src/python/include/Simplex_tree_interface.h
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-02-13 11:08:44 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-02-13 11:08:44 +0100
commit1edb818b38ace05b230319227e60838b796ddfc5 (patch)
treeadc4d2ff818f5ef8f5c839ebb0f7c09f6c207526 /src/python/include/Simplex_tree_interface.h
parent79de1437cb2fa0ab69465a2f2feabe09a12056eb (diff)
simplex tree skeleton iterator
Diffstat (limited to 'src/python/include/Simplex_tree_interface.h')
-rw-r--r--src/python/include/Simplex_tree_interface.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/python/include/Simplex_tree_interface.h b/src/python/include/Simplex_tree_interface.h
index 878919cc..55d5af97 100644
--- a/src/python/include/Simplex_tree_interface.h
+++ b/src/python/include/Simplex_tree_interface.h
@@ -35,6 +35,7 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> {
using Simplex = std::vector<Vertex_handle>;
using Simplex_and_filtration = std::pair<Simplex, Filtration_value>;
using Filtered_simplices = std::vector<Simplex_and_filtration>;
+ using Skeleton_simplex_iterator = typename Base::Skeleton_simplex_iterator;
public:
bool find_simplex(const Simplex& vh) {
@@ -91,18 +92,6 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> {
return std::make_pair(std::move(simplex), Base::filtration(f_simplex));
}
- Filtered_simplices get_skeleton(int dimension) {
- Filtered_simplices skeletons;
- for (auto f_simplex : Base::skeleton_simplex_range(dimension)) {
- Simplex simplex;
- for (auto vertex : Base::simplex_vertex_range(f_simplex)) {
- simplex.insert(simplex.begin(), vertex);
- }
- skeletons.push_back(std::make_pair(simplex, Base::filtration(f_simplex)));
- }
- return skeletons;
- }
-
Filtered_simplices get_star(const Simplex& simplex) {
Filtered_simplices star;
for (auto f_simplex : Base::star_simplex_range(Base::find(simplex))) {
@@ -134,13 +123,21 @@ class Simplex_tree_interface : public Simplex_tree<SimplexTreeOptions> {
// Iterator over the simplex tree
typename std::vector<Simplex_handle>::const_iterator get_filtration_iterator_begin() {
- Base::initialize_filtration();
+ // Base::initialize_filtration(); already performed in filtration_simplex_range
return Base::filtration_simplex_range().begin();
}
typename std::vector<Simplex_handle>::const_iterator get_filtration_iterator_end() {
return Base::filtration_simplex_range().end();
}
+
+ Skeleton_simplex_iterator get_skeleton_iterator_begin(int dimension) {
+ return Base::skeleton_simplex_range(dimension).begin();
+ }
+
+ Skeleton_simplex_iterator get_skeleton_iterator_end(int dimension) {
+ return Base::skeleton_simplex_range(dimension).end();
+ }
};
} // namespace Gudhi