summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Bottleneck.h
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-11-28 14:15:22 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-11-28 14:15:22 +0000
commitcc1e554f26765bf9993079bef608d9bc4a3308c8 (patch)
tree0783744fe7af7527fde89f405356cae1334c160d /src/Bottleneck_distance/include/gudhi/Bottleneck.h
parente9dd788438bff7289ddff1e0ade2de0f031a2f9b (diff)
graph no longer static
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1790 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 6bbb8dfaffd09a81ccafac6919e073ed74b9c7e6
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Bottleneck.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Bottleneck.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
index bb0a13d2..52de30be 100644
--- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h
+++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
@@ -31,14 +31,14 @@ namespace bottleneck_distance {
template<typename Persistence_diagram1, typename Persistence_diagram2>
double compute_exactly(const Persistence_diagram1 &diag1, const Persistence_diagram2 &diag2) {
- G::initialize(diag1, diag2, 0.);
- std::vector<double> sd(G::sorted_distances());
+ Persistence_graph g(diag1, diag2, 0.);
+ std::vector<double> sd(g.sorted_distances());
int idmin = 0;
int idmax = sd.size() - 1;
- // alpha can be modified, this will change the complexity
+ // alpha can change the complexity
double alpha = pow(sd.size(), 0.25);
- Graph_matching m;
- Graph_matching biggest_unperfect;
+ Graph_matching m(g);
+ Graph_matching biggest_unperfect(g);
while (idmin != idmax) {
int step = static_cast<int>((idmax - idmin) / alpha);
m.set_r(sd.at(idmin + step));
@@ -64,14 +64,14 @@ template<typename Persistence_diagram1, typename Persistence_diagram2>
double compute(const Persistence_diagram1 &diag1, const Persistence_diagram2 &diag2, double e=0.) {
if(e == 0.)
return compute_exactly(diag1, diag2);
- G::initialize(diag1, diag2, e);
- int in = G::diameter()/e + 1;
+ Persistence_graph g(diag1, diag2, e);
+ int in = g.diameter_bound()/e + 1;
int idmin = 0;
int idmax = in;
- // alpha can be modified, this will change the complexity
- double alpha = pow(in, 0.25);
- Graph_matching m;
- Graph_matching biggest_unperfect;
+ // alpha can change the complexity
+ double alpha = pow(in, 0.10);
+ Graph_matching m(g);
+ Graph_matching biggest_unperfect(g);
while (idmin != idmax) {
int step = static_cast<int>((idmax - idmin) / alpha);
m.set_r(e*(idmin + step));