summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Bottleneck.h
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-15 16:24:35 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-15 16:24:35 +0000
commit93c82310194d5fc28979e86287f15dacddbaa5ba (patch)
treea3cc37ef8f011460a863c3f4a3ec8ad7bc017ccf /src/Bottleneck_distance/include/gudhi/Bottleneck.h
parent9906477eb45f16cfafe7186482f4c44606c575dc (diff)
small modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1882 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 11247904405f3da37514e5cc4848c6971edb4254
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Bottleneck.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Bottleneck.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
index 0c9e5ea8..24a31ac1 100644
--- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h
+++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
@@ -46,12 +46,11 @@ double bottleneck_distance(const Persistence_diagram1 &diag1, const Persistence_
sd = g.sorted_distances();
long idmin = 0;
long idmax = e==0. ? sd.size() - 1 : g.diameter_bound()/e + 1;
- // alpha can change the complexity
- double alpha = std::pow(idmax, 0.25);
+ double alpha = std::pow(g.size(), 1./5.);
Graph_matching m(g);
Graph_matching biggest_unperfect(g);
while (idmin != idmax) {
- long step = static_cast<long>((idmax - idmin) / alpha);
+ long step = static_cast<long>((idmax - idmin - 1)/alpha);
m.set_r(e == 0. ? sd.at(idmin + step) : e*(idmin + step));
while (m.multi_augment());
//The above while compute a maximum matching (according to the r setted before)