summaryrefslogtreecommitdiff
path: root/src/Nerve_GIC/include/gudhi/GIC.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2019-02-04 08:55:50 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2019-02-04 08:55:50 +0000
commitea4373870233488ece0a38b9eb97b23e50945d71 (patch)
tree7e631f7771bcc8da50c44953bc1fe8acb65eb499 /src/Nerve_GIC/include/gudhi/GIC.h
parent644076d6f2de7d91a7694c94261c59da14264cd5 (diff)
parent2905296b253588bd43de924d44585f9bfbd45540 (diff)
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cubical_complex_small_fix@4088 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 422db01787f7c105092e7f12b023a7a8e1f7d316
Diffstat (limited to 'src/Nerve_GIC/include/gudhi/GIC.h')
-rw-r--r--src/Nerve_GIC/include/gudhi/GIC.h29
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;
}