summaryrefslogtreecommitdiff
path: root/src/Simplex_tree
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-02-02 15:24:51 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-02-02 15:24:51 +0000
commit74dcaacda1c887b008ea8c95b28962de1c02a2d0 (patch)
tree0eb1ab5c08fca08f0dccf65a0ad58bd6349adbcb /src/Simplex_tree
parentcbf1f4c98c9e6d7ba3b7c552e43c7c98ed349954 (diff)
alpha off reader test strategy modification
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@995 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: aa4ba97eecefb03e01a53ae1e2b50248a0857043
Diffstat (limited to 'src/Simplex_tree')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index dbef8517..3911f497 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -307,7 +307,8 @@ class Simplex_tree {
* of the simplex.
*
* @param[in] sh Simplex for which the boundary is computed. */
- Boundary_simplex_range boundary_simplex_range(Simplex_handle sh) {
+ template<class DictionaryIterator>
+ Boundary_simplex_range boundary_simplex_range(DictionaryIterator sh) {
return Boundary_simplex_range(Boundary_simplex_iterator(this, sh),
Boundary_simplex_iterator(this));
}
@@ -528,7 +529,11 @@ class Simplex_tree {
/** \brief Returns true if the node in the simplex tree pointed by
* sh has children.*/
- bool has_children(Simplex_handle sh) const {
+ /*bool has_children(Simplex_handle sh) const {
+ return (sh->second.children()->parent() == sh->first);
+ }*/
+ template<class DictionaryIterator>
+ bool has_children(DictionaryIterator sh) const {
return (sh->second.children()->parent() == sh->first);
}
@@ -1128,7 +1133,7 @@ class Simplex_tree {
bool make_filtration_non_decreasing() {
bool modified = false;
// Loop must be from the end to the beginning, as higher dimension simplex are always on the left part of the tree
- for (auto sh = (root_.members().end() - 1); sh >= root_.members().begin(); --sh) {
+ for (auto sh = root_.members().rbegin(); sh != root_.members().rend(); ++sh) {
if (has_children(sh)) {
modified |= rec_make_filtration_non_decreasing(sh->second.children());
}
@@ -1144,10 +1149,11 @@ class Simplex_tree {
bool rec_make_filtration_non_decreasing(Siblings * sib) {
bool modified = false;
+ // Loop must be from the end to the beginning, as higher dimension simplex are always on the left part of the tree
for (auto sh = sib->members().begin(); sh != sib->members().end(); ++sh) {
// Find the maximum filtration value in the border
Boundary_simplex_range boundary = boundary_simplex_range(sh);
- Boundary_simplex_iterator max_border = std::max_element( std::begin(boundary), std::end(boundary),
+ Boundary_simplex_iterator max_border = std::max_element(std::begin(boundary), std::end(boundary),
[](Simplex_handle sh1, Simplex_handle sh2) {
return filtration(sh1) < filtration(sh2);
} );
@@ -1175,7 +1181,6 @@ class Simplex_tree {
* call `initialize_filtration()` to recompute it.
*/
void prune_above_filtration(Filtration_value filtration) {
-std::cout << "prune_above_filtration - filtration=" << filtration << std::endl;
// No action if filtration is not stored
if (Options::store_filtration) {
if (filtration < threshold_) {