diff options
Diffstat (limited to 'geom_bottleneck/example/bottleneck_dist.cpp')
-rw-r--r-- | geom_bottleneck/example/bottleneck_dist.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/geom_bottleneck/example/bottleneck_dist.cpp b/geom_bottleneck/example/bottleneck_dist.cpp index b66e7bc..8966789 100644 --- a/geom_bottleneck/example/bottleneck_dist.cpp +++ b/geom_bottleneck/example/bottleneck_dist.cpp @@ -48,35 +48,27 @@ int main(int argc, char* argv[]) PairVector diagramA, diagramB; int decPrecision { 0 }; - if (!hera::bt::readDiagramPointSet(argv[1], diagramA, decPrecision)) { + if (!hera::readDiagramPointSet(argv[1], diagramA, decPrecision)) { std::exit(1); } - if (!hera::bt::readDiagramPointSet(argv[2], diagramB, decPrecision)) { + if (!hera::readDiagramPointSet(argv[2], diagramB, decPrecision)) { std::exit(1); } double res; + hera::bt::MatchingEdge<double> e; if (argc >= 4) { // the third parameter is epsilon, // return approximate distance (faster) double delta = atof(argv[3]); if (delta > 0.0) { if (useSamplingHeur && diagramA.size() > heurThreshold && diagramB.size() > heurThreshold) { -#ifdef VERBOSE_BOTTLENECK - std::cout << "using sampling heuristic" << std::endl; -#endif res = hera::bottleneckDistApproxHeur(diagramA, diagramB, delta); } else { -#ifdef VERBOSE_BOTTLENECK - std::cout << "NOT using sampling heuristic" << std::endl; -#endif - res = hera::bottleneckDistApprox(diagramA, diagramB, delta); + res = hera::bottleneckDistApprox(diagramA, diagramB, delta, e, true); } } else if (delta == 0.0) { -#ifdef VERBOSE_BOTTLENECK - std::cout << "NOT using sampling heuristic, computing EXACT answer" << std::endl; -#endif res = hera::bottleneckDistExact(diagramA, diagramB, decPrecision); } else { std::cerr << "The third parameter (relative error) must be positive!" << std::endl; @@ -84,13 +76,12 @@ int main(int argc, char* argv[]) } } else { // only filenames have been supplied, return exact distance -#ifdef VERBOSE_BOTTLENECK - std::cout << "NOT using sampling heuristic, computing EXACT answer" << std::endl; -#endif - res = hera::bottleneckDistExact(diagramA, diagramB, decPrecision); + res = hera::bottleneckDistExact(diagramA, diagramB, decPrecision, e, true); + } std::cout << std::setprecision(15) << res << std::endl; - + //std::cout << "Longest edge " << e.first.get_user_id() << " <-> " << e.second.get_user_id() << std::endl; + //std::cout << "Longest edge " << e.first << " <-> " << e.second << std::endl; // Alternative could be to construct DiagramPointSet // using the constructor with iterators. // May be useful if the same diagram is used multiple times |