diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-06-13 17:13:42 +0200 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-06-13 17:13:42 +0200 |
commit | a1088d88479e6c18c5ade73ffc34bba2bf37bc1d (patch) | |
tree | 14309e99a25093275b0a2be20d4c4786e7fad2a9 /src/Bottleneck_distance/doc/Intro_bottleneck_distance.h | |
parent | 08ddc6dbbbb1cf01a05ab23ece47c3d8cf9957ea (diff) | |
parent | f9a2172f24da8d7538c67fbf4e7580ab09b456c5 (diff) |
Merge master branch
Diffstat (limited to 'src/Bottleneck_distance/doc/Intro_bottleneck_distance.h')
-rw-r--r-- | src/Bottleneck_distance/doc/Intro_bottleneck_distance.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h index 48078903..d58392ae 100644 --- a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h +++ b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h @@ -8,6 +8,7 @@ * * Modification(s): * - YYYY/MM Author: Description of the modification + * - 2019/06 Vincent Rouvreau : Fix #11 - Distance computation shall be better documented. */ #ifndef DOC_BOTTLENECK_DISTANCE_INTRO_BOTTLENECK_DISTANCE_H_ @@ -27,13 +28,51 @@ namespace persistence_diagram { * * The bottleneck distance measures the similarity between two persistence diagrams. It is the shortest distance b for * which there exists a perfect matching between the points of the two diagrams (completed with all the points on the - * diagonal in order to ignore cardinality mismatchs) such that any couple of matched points are at distance at most b. + * diagonal in order to ignore cardinality mismatchs) such that any couple of matched points are at distance at most b, + * where the distance between points is the sup norm in \f$\mathbb{R}^2\f$ (not the Euclidean distance). * * \image html perturb_pd.png On this picture, the red edges represent the matching. The bottleneck distance is the length of the longest edge. * * This implementation is based on ideas from "Geometry Helps in Bottleneck Matching and Related Problems" * \cite DBLP:journals/algorithmica/EfratIK01. Another relevant publication, although it was not used is * "Geometry Helps to Compare Persistence Diagrams" \cite Kerber:2017:GHC:3047249.3064175. + * + * \section bottleneckdistanceprecision Distance computation + * + * The following example explains how the distance is computed: + * + * \code{.cpp} +#include <gudhi/Bottleneck.h> + +#include <iostream> +#include <vector> +#include <utility> // for pair + +int main() { + std::vector< std::pair<double, double> > diag1, diag2; + diag1.emplace_back(0., 0.); + diag2.emplace_back(0., 13.); + + double b = Gudhi::persistence_diagram::bottleneck_distance(diag1, diag2); + std::cout << "Bottleneck distance = " << b << std::endl; +} + * \endcode + * + * \code Bottleneck distance = 6.5 + * \endcode + * + * \image html bottleneck_distance_example.png The point (0, 13) is at distance 6.5 from the diagonal and more specifically from the point (6.5, 6.5) + * + * \section bottleneckbasicexample Basic example + * + * This other example computes the bottleneck distance from 2 persistence diagrams: + * \include Bottleneck_distance/bottleneck_basic_example.cpp + * + * \code + Bottleneck distance = 0.75 + Approx bottleneck distance = 0.808176 + * \endcode + */ /** @} */ // end defgroup bottleneck_distance |