diff options
author | Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> | 2023-01-11 10:48:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 10:48:23 +0100 |
commit | e22566a6721c050c964c5ad1f29a3e9066c12ba9 (patch) | |
tree | 828d24784dfc0b17889aa5ad84fd983d12a70c0c /src/python/gudhi/hera/bottleneck.cc | |
parent | 7b9c272f7dad66ad9b05dcdd5ec43e86fda306c4 (diff) | |
parent | eb6c94ea1125bf216ec5f07b2936dd115e461aa4 (diff) |
Merge pull request #736 from mglisse/hera-match
Provide matching in hera.wasserstein_distance
Diffstat (limited to 'src/python/gudhi/hera/bottleneck.cc')
-rw-r--r-- | src/python/gudhi/hera/bottleneck.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/python/gudhi/hera/bottleneck.cc b/src/python/gudhi/hera/bottleneck.cc index ec461f7c..9826252c 100644 --- a/src/python/gudhi/hera/bottleneck.cc +++ b/src/python/gudhi/hera/bottleneck.cc @@ -16,13 +16,16 @@ using py::ssize_t; #endif -#include <hera/bottleneck.h> // Hera +#include <hera/bottleneck.h> + +// Indices are added internally in bottleneck_distance, they are not needed in the input. +static auto make_point(double x, double y, py::ssize_t) { return std::pair(x, y); }; double bottleneck_distance(Dgm d1, Dgm d2, double delta) { - // I *think* the call to request() has to be before releasing the GIL. - auto diag1 = numpy_to_range_of_pairs(d1); - auto diag2 = numpy_to_range_of_pairs(d2); + // I *think* the call to request() in numpy_to_range_of_pairs has to be before releasing the GIL. + auto diag1 = numpy_to_range_of_pairs(d1, make_point); + auto diag2 = numpy_to_range_of_pairs(d2, make_point); py::gil_scoped_release release; |