diff options
author | MathieuCarriere <mathieu.carriere3@gmail.com> | 2020-03-16 13:44:18 -0400 |
---|---|---|
committer | MathieuCarriere <mathieu.carriere3@gmail.com> | 2020-03-16 13:44:18 -0400 |
commit | 9e61f8e56e90074ea8af80494c09573d4a156154 (patch) | |
tree | 02cb1186eafed5bcefd7e72feae16a92a3ad3510 /src/Simplex_tree/include/gudhi | |
parent | c9ccc6a35b2ad231e07cc38811a074f3ed34ddd3 (diff) | |
parent | 592d58a95dbe5851c9f4ded9e8740c1e7a9c1502 (diff) |
Merge branch 'master' of https://github.com/GUDHI/gudhi-devel into extended_persistence
Diffstat (limited to 'src/Simplex_tree/include/gudhi')
-rw-r--r-- | src/Simplex_tree/include/gudhi/Simplex_tree.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index 42cf4246..7be14bce 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -1319,6 +1319,8 @@ class Simplex_tree { * \post Some simplex tree functions require the filtration to be valid. `make_filtration_non_decreasing()` * function is not launching `initialize_filtration()` but returns the filtration modification information. If the * complex has changed , please call `initialize_filtration()` to recompute it. + * + * If a simplex has a `NaN` filtration value, it is considered lower than any other defined filtration value. */ bool make_filtration_non_decreasing() { bool modified = false; @@ -1349,7 +1351,9 @@ class Simplex_tree { }); Filtration_value max_filt_border_value = filtration(*max_border); - if (simplex.second.filtration() < max_filt_border_value) { + // Replacing if(f<max) with if(!(f>=max)) would mean that if f is NaN, we replace it with the max of the children. + // That seems more useful than keeping NaN. + if (!(simplex.second.filtration() >= max_filt_border_value)) { // Store the filtration modification information modified = true; simplex.second.assign_filtration(max_filt_border_value); |