summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-10-20 08:24:03 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-10-20 08:24:03 +0000
commit6fff7c1774365f99c93d57bdf3595e6b89f16b0a (patch)
treefeea01abd8e59959714e3ece6ba8aaebb0c098c0 /src
parente36dafedbab909ef1d16eceb133cd8b80dd1763d (diff)
Code review : rename automatic_dimension_set with downgrade_dimension
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_automatic_dimension_set@2796 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3b094bc579367d40790c3791f2c4a3700a3d93ae
Diffstat (limited to 'src')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h8
-rw-r--r--src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp20
2 files changed, 14 insertions, 14 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index 7841c793..986cc071 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -1163,7 +1163,7 @@ class Simplex_tree {
* complex has changed , please call `initialize_filtration()` to recompute it.
* \post Note that the dimension of the simplicial complex may be lower after calling `prune_above_filtration()`
* than it was before. However, `Simplex_tree::dimension()` will return the old value, which remains a valid upper
- * bound. If you care, you can call `automatic_dimension_set()` to recompute the exact dimension.
+ * bound. If you care, you can call `downgrade_dimension()` to recompute the exact dimension.
*/
bool prune_above_filtration(Filtration_value filtration) {
return rec_prune_above_filtration(root(), filtration);
@@ -1195,12 +1195,12 @@ class Simplex_tree {
}
public:
- /** \brief Deep search simplex tree dimension reset.
+ /** \brief Deep search simplex tree dimension recompute.
* @return True if the dimension was modified, false otherwise.
* \pre Be sure the simplex tree has not a too low dimension value as the deep search stops when the former dimension
* has been reached (cf. `dimension()` and `set_dimension()` methods).
*/
- bool automatic_dimension_set() {
+ bool downgrade_dimension() {
int new_dimension = -1;
// Browse the tree from the left to the right as higher dimension cells are more likely on the left part of the tree
for (Simplex_handle sh : skeleton_simplex_range(dimension_)) {
@@ -1230,7 +1230,7 @@ class Simplex_tree {
* \post Be aware that removing is shifting data in a flat_map (`initialize_filtration()` to be done).
* \post Note that the dimension of the simplicial complex may be lower after calling `remove_maximal_simplex()`
* than it was before. However, `Simplex_tree::dimension()` will return the old value, which remains a valid upper
- * bound. If you care, you can call `automatic_dimension_set()` to recompute the exact dimension.
+ * bound. If you care, you can call `downgrade_dimension()` to recompute the exact dimension.
*/
void remove_maximal_simplex(Simplex_handle sh) {
// Guarantee the simplex has no children
diff --git a/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp
index 87c77801..747e7eeb 100644
--- a/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp
+++ b/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE(remove_maximal_simplex) {
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 3);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "st.dimension()=" << st.dimension() << " | st_wo_seven.dimension()=" << st_wo_seven.dimension() << std::endl;
BOOST_CHECK(st == st_wo_seven);
@@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(auto_dimension_set) {
st.remove_maximal_simplex(st.find({1, 2, 3, 5}));
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 3);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 2);
@@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(auto_dimension_set) {
st.remove_maximal_simplex(st.find({1, 2, 3, 4}));
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 3);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 2);
@@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(auto_dimension_set) {
st.remove_maximal_simplex(st.find({0, 1, 3, 4}));
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 3);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 2);
@@ -208,9 +208,9 @@ BOOST_AUTO_TEST_CASE(auto_dimension_set) {
st.set_dimension(1);
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 1);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "st.dimension()=" << st.dimension() << std::endl;
- // check automatic_dimension_set() is not giving the rigt answer because dimension is too low
+ // check downgrade_dimension() is not giving the rigt answer because dimension is too low
BOOST_CHECK(st.dimension() == 1);
@@ -219,9 +219,9 @@ BOOST_AUTO_TEST_CASE(auto_dimension_set) {
st.set_dimension(6);
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 6);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "st.dimension()=" << st.dimension() << std::endl;
- // check automatic_dimension_set() resets the correct dimension
+ // check downgrade_dimension() resets the correct dimension
BOOST_CHECK(st.dimension() == 3);
@@ -239,7 +239,7 @@ BOOST_AUTO_TEST_CASE(auto_dimension_set) {
st.remove_maximal_simplex(st.find({0, 1, 2, 3, 4, 5, 6}));
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 6);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "st.dimension()=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 5);
@@ -344,7 +344,7 @@ BOOST_AUTO_TEST_CASE(prune_above_filtration) {
std::cout << " - dimension " << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == 3);
- st.automatic_dimension_set();
+ st.downgrade_dimension();
std::cout << "dimension=" << st.dimension() << std::endl;
BOOST_CHECK(st.dimension() == -1);