summaryrefslogtreecommitdiff
path: root/src/Witness_complex/include/gudhi/Witness_complex.h
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-06-12 08:07:22 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-06-12 08:07:22 +0200
commit4930211002c29b78d0e090aa482f6a5b9226ef51 (patch)
treef13addfc5fb943a68ed7ebee84a5023f41ab0697 /src/Witness_complex/include/gudhi/Witness_complex.h
parent2927abe9a4b00bd291703340daaaed7bf20f3753 (diff)
parentf58f0bb2cb99076d0cd3a11ad39f3277213e3f5e (diff)
Merge branch 'master' into simplex_tree_insert_duplicated_vertices_fix_vincent
Diffstat (limited to 'src/Witness_complex/include/gudhi/Witness_complex.h')
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index 67885258..1f61f8f2 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -75,10 +75,13 @@ class Witness_complex {
/**
* \brief Initializes member variables before constructing simplicial complex.
* \details Records nearest landmark table.
- * @param[in] nearest_landmark_table needs to be a range of a range of pairs of nearest landmarks and distances.
+ * @param[in] nearest_landmark_table needs to be a range (one entry per witness)
+ * of sorted ranges of pairs of nearest landmarks and distances.
* The class Nearest_landmark_table_::value_type must be a copiable range.
* The range of pairs must admit a member type 'iterator'. The dereference type
- * of the pair range iterator needs to be 'std::pair<std::size_t, double>'.
+ * of the pair range iterator needs to be 'std::pair<std::size_t, double>'
+ * where the first element is the index of the landmark, and the second its
+ * (squared) distance to the witness.
*/
Witness_complex(Nearest_landmark_table_ const & nearest_landmark_table)
@@ -108,8 +111,8 @@ class Witness_complex {
}
ActiveWitnessList active_witnesses;
Landmark_id k = 0; /* current dimension in iterative construction */
- for (auto w : nearest_landmark_table_)
- active_witnesses.push_back(ActiveWitness(w));
+ for (auto&& w : nearest_landmark_table_)
+ active_witnesses.emplace_back(w);
while (!active_witnesses.empty() && k <= limit_dimension) {
typename ActiveWitnessList::iterator aw_it = active_witnesses.begin();
std::vector<Landmark_id> simplex;