diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2019-01-30 10:44:36 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2019-01-30 10:44:36 +0000 |
commit | 2905296b253588bd43de924d44585f9bfbd45540 (patch) | |
tree | 6e6a480a2363161b8d7d1d5c82bf3dc37485dda9 /src | |
parent | 32bde4c643a8af5195d4e30450f29c3ed422af8f (diff) | |
parent | 2ad604e2c6da20163beab079d3ab2dcb1b98f2cd (diff) |
Merge of last modifications in Nerve_GIC branch : remove input template type as the function code were restricting its type
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@4082 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 8cba0b33ef5c6fa4e5bead0a1332b920d89273e4
Diffstat (limited to 'src')
-rw-r--r-- | src/Nerve_GIC/include/gudhi/GIC.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index 30f89d65..c3085dff 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -230,18 +230,17 @@ class Cover_complex { /** \brief Reads and stores the input point cloud from vector stored in memory. * - * @param[in] cloud input vector representing the point cloud. Each row is a point and each coordinate is a vector. + * @param[in] point_cloud input vector representing the point cloud. Each row is a point and each coordinate is a vector. * */ - template <class InputRange> - void set_point_cloud_from_range(InputRange const & cloud) { - n = cloud.size(); data_dimension = cloud[0].size(); point_cloud_name = "matrix"; + void set_point_cloud_from_range(const std::vector<std::vector<double> > & point_cloud) { + n = point_cloud.size(); data_dimension = point_cloud[0].size(); + point_cloud_name = "matrix"; cover.resize(n); for(int i = 0; i < n; i++){ - point_cloud.emplace_back(cloud[i].begin(), cloud[i].begin() + data_dimension); boost::add_vertex(one_skeleton_OFF); vertices.push_back(boost::add_vertex(one_skeleton)); - cover.emplace_back(); } + this->point_cloud = point_cloud; } /** \brief Reads and stores the input point cloud from .(n)OFF file. @@ -395,18 +394,12 @@ class Cover_complex { * @param[in] distance_matrix input vector representing the distance matrix. * */ - template <class InputRange> - void set_distances_from_range(InputRange const & distance_matrix) { - if(point_cloud.size() == 0){ - n = distance_matrix.size(); - point_cloud_name = "matrix"; - data_dimension = 0; - for(int i = 0; i < n; i++){ - point_cloud.emplace_back(); - boost::add_vertex(one_skeleton_OFF); - vertices.push_back(boost::add_vertex(one_skeleton)); - cover.emplace_back(); - } + void set_distances_from_range(const std::vector<std::vector<double> > & distance_matrix) { + n = distance_matrix.size(); data_dimension = 0; point_cloud_name = "matrix"; + cover.resize(n); point_cloud.resize(n); + for(int i = 0; i < n; i++){ + boost::add_vertex(one_skeleton_OFF); + vertices.push_back(boost::add_vertex(one_skeleton)); } distances = distance_matrix; } |