diff options
author | Hind-M <hind.montassif@gmail.com> | 2022-01-31 11:15:54 +0100 |
---|---|---|
committer | Hind-M <hind.montassif@gmail.com> | 2022-01-31 11:15:54 +0100 |
commit | 1209db091a89ed48527c34fff0cc9ef41c78d11f (patch) | |
tree | e34a11454579e27ad3c711b50a46c5c9670a3e54 /src/Alpha_complex/include/gudhi/Alpha_complex.h | |
parent | 8d1e7aeb3416194d00f45587d1ecea85ba218028 (diff) | |
parent | 7f1b8eb706c72921141b53e607d6e2aa28e2bf19 (diff) |
Merge remote-tracking branch 'upstream/master' into fetch_datasets
Diffstat (limited to 'src/Alpha_complex/include/gudhi/Alpha_complex.h')
-rw-r--r-- | src/Alpha_complex/include/gudhi/Alpha_complex.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h index e03bb161..028ec9bb 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h @@ -20,6 +20,7 @@ #include <stdlib.h> #include <math.h> // isnan, fmax #include <memory> // for std::unique_ptr +#include <cstddef> // for std::size_t #include <CGAL/Delaunay_triangulation.h> #include <CGAL/Regular_triangulation.h> // aka. Weighted Delaunay triangulation @@ -213,6 +214,15 @@ class Alpha_complex { Alpha_complex (Alpha_complex&& other) = delete; Alpha_complex& operator= (Alpha_complex&& other) = delete; + /** \brief Returns the number of finite vertices in the triangulation. + */ + std::size_t num_vertices() const { + if (triangulation_ == nullptr) + return 0; + else + return triangulation_->number_of_vertices(); + } + /** \brief get_point returns the point corresponding to the vertex given as parameter. * * @param[in] vertex Vertex handle of the point to retrieve. @@ -373,7 +383,7 @@ class Alpha_complex { // -------------------------------------------------------------------------------------------- // Simplex_tree construction from loop on triangulation finite full cells list - if (triangulation_->number_of_vertices() > 0) { + if (num_vertices() > 0) { for (auto cit = triangulation_->finite_full_cells_begin(); cit != triangulation_->finite_full_cells_end(); ++cit) { |