summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/include/gudhi/Alpha_complex.h
diff options
context:
space:
mode:
authorVincent Rouvreau <vincent.rouvreau@inria.fr>2022-01-26 09:49:20 +0100
committerVincent Rouvreau <vincent.rouvreau@inria.fr>2022-01-26 09:49:20 +0100
commite88833431fbdd2b58b00fe3d3cf84973700477b3 (patch)
treec701f2414f640b02dd7f0d47869ec7c2ab029efe /src/Alpha_complex/include/gudhi/Alpha_complex.h
parent7cd975bcb4f932372a3abe932d3b22c9ea1ce38a (diff)
Code review: Remove empty_point_set_ that can be deduced from num_vertices (new method in Alpha_complex -> Abstract_alpha_complex -> In/Exact_alpha_complex_dD -> Alpha_complex_interface
Diffstat (limited to 'src/Alpha_complex/include/gudhi/Alpha_complex.h')
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex.h12
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) {