diff options
author | Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> | 2022-11-21 10:23:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 10:23:02 +0100 |
commit | f361ecc561ea9a3cc8a4d8408bb8e094f211247e (patch) | |
tree | cef47c775ebd77f51c3085e5cf7abf517c8e7070 /src/python | |
parent | 58ae82b2fdf5c38ad26d17302dec1e4d3f03fd50 (diff) | |
parent | 04370bae13251d0bcce205f253fb758f91fdf207 (diff) |
Merge pull request #735 from mglisse/hera2
Update to Hera 2
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/gudhi/hera/bottleneck.cc | 2 | ||||
-rw-r--r-- | src/python/gudhi/hera/wasserstein.cc | 10 | ||||
-rw-r--r-- | src/python/setup.py.in | 6 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/python/gudhi/hera/bottleneck.cc b/src/python/gudhi/hera/bottleneck.cc index 0cb562ce..ec461f7c 100644 --- a/src/python/gudhi/hera/bottleneck.cc +++ b/src/python/gudhi/hera/bottleneck.cc @@ -16,7 +16,7 @@ using py::ssize_t; #endif -#include <bottleneck.h> // Hera +#include <hera/bottleneck.h> // Hera double bottleneck_distance(Dgm d1, Dgm d2, double delta) { diff --git a/src/python/gudhi/hera/wasserstein.cc b/src/python/gudhi/hera/wasserstein.cc index fa0cf8aa..3516352e 100644 --- a/src/python/gudhi/hera/wasserstein.cc +++ b/src/python/gudhi/hera/wasserstein.cc @@ -8,10 +8,16 @@ * - YYYY/MM Author: Description of the modification */ -#include <wasserstein.h> // Hera - #include <pybind11_diagram_utils.h> +#ifdef _MSC_VER +// https://github.com/grey-narn/hera/issues/3 +// ssize_t is a non-standard type (well, posix) +using py::ssize_t; +#endif + +#include <hera/wasserstein.h> // Hera + double wasserstein_distance( Dgm d1, Dgm d2, double wasserstein_power, double internal_p, diff --git a/src/python/setup.py.in b/src/python/setup.py.in index 2c67c2c5..1ecbe985 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -48,10 +48,8 @@ ext_modules = cythonize(ext_modules, compiler_directives={'language_level': '3'} for module in pybind11_modules: my_include_dirs = include_dirs + [pybind11.get_include(False), pybind11.get_include(True)] - if module == 'hera/wasserstein': - my_include_dirs = ['@HERA_WASSERSTEIN_INCLUDE_DIR@'] + my_include_dirs - elif module == 'hera/bottleneck': - my_include_dirs = ['@HERA_BOTTLENECK_INCLUDE_DIR@'] + my_include_dirs + if module.startswith('hera/'): + my_include_dirs = ['@HERA_INCLUDE_DIR@'] + my_include_dirs ext_modules.append(Extension( 'gudhi.' + module.replace('/', '.'), sources = [source_dir + module + '.cc'], |