All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value > Class Template Reference

Type for an interval in a persistent diagram or barcode. Stores the birth, death and dimension of the interval. It can be used as a tuple with get/std::get (birth, death and dimension in this order), std::tuple_element and std::tuple_size, as well as structured binding. More...

#include <gudhi/persistence_interval.h>

Public Member Functions

 Persistence_interval (Event_value birth=inf, Event_value death=inf, Dimension dim=-1)
 Constructor. More...
 
template<std::size_t I>
constexpr auto & get () &noexcept
 Specialization of get for Gudhi::persistence_matrix::Persistence_interval. More...
 
template<std::size_t I>
constexpr const auto & get () const &noexcept
 Specialization of get for Gudhi::persistence_matrix::Persistence_interval. More...
 
template<std::size_t I>
constexpr auto && get () &&noexcept
 Specialization of get for Gudhi::persistence_matrix::Persistence_interval. More...
 
template<std::size_t I>
constexpr const auto && get () const &&noexcept
 Specialization of get for Gudhi::persistence_matrix::Persistence_interval. More...
 

Public Attributes

Dimension dim
 
Event_value birth
 
Event_value death
 

Static Public Attributes

static constexpr Event_value inf
 Stores the infinity value for birth and death events. Its value depends on the template parameter Event_value: More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const Persistence_interval &interval)
 operator<< More...
 

Detailed Description

template<typename Dimension, typename Event_value>
class Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >

Type for an interval in a persistent diagram or barcode. Stores the birth, death and dimension of the interval. It can be used as a tuple with get/std::get (birth, death and dimension in this order), std::tuple_element and std::tuple_size, as well as structured binding.

Template Parameters
DimensionType of the dimension value.
Event_valueType of the birth and death value.
Examples
example_zigzag_filtration_as_input_loop.cpp.

Constructor & Destructor Documentation

◆ Persistence_interval()

template<typename Dimension , typename Event_value >
Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::Persistence_interval ( Event_value  birth = inf,
Event_value  death = inf,
Dimension  dim = -1 
)
inline

Constructor.

Parameters
birthBirth value of the cycle. Default value: inf.
deathDeath value of the cycle. Default value: inf.
dimDimension of the cycle. Default value: -1.

Member Function Documentation

◆ get() [1/4]

template<typename Dimension , typename Event_value >
template<std::size_t I>
constexpr auto && Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::get ( ) &&
inlineconstexprnoexcept

Specialization of get for Gudhi::persistence_matrix::Persistence_interval.

Template Parameters
IIndex of the value to return: 0 for the birth value, 1 for the death value and 2 for the dimension.
Returns
Either the birth value if I == 0, the death value if I == 1 or the dimension if I == 2.

◆ get() [2/4]

template<typename Dimension , typename Event_value >
template<std::size_t I>
constexpr auto & Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::get ( ) &
inlineconstexprnoexcept

Specialization of get for Gudhi::persistence_matrix::Persistence_interval.

Template Parameters
IIndex of the value to return: 0 for the birth value, 1 for the death value and 2 for the dimension.
Returns
Either the birth value if I == 0, the death value if I == 1 or the dimension if I == 2.

◆ get() [3/4]

template<typename Dimension , typename Event_value >
template<std::size_t I>
constexpr const auto && Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::get ( ) const &&
inlineconstexprnoexcept

Specialization of get for Gudhi::persistence_matrix::Persistence_interval.

Template Parameters
IIndex of the value to return: 0 for the birth value, 1 for the death value and 2 for the dimension.
Returns
Either the birth value if I == 0, the death value if I == 1 or the dimension if I == 2.

◆ get() [4/4]

template<typename Dimension , typename Event_value >
template<std::size_t I>
constexpr const auto & Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::get ( ) const &
inlineconstexprnoexcept

Specialization of get for Gudhi::persistence_matrix::Persistence_interval.

Template Parameters
IIndex of the value to return: 0 for the birth value, 1 for the death value and 2 for the dimension.
Returns
Either the birth value if I == 0, the death value if I == 1 or the dimension if I == 2.

Friends And Related Function Documentation

◆ operator<<

template<typename Dimension , typename Event_value >
std::ostream & operator<< ( std::ostream &  stream,
const Persistence_interval< Dimension, Event_value > &  interval 
)
friend

operator<<

Parameters
streamoutstream
intervalinterval to stream

Member Data Documentation

◆ birth

template<typename Dimension , typename Event_value >
Event_value Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::birth

Birth value of the cycle.

◆ death

template<typename Dimension , typename Event_value >
Event_value Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::death

Death value of the cycle.

◆ dim

template<typename Dimension , typename Event_value >
Dimension Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::dim

Dimension of the cycle.

◆ inf

template<typename Dimension , typename Event_value >
constexpr Event_value Gudhi::persistence_matrix::Persistence_interval< Dimension, Event_value >::inf
staticconstexpr
Initial value:
= std::numeric_limits<Event_value>::has_infinity
? std::numeric_limits<Event_value>::infinity()
: static_cast<Event_value>(-1)

Stores the infinity value for birth and death events. Its value depends on the template parameter Event_value:

  • if Event_value has a native infinity value, it takes this value,
  • otherwise, if Event_value is a signed type, it takes value -1,
  • otherwise, if Event_value is a unsigned type, it takes the maximal possible value.

Is also used as default value for birth and death attributes when not initialized.


The documentation for this class was generated from the following file: