summaryrefslogtreecommitdiff
path: root/geom_bottleneck/README
diff options
context:
space:
mode:
Diffstat (limited to 'geom_bottleneck/README')
-rw-r--r--geom_bottleneck/README41
1 files changed, 17 insertions, 24 deletions
diff --git a/geom_bottleneck/README b/geom_bottleneck/README
index 839ffa5..8b368af 100644
--- a/geom_bottleneck/README
+++ b/geom_bottleneck/README
@@ -4,11 +4,6 @@ Bug reports can be sent to "nigmetov EMAIL SIGN tugraz DOT at".
# Dependencies
-The program uses the ANN library (http://www.cs.umd.edu/~mount/ANN/),
-modified to support deletion of points from k-d trees.
-The modified version is contained in "bottleneck/src/ann" and "bottleneck/iclude/ANN"
-directories, there is no need to build ANN separately or include ANN's headers.
-
Your compiler must support C++11.
# Usage:
@@ -38,8 +33,10 @@ x_n y_n
#include "bottleneck.h"
-// All classes and functions are in geom_bt namespace
-// (including modified ANN's classes).
+// the functions hera::bottleneckDistExact, hera::bottleneckDistApprox
+// return the exact and approximate bottleneck distance.
+
+// function hera::readDiagramPointSet reads diagram from a plain-text file.
std::vector<std::pair<double, double>> diagram1, diagram2;
// any container class that supports range-for loops will do.
@@ -50,25 +47,25 @@ std::vector<std::pair<double, double>> diagram1, diagram2;
// load your diagrams into diagram1, diagram2 (off-diagonal points).
// If you data is in plain text format, you can use readDiagramPointSet function:
-if (!geom_bt::readDiagramPointSet("diagram1.txt", diagram1)) {
+if (!hera::readDiagramPointSet("diagram1.txt", diagram1)) {
// something went wrong: function returns true if it successfully read the file
}
// OK: diagram1.txt was read.
// ...
// to get exact distance:
-double btDist = geom_bt::bottleneckDistExact(diagram1, diagram2);
+double btDist = hera::bottleneckDistExact(diagram1, diagram2);
// to get 1% approximation
-double btDistApprox = geom_bt::bottleneckDistApprox(diagram1, diagram2, 0.01);
+double btDistApprox = hera::bottleneckDistApprox(diagram1, diagram2, 0.01);
// ..............................................................................
// if diagrams will be used many times, you may want to avoid copying them
-// to DiagramPointSet (which is done internally in each call to
+// to hera::bt::DiagramPointSet (which is done internally in each call to
bottleneckDistExact/bottleneckDistApprox) and do it yourself once.
// Constructor takes two iterators:
-geom_bt::DiagramPointSet ds1(diagram1.begin(), diagram1.end());
-geom_bt::DiagramPointSet ds2(diagram2.begin(), diagram2.end());
-btDist = geom_bt::bottleneckDistExact(ds1, ds2);
-btDistApprox = geom_bt::bottleneckDistApprox(ds1, ds2, 0.01);
+hera::bt::DiagramPointSet ds1(diagram1.begin(), diagram1.end());
+hera::bt::DiagramPointSet ds2(diagram2.begin(), diagram2.end());
+btDist = hera::bt::bottleneckDistExact(ds1, ds2);
+btDistApprox = hera::bt::bottleneckDistApprox(ds1, ds2, 0.01);
Necessary projections (diagonal points) will be added in the bottleneckDistApprox
function.
@@ -79,20 +76,16 @@ See also code in example/bottleneck_dist.cpp.
1) If bottleneckDistApprox is called with epsilon = 0.0, it will never return.
2) Empty diagrams are not considered as error.
-3) Modifications made in the ANN code are only valid for 2-dimensional k-d trees.
-Do not use the modified ANN files from the project folder anywhere else.
-4) You can switch to non-geometric version by using another typedef in
-bottleneck/include/neigb_oracle.h.
# License
-The program is distributed under Lesser GPL license.
+See licence.txt
# Building
-CMakeLists.txt in the root directory can be used to make the library (contained
-in bottleneck/ directory) and the command-line utility (in example/ directory)
-to compute the distance between two diagrams in txt files.
+CMakeLists.txt in the root directory can be used to build
+the command-line utility (in example/ directory).
+The library itself is header-only and does not require separate compilation.
On Linux/Mac:
@@ -101,5 +94,5 @@ cd build
cmake ..
make
-On Windows (checked with Visual Studio 2015, Community version)
+On Windows:
use cmake-gui to create the solution in build directory and build it with VS.