Skip to content

Commit

Permalink
restore Persistent_cohomology.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hschreiber committed Oct 15, 2024
1 parent b7f4649 commit e425049
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ class Persistent_cohomology {
void output_diagram(std::ostream& ostream = std::cout) {
cmp_intervals_by_length cmp(cpx_);
std::sort(std::begin(persistent_pairs_), std::end(persistent_pairs_), cmp);
for (const auto& pair : persistent_pairs_) {
for (auto pair : persistent_pairs_) {
ostream << get<2>(pair) << " " << cpx_->dimension(get<0>(pair)) << " "
<< cpx_->filtration(get<0>(pair)) << " "
<< cpx_->filtration(get<1>(pair)) << " " << std::endl;
Expand All @@ -574,7 +574,7 @@ class Persistent_cohomology {
diagram_out.exceptions(diagram_out.failbit);
cmp_intervals_by_length cmp(cpx_);
std::sort(std::begin(persistent_pairs_), std::end(persistent_pairs_), cmp);
for (const auto& pair : persistent_pairs_) {
for (auto pair : persistent_pairs_) {
diagram_out << cpx_->dimension(get<0>(pair)) << " "
<< cpx_->filtration(get<0>(pair)) << " "
<< cpx_->filtration(get<1>(pair)) << std::endl;
Expand All @@ -589,7 +589,7 @@ class Persistent_cohomology {
// size for an empty complex
std::vector<int> betti_numbers(std::max(dim_max_, 0));

for (const auto& pair : persistent_pairs_) {
for (auto pair : persistent_pairs_) {
// Count never ended persistence intervals
if (cpx_->null_simplex() == get<1>(pair)) {
// Increment corresponding betti number
Expand All @@ -607,7 +607,7 @@ class Persistent_cohomology {
int betti_number(int dimension) const {
int betti_number = 0;

for (const auto& pair : persistent_pairs_) {
for (auto pair : persistent_pairs_) {
// Count never ended persistence intervals
if (cpx_->null_simplex() == get<1>(pair)) {
if (cpx_->dimension(get<0>(pair)) == dimension) {
Expand All @@ -628,7 +628,7 @@ class Persistent_cohomology {
// Init Betti numbers vector with zeros until Simplicial complex dimension and don't allocate a vector of negative
// size for an empty complex
std::vector<int> betti_numbers(std::max(dim_max_, 0));
for (const auto& pair : persistent_pairs_) {
for (auto pair : persistent_pairs_) {
// Count persistence intervals that covers the given interval
// null_simplex test : if the function is called with to=+infinity, we still get something useful. And it will
// still work if we change the complex filtration function to reject null simplices.
Expand All @@ -650,7 +650,7 @@ class Persistent_cohomology {
int persistent_betti_number(int dimension, Filtration_value from, Filtration_value to) const {
int betti_number = 0;

for (const auto& pair : persistent_pairs_) {
for (auto pair : persistent_pairs_) {
// Count persistence intervals that covers the given interval
// null_simplex test : if the function is called with to=+infinity, we still get something useful. And it will
// still work if we change the complex filtration function to reject null simplices.
Expand Down

0 comments on commit e425049

Please sign in to comment.