summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h10
-rw-r--r--src/Simplex_tree/test/simplex_tree_unit_test.cpp1
2 files changed, 6 insertions, 5 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index 95a6d090..61e07f84 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -316,21 +316,21 @@ class Simplex_tree {
/** \brief Returns the key associated to a simplex.
*
* The filtration must be initialized. */
- Simplex_key key(Simplex_handle sh) {
+ static Simplex_key key(Simplex_handle sh) {
return sh->second.key();
}
/** \brief Returns the simplex associated to a key.
*
* The filtration must be initialized. */
- Simplex_handle simplex(Simplex_key key) {
+ Simplex_handle simplex(Simplex_key key) const {
return filtration_vect_[key];
}
/** \brief Returns the filtration value of a simplex.
*
* Called on the null_simplex, returns INFINITY. */
- Filtration_value filtration(Simplex_handle sh) const {
+ static Filtration_value filtration(Simplex_handle sh) {
if (sh != null_simplex()) {
return sh->second.filtration();
} else {
@@ -347,13 +347,13 @@ class Simplex_tree {
* associated to the simplices in the simplicial complex.
*
* One can call filtration(null_simplex()). */
- Simplex_handle null_simplex() const {
+ static Simplex_handle null_simplex() {
return Dictionary_it(NULL);
}
/** \brief Returns a key different for all keys associated to the
* simplices of the simplicial complex. */
- Simplex_key null_key() const {
+ static Simplex_key null_key() {
return -1;
}
diff --git a/src/Simplex_tree/test/simplex_tree_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_unit_test.cpp
index 6f6e9bb1..566d6d90 100644
--- a/src/Simplex_tree/test/simplex_tree_unit_test.cpp
+++ b/src/Simplex_tree/test/simplex_tree_unit_test.cpp
@@ -109,6 +109,7 @@ BOOST_AUTO_TEST_CASE(simplex_tree_from_file) {
// Size of simplex
int size = 0;
for (auto vertex : st.simplex_vertex_range(f_simplex)) {
+ (void) vertex;
size++;
}
BOOST_CHECK(AreAlmostTheSame(st.filtration(f_simplex), (0.1 * size))); // Specific test: filtration = 0.1 * simplex_size