summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Persistence_graph.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
index 3a4a5fec..c7695112 100644
--- a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
+++ b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
@@ -23,9 +23,11 @@
#ifndef PERSISTENCE_GRAPH_H_
#define PERSISTENCE_GRAPH_H_
+#include <gudhi/Internal_point.h>
+
#include <vector>
#include <algorithm>
-#include <gudhi/Internal_point.h>
+#include <limits> // for numeric_limits
namespace Gudhi {
@@ -38,7 +40,7 @@ namespace persistence_diagram {
*/
class Persistence_graph {
public:
- /** \internal \brief Constructor taking 2 Persistence_Diagrams (concept) as parameters. */
+ /** \internal \brief Constructor taking 2 PersistenceDiagrams (concept) as parameters. */
template<typename Persistence_diagram1, typename Persistence_diagram2>
Persistence_graph(const Persistence_diagram1& diag1, const Persistence_diagram2& diag2, double e);
/** \internal \brief Is the given point from U the projection of a point in V ? */
@@ -92,10 +94,12 @@ Persistence_graph::Persistence_graph(const Persistence_diagram1 &diag1,
swap(u, v);
std::sort(u_alive.begin(), u_alive.end());
std::sort(v_alive.begin(), v_alive.end());
- if (u_alive.size() != v_alive.size())
+ if (u_alive.size() != v_alive.size()) {
b_alive = std::numeric_limits<double>::infinity();
- else for (auto it_u = u_alive.cbegin(), it_v = v_alive.cbegin(); it_u != u_alive.cend(); ++it_u, ++it_v)
+ } else {
+ for (auto it_u = u_alive.cbegin(), it_v = v_alive.cbegin(); it_u != u_alive.cend(); ++it_u, ++it_v)
b_alive = std::max(b_alive, std::fabs(*it_u - *it_v));
+ }
}
inline bool Persistence_graph::on_the_u_diagonal(int u_point_index) const {