summaryrefslogtreecommitdiff
path: root/src/Bitmap_cubical_complex
diff options
context:
space:
mode:
authormathieu <mathieu.carriere3@gmail.com>2020-03-11 12:05:15 -0400
committermathieu <mathieu.carriere3@gmail.com>2020-03-11 12:05:15 -0400
commit45b918a17cfa26a0c58d7871b869aa13b0e45019 (patch)
tree9d8021f51dbc96f1c1cd8bba9a31af3b72d3f052 /src/Bitmap_cubical_complex
parent3842ab4cb969db75beb984164a6737ee15be0272 (diff)
moved location of top_dimensional_coface function
Diffstat (limited to 'src/Bitmap_cubical_complex')
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
index 0d6299d2..7496d74a 100644
--- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
+++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
@@ -110,6 +110,14 @@ class Bitmap_cubical_complex_base {
virtual inline std::vector<std::size_t> get_coboundary_of_a_cell(std::size_t cell) const;
/**
+ * This function computes the index of one of the top-dimensional cubes (chosen arbitrarily) associated
+ * to a given simplex handle. Note that the input parameter is not necessarily a cube, it might also
+ * be an edge or vertex of a cube. On the other hand, the output is always indicating the position of
+ * a cube in the data structure.
+ **/
+ inline int get_top_dimensional_coface_of_a_cell(int splx);
+
+ /**
* This procedure compute incidence numbers between cubes. For a cube \f$A\f$ of
* dimension n and a cube \f$B \subset A\f$ of dimension n-1, an incidence
* between \f$A\f$ and \f$B\f$ is the integer with which \f$B\f$ appears in the boundary of \f$A\f$.
@@ -603,6 +611,19 @@ void Bitmap_cubical_complex_base<T>::setup_bitmap_based_on_top_dimensional_cells
}
template <typename T>
+int Bitmap_cubical_complex_base<T>::get_top_dimensional_coface_of_a_cell(int splx) {
+ if (this->get_dimension_of_a_cell(splx) == this->dimension()){return splx;}
+ else{
+ for (auto v : this->get_coboundary_of_a_cell(splx)){
+ if(this->get_cell_data(v) == this->get_cell_data(splx)){
+ return this->get_top_dimensional_coface_of_a_cell(v);
+ }
+ }
+ }
+ return splx;
+}
+
+template <typename T>
Bitmap_cubical_complex_base<T>::Bitmap_cubical_complex_base(const std::vector<unsigned>& sizes_in_following_directions,
const std::vector<T>& top_dimensional_cells) {
this->setup_bitmap_based_on_top_dimensional_cells_list(sizes_in_following_directions, top_dimensional_cells);