diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2020-12-31 17:37:22 +0100 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2020-12-31 17:37:22 +0100 |
commit | 87c56be63f1042d0fbe8b7d5dcac330a3b9fe3d7 (patch) | |
tree | 3bca5e15913f76a6b576d01fa9f6c0454e7093bf /ripser.cpp | |
parent | 9eeaee84d2d6a284bd895f3026c0e1ac2fa4a38a (diff) |
minor cleanup
Diffstat (limited to 'ripser.cpp')
-rw-r--r-- | ripser.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -530,12 +530,11 @@ public: std::chrono::steady_clock::time_point next = std::chrono::steady_clock::now() + time_step; #endif - --dim; columns_to_reduce.clear(); std::vector<diameter_index_t> next_simplices; for (diameter_index_t& simplex : simplices) { - simplex_coboundary_enumerator cofacets(diameter_entry_t(simplex, 1), dim, *this); + simplex_coboundary_enumerator cofacets(diameter_entry_t(simplex, 1), dim - 1, *this); while (cofacets.has_next(false)) { #ifdef INDICATE_PROGRESS @@ -551,9 +550,9 @@ public: next_simplices.push_back({get_diameter(cofacet), get_index(cofacet)}); - if ((pivot_column_index.find(get_entry(cofacet)) == pivot_column_index.end()) && - (get_index(get_apparent_cofacet(cofacet, dim + 1)) == -1) && - (get_index(get_apparent_facet(cofacet, dim + 1)) == -1)) + if ((get_index(get_apparent_cofacet(cofacet, dim)) == -1) && + (pivot_column_index.find(get_entry(cofacet)) == pivot_column_index.end()) && + (get_index(get_apparent_facet(cofacet, dim)) == -1)) columns_to_reduce.push_back({get_diameter(cofacet), get_index(cofacet)}); } } @@ -595,11 +594,8 @@ public: std::cout << " [0," << get_diameter(e) << ")" << std::endl; #endif dset.link(u, v); - } else { - if ((get_index(get_apparent_cofacet(e, 1)) == -1) && - (get_index(get_apparent_facet(e, 1)) == -1)) - columns_to_reduce.push_back(e); - } + } else if (get_index(get_apparent_cofacet(e, 1)) == -1) + columns_to_reduce.push_back(e); } std::reverse(columns_to_reduce.begin(), columns_to_reduce.end()); |