Skip to content

Commit

Permalink
replacing set with vector for boundary translation
Browse files Browse the repository at this point in the history
  • Loading branch information
hschreiber committed Oct 22, 2024
1 parent 915b5ea commit b3158e3
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <cmath>
#include <limits>
#include <set>
#include <unordered_map>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -196,10 +195,12 @@ class Filtered_zigzag_persistence_with_storage
GUDHI_CHECK(res.second, "Zigzag_persistence::insert_cell - cell already in the complex");

// Compute the keys of the cells of the boundary.
std::set<Internal_key> translatedBoundary; // set maintains the natural order on indices
std::vector<Internal_key> translatedBoundary;
translatedBoundary.reserve(dimension * 2); // boundary does not have to have `size()`
for (auto b : boundary) {
translatedBoundary.insert(handleToKey_.at(b)); // TODO: add possibilities of coefficients
translatedBoundary.push_back(handleToKey_.at(b)); // TODO: add possibilities of coefficients
}
std::sort(translatedBoundary.begin(), translatedBoundary.end());

pers_.insert_cell(translatedBoundary, dimension);

Expand Down Expand Up @@ -508,10 +509,12 @@ class Filtered_zigzag_persistence {
keyToFiltrationValue_.try_emplace(numArrow_, filtrationValue);

// Compute the keys of the cells of the boundary.
std::set<Internal_key> translatedBoundary; // set maintains the natural order on indices
std::vector<Internal_key> translatedBoundary;
translatedBoundary.reserve(dimension * 2); // boundary does not have to have `size()`
for (auto b : boundary) {
translatedBoundary.insert(handleToKey_.at(b)); // TODO: add possibilities of coefficients
translatedBoundary.push_back(handleToKey_.at(b)); // TODO: add possibilities of coefficients
}
std::sort(translatedBoundary.begin(), translatedBoundary.end());

pers_.insert_cell(translatedBoundary, dimension);

Expand Down

0 comments on commit b3158e3

Please sign in to comment.