summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Bottleneck_distance/example/bottleneck_read_file_example.cpp12
-rw-r--r--src/cython/doc/bottleneck_distance_user.rst4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp b/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
index 1408681a..24d73c57 100644
--- a/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_read_file_example.cpp
@@ -25,21 +25,21 @@
#include <iostream>
#include <vector>
#include <utility> // for pair
-#include <fstream>
-#include <sstream>
#include <string>
+#include <limits> // for numeric_limits
int main(int argc, char** argv) {
if (argc < 3) {
- std::cout << "To run this program please provide as an input two files with persistence diagrams. Each file " <<
- "should contain a birth-death pair per line. Third, optional parameter is an error bound on a bottleneck" <<
- " distance (set by default to zero). The program will now terminate \n";
+ std::cout << "To run this program please provide as an input two files with persistence diagrams. Each file" <<
+ " should contain a birth-death pair per line. Third, optional parameter is an error bound on a bottleneck" <<
+ " distance (set by default to the smallest positive double value). If you set the error bound to 0, be" <<
+ " aware this version is exact but expensive. The program will now terminate \n";
return -1;
}
std::vector<std::pair<double, double>> diag1 = Gudhi::read_persistence_intervals_in_dimension(argv[1]);
std::vector<std::pair<double, double>> diag2 = Gudhi::read_persistence_intervals_in_dimension(argv[2]);
- double tolerance = 0.;
+ double tolerance = std::numeric_limits<double>::min();
if (argc == 4) {
tolerance = atof(argv[3]);
}
diff --git a/src/cython/doc/bottleneck_distance_user.rst b/src/cython/doc/bottleneck_distance_user.rst
index 0066992f..7692dce2 100644
--- a/src/cython/doc/bottleneck_distance_user.rst
+++ b/src/cython/doc/bottleneck_distance_user.rst
@@ -25,7 +25,7 @@ This example computes the bottleneck distance from 2 persistence diagrams:
message = "Bottleneck distance approximation=" + '%.2f' % gudhi.bottleneck_distance(diag1, diag2, 0.1)
print(message)
- message = "Bottleneck distance exact value=" + '%.2f' % gudhi.bottleneck_distance(diag1, diag2, 0)
+ message = "Bottleneck distance value=" + '%.2f' % gudhi.bottleneck_distance(diag1, diag2)
print(message)
The output is:
@@ -33,4 +33,4 @@ The output is:
.. testoutput::
Bottleneck distance approximation=0.81
- Bottleneck distance exact value=0.75
+ Bottleneck distance value=0.75