summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-20 12:42:27 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-20 12:42:27 +0000
commita823bfcb70ed76e8858604050570ff8fe33f6667 (patch)
treef21f8be40f8aeb7b71e2b1aeb60c03254651f5d4 /src/Bottleneck_distance/include/gudhi/Persistence_graph.h
parentfb0c2d4d50b1fcb8ba6758883d27df0aad5de356 (diff)
cpplint fixes
doxygen warning fixes git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_misc_fixes@1972 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 5b2328016edb6b5b30de668a0488c576d3d92c40
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Persistence_graph.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
index 3a4a5fec..39efc082 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 {
@@ -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 {