summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance
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
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')
-rw-r--r--src/Bottleneck_distance/example/bottleneck_basic_example.cpp6
-rw-r--r--src/Bottleneck_distance/example/bottleneck_read_file_example.cpp2
-rw-r--r--src/Bottleneck_distance/include/gudhi/Bottleneck.h9
-rw-r--r--src/Bottleneck_distance/include/gudhi/Graph_matching.h3
-rw-r--r--src/Bottleneck_distance/include/gudhi/Neighbors_finder.h1
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h10
6 files changed, 24 insertions, 7 deletions
diff --git a/src/Bottleneck_distance/example/bottleneck_basic_example.cpp b/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
index 91a7302f..d0ca4e20 100644
--- a/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_basic_example.cpp
@@ -21,10 +21,13 @@
*/
#include <gudhi/Bottleneck.h>
+
#include <iostream>
+#include <vector>
+#include <utility> // for pair
+#include <limits> // for numeric_limits
int main() {
-
std::vector< std::pair<double, double> > v1, v2;
v1.emplace_back(2.7, 3.7);
@@ -44,5 +47,4 @@ int main() {
b = Gudhi::persistence_diagram::bottleneck_distance(v1, v2, 0.1);
std::cout << "Approx bottleneck distance = " << b << std::endl;
-
}
diff --git a/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp b/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
index 4c74b66e..bde05825 100644
--- a/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
@@ -24,6 +24,8 @@
#include <gudhi/Bottleneck.h>
#include <iostream>
+#include <vector>
+#include <utility> // for pair
#include <fstream>
#include <sstream>
#include <string>
diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
index 2b7e4767..b5641e29 100644
--- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h
+++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
@@ -24,6 +24,11 @@
#define BOTTLENECK_H_
#include <gudhi/Graph_matching.h>
+
+#include <vector>
+#include <algorithm> // for max
+#include <limits> // for numeric_limits
+
#include <cmath>
namespace Gudhi {
@@ -41,7 +46,7 @@ double bottleneck_distance_approx(Persistence_graph& g, double e) {
if (step <= b_lower_bound || step >= b_upper_bound) // Avoid precision problem
break;
m.set_r(step);
- while (m.multi_augment()); // compute a maximum matching (in the graph corresponding to the current r)
+ while (m.multi_augment()) {}; // compute a maximum matching (in the graph corresponding to the current r)
if (m.perfect()) {
m = biggest_unperfect;
b_upper_bound = step;
@@ -63,7 +68,7 @@ double bottleneck_distance_exact(Persistence_graph& g) {
while (lower_bound_i != upper_bound_i) {
long step = lower_bound_i + static_cast<long> ((upper_bound_i - lower_bound_i - 1) / alpha);
m.set_r(sd.at(step));
- while (m.multi_augment()); // compute a maximum matching (in the graph corresponding to the current r)
+ while (m.multi_augment()) {}; // compute a maximum matching (in the graph corresponding to the current r)
if (m.perfect()) {
m = biggest_unperfect;
upper_bound_i = step;
diff --git a/src/Bottleneck_distance/include/gudhi/Graph_matching.h b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
index 253c89b4..e1708c5b 100644
--- a/src/Bottleneck_distance/include/gudhi/Graph_matching.h
+++ b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
@@ -25,6 +25,9 @@
#include <gudhi/Neighbors_finder.h>
+#include <vector>
+#include <list>
+
namespace Gudhi {
namespace persistence_diagram {
diff --git a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
index 96ece360..cd5486f8 100644
--- a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
+++ b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
@@ -34,6 +34,7 @@
#include <gudhi/Internal_point.h>
#include <unordered_set>
+#include <vector>
namespace Gudhi {
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 {