11#ifndef SIMPLEX_TREE_FILTRATION_VALUE_UTILS_H_
12#define SIMPLEX_TREE_FILTRATION_VALUE_UTILS_H_
18#include <gudhi/Simplex_tree/serialization_utils.h>
22namespace simplex_tree {
29 template <
class T>
explicit operator T()
const {
return T(0); }
30} empty_filtration_value;
42template <
typename Arithmetic_filtration_value>
45 if constexpr (std::numeric_limits<Arithmetic_filtration_value>::has_infinity) {
46 return f == std::numeric_limits<Arithmetic_filtration_value>::infinity();
48 return f == std::numeric_limits<Arithmetic_filtration_value>::max();
61template <
typename Arithmetic_filtration_value>
62bool unify_lifetimes(Arithmetic_filtration_value& f1,
const Arithmetic_filtration_value& f2)
78template <
typename Arithmetic_filtration_value>
81 if constexpr (std::numeric_limits<Arithmetic_filtration_value>::has_quiet_NaN) {
84 return !std::isnan(f2);
88 if (!(f1 < f2))
return false;
116template <
typename Trivial_filtration_value>
117char* serialize_value_to_char_buffer(Trivial_filtration_value value,
char* start) {
118 return Gudhi::simplex_tree::serialize_trivial(value, start);
135template <
typename Trivial_filtration_value>
136const char* deserialize_value_from_char_buffer(Trivial_filtration_value& value,
const char* start) {
137 return Gudhi::simplex_tree::deserialize_trivial(value, start);
148template<
typename Trivial_filtration_value>
149constexpr std::size_t get_serialization_size_of([[maybe_unused]] Trivial_filtration_value value) {
150 return sizeof(Trivial_filtration_value);
bool is_positive_infinity(const Arithmetic_filtration_value &f)
Returns true if and only if the given filtration value is at infinity. This is the overload for when ...
Definition filtration_value_utils.h:43
bool unify_lifetimes(Arithmetic_filtration_value &f1, const Arithmetic_filtration_value &f2)
Given two filtration values at which a simplex exists, stores in the first value the minimal union of...
Definition filtration_value_utils.h:62
bool intersect_lifetimes(Arithmetic_filtration_value &f1, const Arithmetic_filtration_value &f2)
Given two filtration values, stores in the first value the lowest common upper bound of the two value...
Definition filtration_value_utils.h:79
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14
Returns Filtration_value(0) when converted to Filtration_value.
Definition filtration_value_utils.h:28