summaryrefslogtreecommitdiff
path: root/src/Simplex_tree/include/gudhi/Simplex_tree.h
diff options
context:
space:
mode:
authorVincent Rouvreau <vincent.rouvreau@inria.fr>2022-04-05 10:30:57 +0200
committerVincent Rouvreau <vincent.rouvreau@inria.fr>2022-04-05 10:30:57 +0200
commit0d25c9db02cdc20c4b7ca1f48780eb7129ee8b82 (patch)
tree7fc33cf0a9bc8a5d5c15db714500d4440d32f2e2 /src/Simplex_tree/include/gudhi/Simplex_tree.h
parentb066b4376abf66ddc76e61a6a815a409b05fe59b (diff)
Boundary and its opposite vertex iterator for the simplex tree
Diffstat (limited to 'src/Simplex_tree/include/gudhi/Simplex_tree.h')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index d48f6616..63a7f190 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -187,6 +187,12 @@ class Simplex_tree {
typedef Simplex_tree_boundary_simplex_iterator<Simplex_tree> Boundary_simplex_iterator;
/** \brief Range over the simplices of the boundary of a simplex. */
typedef boost::iterator_range<Boundary_simplex_iterator> Boundary_simplex_range;
+ /** \brief Iterator over the simplices of the boundary and its opposite vertex of a simplex.
+ *
+ * 'value_type' is std::pair<Simplex_handle, Vertex_handle>. */
+ typedef Simplex_tree_boundary_opposite_vertex_simplex_iterator<Simplex_tree> Boundary_opposite_vertex_simplex_iterator;
+ /** \brief Range over the simplices of the boundary and its opposite vertex of a simplex. */
+ typedef boost::iterator_range<Boundary_opposite_vertex_simplex_iterator> Boundary_opposite_vertex_simplex_range;
/** \brief Iterator over the simplices of the simplicial complex.
*
* 'value_type' is Simplex_handle. */
@@ -296,6 +302,23 @@ class Simplex_tree {
Boundary_simplex_iterator(this));
}
+ /** \brief Returns a range over the simplices of the boundary and its opposite vertex of a simplex.
+ *
+ * The boundary and its opposite vertex of a simplex is the set of codimension \f$1\f$ subsimplices of the simplex.
+ * If the simplex is \f$[v_0, \cdots ,v_d]\f$, with canonical orientation induced by \f$ v_0 < \cdots < v_d \f$, the
+ * iterator enumerates the simplices of the boundary in the order:
+ * \f$[v_0,\cdots,\widehat{v_i},\cdots,v_d]\f$ for \f$i\f$ from \f$0\f$ to \f$d\f$, where \f$\widehat{v_i}\f$ means
+ * that the vertex \f$v_i\f$ is omitted from boundary, but returned as the second element of the pair, known as the
+ * the opposite vertex of the boundary.
+ *
+ * @param[in] sh Simplex for which the boundary and its opposite vertex is computed.
+ * @return Iterator on a pair of SimplexHandle (a boundary) and a VertexHandle (its opposite vertex). */
+ template<class SimplexHandle>
+ Boundary_opposite_vertex_simplex_range boundary_opposite_vertex_simplex_range(SimplexHandle sh) {
+ return Boundary_opposite_vertex_simplex_range(Boundary_opposite_vertex_simplex_iterator(this, sh),
+ Boundary_opposite_vertex_simplex_iterator(this));
+ }
+
/** @} */ // end range and iterator methods
/** \name Constructor/Destructor
* @{ */