diff options
author | Gard Spreemann <gspr@nonempty.org> | 2023-01-20 13:47:30 +0100 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2023-01-20 13:47:30 +0100 |
commit | 688cbc5c29d0a6aaf233eee185a06cef5cb2e745 (patch) | |
tree | cb13b84e9f7cddea48b903d24014f63d1dfda7e3 /src/Nerve_GIC/include/gudhi/GIC.h | |
parent | 2b3caf86fc6500a9fca9e9085012a2315fbbac3b (diff) | |
parent | ed492f09ca3c9d7cd972bbbbec37f680cd624fbe (diff) |
Merge tag 'tags/gudhi-release-3.7.1' into dfsg/latestdfsg/latest
Diffstat (limited to 'src/Nerve_GIC/include/gudhi/GIC.h')
-rw-r--r-- | src/Nerve_GIC/include/gudhi/GIC.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index 1b1f9323..047fba61 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -17,6 +17,14 @@ #include <mutex> #endif +#if __has_include(<CGAL/version.h>) +# define GUDHI_GIC_USE_CGAL 1 +# include <gudhi/Bottleneck.h> +#elif __has_include(<hera/bottleneck.h>) +# define GUDHI_GIC_USE_HERA 1 +# include <hera/bottleneck.h> +#endif + #include <gudhi/Debug_utils.h> #include <gudhi/graph_simplicial_complex.h> #include <gudhi/reader_utils.h> @@ -25,7 +33,6 @@ #include <gudhi/Points_off_io.h> #include <gudhi/distance_functions.h> #include <gudhi/Persistent_cohomology.h> -#include <gudhi/Bottleneck.h> #include <boost/config.hpp> #include <boost/graph/graph_traits.hpp> @@ -35,8 +42,6 @@ #include <boost/graph/subgraph.hpp> #include <boost/graph/graph_utility.hpp> -#include <CGAL/version.h> // for CGAL_VERSION_NR - #include <iostream> #include <vector> #include <map> @@ -1228,7 +1233,14 @@ class Cover_complex { Cboot.set_cover_from_function(); Cboot.find_simplices(); Cboot.compute_PD(); +#ifdef GUDHI_GIC_USE_CGAL double db = Gudhi::persistence_diagram::bottleneck_distance(this->PD, Cboot.PD); +#elif defined GUDHI_GIC_USE_HERA + double db = hera::bottleneckDistExact(this->PD, Cboot.PD); +#else + double db; + throw std::logic_error("This function requires CGAL or Hera for the bottleneck distance."); +#endif if (verbose) std::clog << db << std::endl; distribution.push_back(db); } |