diff options
author | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-11-23 16:02:39 +0000 |
---|---|---|
committer | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-11-23 16:02:39 +0000 |
commit | 33ce062bf29b9bb7db9e83cde39cab6411d613dc (patch) | |
tree | 0d37464abbbe810904644692093af14206ff3d15 /src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h | |
parent | d93bbddf7692569c69e3f477914b6def597942fa (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/Persistence_diagrams_graph.h')
-rw-r--r-- | src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h index 1f6d6683..7af149e4 100644 --- a/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h +++ b/src/Bottleneck_distance/include/gudhi/Persistence_diagrams_graph.h @@ -25,11 +25,6 @@ #include <vector> #include <set> -#include <cmath> -#include <utility> -#include <algorithm> -#include <math.h> -#include <memory> #include <gudhi/Internal_point.h> namespace Gudhi { @@ -60,7 +55,7 @@ public: /** \internal \brief Returns size = |U| = |V|. */ static int size(); /** \internal \brief Returns the O(n^2) sorted distances between the points. */ - static std::shared_ptr< std::vector<double> > sorted_distances(); + static std::vector<double> sorted_distances(); /** \internal \brief Returns an upper bound of the diameter of the convex hull */ static double diameter(); @@ -126,15 +121,14 @@ inline int G::size() { return static_cast<int> (u.size() + v.size()); } -inline std::shared_ptr< std::vector<double> > G::sorted_distances() { +inline std::vector<double> G::sorted_distances() { // could be optimized std::set<double> sorted_distances; sorted_distances.emplace(0.); for (int u_point_index = 0; u_point_index < size(); ++u_point_index) for (int v_point_index = 0; v_point_index < size(); ++v_point_index) sorted_distances.emplace(distance(u_point_index, v_point_index)); - std::shared_ptr< std::vector<double> > sd_up(new std::vector<double>(sorted_distances.cbegin(), sorted_distances.cend())); - return sd_up; + return std::vector<double>(sorted_distances.begin(),sorted_distances.end()); } inline Internal_point G::get_u_point(int u_point_index) { |