summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Bottleneck.h
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-11-23 16:02:39 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-11-23 16:02:39 +0000
commit33ce062bf29b9bb7db9e83cde39cab6411d613dc (patch)
tree0d37464abbbe810904644692093af14206ff3d15 /src/Bottleneck_distance/include/gudhi/Bottleneck.h
parentd93bbddf7692569c69e3f477914b6def597942fa (diff)
functions no longer return smart pointers
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1779 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: bc5e1b480774441c9af5e0ed902c455c6453c480
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Bottleneck.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Bottleneck.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
index 6b6b1552..1ae7788c 100644
--- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h
+++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
@@ -43,16 +43,16 @@ double compute_exactly(const Persistence_diagram1& diag1, const Persistence_diag
template<typename Persistence_diagram1, typename Persistence_diagram2>
double compute_exactly(const Persistence_diagram1 &diag1, const Persistence_diagram2 &diag2) {
G::initialize(diag1, diag2, 0.);
- std::shared_ptr< std::vector<double> > sd(G::sorted_distances());
+ std::vector<double> sd(G::sorted_distances());
int idmin = 0;
- int idmax = sd->size() - 1;
+ int idmax = sd.size() - 1;
// alpha can be modified, this will change the complexity
- double alpha = pow(sd->size(), 0.25);
+ double alpha = pow(sd.size(), 0.25);
Graph_matching m;
Graph_matching biggest_unperfect;
while (idmin != idmax) {
int step = static_cast<int>((idmax - idmin) / alpha);
- m.set_r(sd->at(idmin + step));
+ m.set_r(sd.at(idmin + step));
while (m.multi_augment());
//The above while compute a maximum matching (according to the r setted before)
if (m.perfect()) {
@@ -63,7 +63,7 @@ double compute_exactly(const Persistence_diagram1 &diag1, const Persistence_diag
idmin = idmin + step + 1;
}
}
- return sd->at(idmin);
+ return sd.at(idmin);
}
template<typename Persistence_diagram1, typename Persistence_diagram2>