From 99695369a066962339d7f85a4dc4981a804b3a54 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 31 Mar 2017 09:57:00 +0000 Subject: Bad choose of exact / approx computation git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2293 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 7ba263cefcc0a76d223e4fba7f21ed96a525d16e --- src/cython/cython/bottleneck_distance.pyx | 6 ++++-- src/cython/doc/bottleneck_distance_user.rst | 2 +- 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: -- cgit v1.2.3