23 #ifndef WRITING_PERSISTENCE_TO_FILE_H_ 24 #define WRITING_PERSISTENCE_TO_FILE_H_ 37 template <
typename Filtration_type,
typename Coefficient_field>
46 dimension_(std::numeric_limits<unsigned>::max()),
47 arith_element_(std::numeric_limits<Coefficient_field>::max()) {}
53 : birth_(birth), death_(death), dimension_(dim), arith_element_(std::numeric_limits<Coefficient_field>::max()) {}
60 : birth_(birth), death_(death), dimension_(dim), arith_element_(field) {}
68 return ((this->birth_ == i2.birth_) && (this->death_ == i2.death_) && (this->dimension_ == i2.dimension_) &&
69 (this->arith_element_ == i2.arith_element_));
83 return fabs(this->death_ - this->birth_) < fabs(i2.death_ - i2.birth_);
87 if (it.arith_element_ != std::numeric_limits<Coefficient_field>::max()) {
88 out << it.arith_element_ <<
" ";
90 if (it.dimension_ != std::numeric_limits<unsigned>::max()) {
91 out << it.dimension_ <<
" ";
93 out << it.birth_ <<
" " << it.death_ <<
" ";
98 Filtration_type birth_;
99 Filtration_type death_;
101 Coefficient_field arith_element_;
107 template <
typename Persistence_
interval_range>
109 std::ostream& out = std::cout) {
110 for (
auto interval : intervals) {
111 out << interval <<
"\n";
117 #endif // WRITING_PERSISTENCE_TO_FILE_H_ Persistence_interval_common(Filtration_type birth, Filtration_type death)
Definition: writing_persistence_to_file.h:43
Definition: SimplicialComplexForAlpha.h:26
bool operator<(const Persistence_interval_common &i2) const
Definition: writing_persistence_to_file.h:82
Persistence_interval_common(Filtration_type birth, Filtration_type death, unsigned dim, Coefficient_field field)
Definition: writing_persistence_to_file.h:59
Definition: writing_persistence_to_file.h:38
void write_persistence_intervals_to_stream(const Persistence_interval_range &intervals, std::ostream &out=std::cout)
Definition: writing_persistence_to_file.h:108
bool operator==(const Persistence_interval_common &i2) const
Definition: writing_persistence_to_file.h:67
Persistence_interval_common(Filtration_type birth, Filtration_type death, unsigned dim)
Definition: writing_persistence_to_file.h:52
bool operator!=(const Persistence_interval_common &i2) const
Definition: writing_persistence_to_file.h:75