From 2487d8ae49f4d5bd101e4800d342254b13137bad Mon Sep 17 00:00:00 2001 From: Arnur Nigmetov Date: Wed, 22 Feb 2017 16:35:08 +0100 Subject: temporary fix for exact version from files --- geom_bottleneck/bottleneck/include/bottleneck.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'geom_bottleneck/bottleneck/include') diff --git a/geom_bottleneck/bottleneck/include/bottleneck.h b/geom_bottleneck/bottleneck/include/bottleneck.h index 3267c5d..2078965 100644 --- a/geom_bottleneck/bottleneck/include/bottleneck.h +++ b/geom_bottleneck/bottleneck/include/bottleneck.h @@ -50,9 +50,13 @@ std::pair bottleneckDistApproxInterval(DiagramPointSet& A, Diagr // see bottleneckDistApproxInterval double bottleneckDistApprox(DiagramPointSet& A, DiagramPointSet& B, const double epsilon); +// get exact bottleneck distance, +double bottleneckDistExact(DiagramPointSet& A, DiagramPointSet& B, const int decPrecision); + // get exact bottleneck distance, double bottleneckDistExact(DiagramPointSet& A, DiagramPointSet& B); + // functions taking containers as input // template parameter PairContainer must be a container of pairs of real // numbers (pair.first = x-coordinate, pair.second = y-coordinate) @@ -86,12 +90,31 @@ double bottleneckDistExact(PairContainer& A, PairContainer& B) { DiagramPointSet a(A.begin(), A.end()); DiagramPointSet b(B.begin(), B.end()); - return bottleneckDistExact(a, b); + return bottleneckDistExact(a, b, 14); +} + + +// get exact bottleneck distance, +template +double bottleneckDistExact(PairContainer& A, PairContainer& B, const int decPrecision) +{ + DiagramPointSet a(A.begin(), A.end()); + DiagramPointSet b(B.begin(), B.end()); + return bottleneckDistExact(a, b, decPrecision); } // fill in result with points from file fname // return false if file can't be opened // or error occurred while reading +// decPrecision is the maximal decimal precision in the input, +// it is zero if all coordinates in the input are integers +bool readDiagramPointSet(const char* fname, std::vector>& result, int& decPrecision); +// wrapper for standard string +bool readDiagramPointSet(const std::string& fname, std::vector>& result, int& decPrecision); + + +// these two functions are now just wrappers for the previous ones, +// in case someone needs them; decPrecision is ignored bool readDiagramPointSet(const char* fname, std::vector>& result); // wrapper for standard string bool readDiagramPointSet(const std::string& fname, std::vector>& result); -- cgit v1.2.3