diff options
author | tlacombe <lacombe1993@gmail.com> | 2021-04-12 10:37:27 +0200 |
---|---|---|
committer | tlacombe <lacombe1993@gmail.com> | 2021-04-12 10:37:27 +0200 |
commit | 69341c88c7c7819656c9a9b935fecc3bea50e4af (patch) | |
tree | 7fa0646180c04fb32854ca0aaf29d192d5e4118f /src/Bottleneck_distance/include/gudhi/Persistence_graph.h | |
parent | e94892f972357283e70c7534f84662dfaa21cc3e (diff) | |
parent | 7e05e915adc1be285e04eb00d3ab7ba1b797f38d (diff) |
merge upstream/master into essential parts
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Persistence_graph.h')
-rw-r--r-- | src/Bottleneck_distance/include/gudhi/Persistence_graph.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h index e1e3522e..33f03b9c 100644 --- a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h +++ b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h @@ -45,14 +45,14 @@ class Persistence_graph { int corresponding_point_in_v(int u_point_index) const; /** \internal \brief Given a point from U and a point from V, returns the distance between those points. */ double distance(int u_point_index, int v_point_index) const; - /** \internal \brief Returns size = |U| = |V|. */ + /** \internal \brief Returns size = |U| + |V|. */ int size() const; /** \internal \brief Is there as many infinite points (alive components) in both diagrams ? */ double bottleneck_alive() const; /** \internal \brief Returns the O(n^2) sorted distances between the points. */ std::vector<double> sorted_distances() const; - /** \internal \brief Returns an upper bound for the diameter of the convex hull of all non infinite points */ - double diameter_bound() const; + /** \internal \brief Returns an upper bound for the bottleneck distance of the finite points. */ + double max_dist_to_diagonal() const; /** \internal \brief Returns the corresponding internal point */ Internal_point get_u_point(int u_point_index) const; /** \internal \brief Returns the corresponding internal point */ @@ -160,13 +160,13 @@ inline Internal_point Persistence_graph::get_v_point(int v_point_index) const { return Internal_point(m, m, v_point_index); } -inline double Persistence_graph::diameter_bound() const { +inline double Persistence_graph::max_dist_to_diagonal() const { double max = 0.; - for (auto it = u.cbegin(); it != u.cend(); it++) - max = (std::max)(max, it->y()); - for (auto it = v.cbegin(); it != v.cend(); it++) - max = (std::max)(max, it->y()); - return max; + for (auto& p : u) + max = (std::max)(max, p.y() - p.x()); + for (auto& p : v) + max = (std::max)(max, p.y() - p.x()); + return max / 2; } } // namespace persistence_diagram |