summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cython/cython/bottleneck_distance.pyx6
-rw-r--r--src/cython/doc/bottleneck_distance_user.rst2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/cython/cython/bottleneck_distance.pyx b/src/cython/cython/bottleneck_distance.pyx
index ee3e6ef9..9fb377ff 100644
--- a/src/cython/cython/bottleneck_distance.pyx
+++ b/src/cython/cython/bottleneck_distance.pyx
@@ -33,7 +33,7 @@ cdef extern from "Bottleneck_distance_interface.h" namespace "Gudhi::persistence
double bottleneck(vector[pair[double, double]], vector[pair[double, double]], double)
double bottleneck(vector[pair[double, double]], vector[pair[double, double]])
-def bottleneck_distance(diagram_1, diagram_2, e=0.0):
+def bottleneck_distance(diagram_1, diagram_2, e=None):
"""This function returns the point corresponding to a given vertex.
:param diagram_1: The first diagram.
@@ -53,7 +53,9 @@ def bottleneck_distance(diagram_1, diagram_2, e=0.0):
:rtype: float
:returns: the bottleneck distance.
"""
- if e is 0.0:
+ if e is None:
+ # Default value is the smallest double value (not 0, 0 is for exact version)
return bottleneck(diagram_1, diagram_2)
else:
+ # Can be 0 for exact version
return bottleneck(diagram_1, diagram_2, e)
diff --git a/src/cython/doc/bottleneck_distance_user.rst b/src/cython/doc/bottleneck_distance_user.rst
index 3bc170f4..8c29d069 100644
--- a/src/cython/doc/bottleneck_distance_user.rst
+++ b/src/cython/doc/bottleneck_distance_user.rst
@@ -26,7 +26,7 @@ This example computes the bottleneck distance from 2 persistence diagrams:
message = "Bottleneck distance approximation=" + repr(gudhi.bottleneck_distance(diag1, diag2, 0.1))
print(message)
- message = "Bottleneck distance exact value=" + repr(gudhi.bottleneck_distance(diag1, diag2))
+ message = "Bottleneck distance exact value=" + repr(gudhi.bottleneck_distance(diag1, diag2, 0))
print(message)
The output is: