11 #ifndef WRITING_PERSISTENCE_TO_FILE_H_
12 #define WRITING_PERSISTENCE_TO_FILE_H_
25 template <
typename Filtration_type,
typename Coefficient_field>
34 dimension_(std::numeric_limits<unsigned>::max()),
35 arith_element_(std::numeric_limits<Coefficient_field>::max()) {}
41 : birth_(birth), death_(death), dimension_(dim), arith_element_(std::numeric_limits<Coefficient_field>::max()) {}
48 : birth_(birth), death_(death), dimension_(dim), arith_element_(field) {}
56 return ((this->birth_ == i2.birth_) && (this->death_ == i2.death_) && (this->dimension_ == i2.dimension_) &&
57 (this->arith_element_ == i2.arith_element_));
71 return fabs(this->death_ - this->birth_) < fabs(i2.death_ - i2.birth_);
75 if (it.arith_element_ != std::numeric_limits<Coefficient_field>::max()) {
76 out << it.arith_element_ <<
" ";
78 if (it.dimension_ != std::numeric_limits<unsigned>::max()) {
79 out << it.dimension_ <<
" ";
81 out << it.birth_ <<
" " << it.death_ <<
" ";
86 Filtration_type birth_;
87 Filtration_type death_;
89 Coefficient_field arith_element_;
95 template <
typename Persistence_
interval_range>
96 void write_persistence_intervals_to_stream(
const Persistence_interval_range& intervals,
97 std::ostream& out = std::cout) {
98 for (
auto interval : intervals) {
99 out << interval <<
"\n";
105 #endif // WRITING_PERSISTENCE_TO_FILE_H_