C++ code for calculating bottleneck distance between two peristence diagrams with mex code for Matlab interop
Based on the Hopcroft-Karp algorithm
Depends on g++
compiler
make
From the Matlab command line, run
cd <THIS_DIRECTORY>
mex bottleneck_distance.cpp
Then from your Matlab code you can call
bottleneck_distance(mat1, mat2)
where mat1
and mat2
are two Mx2
matrices representing persistence diagrams.
The function outputs the distance between the two matrices.
You can also run from the command line if you have saved the persistence diagrams to files
./bottleneck pers_dia1.txt pers_dia2.txt
run test_bottleneck.sh
./test_bottleneck.sh
Written by Miro Kramer (2013), modified/optimized by Kelvin Abrokwa (2016)