CGAL 6.1 - Homological Discrete Vector Fields
Loading...
Searching...
No Matches
CGAL::HDVF::Hdvf_persistence< CoefficientType, ComplexType, DegType, FiltrationType >::iterator Struct Reference

#include <CGAL/HDVF/Hdvf_persistence.h>

Definition

template<typename CoefficientType, typename ComplexType, typename DegType, typename FiltrationType>
struct CGAL::HDVF::Hdvf_persistence< CoefficientType, ComplexType, DegType, FiltrationType >::iterator

Iterator over (finite) persistent intervals.

Iterate over persistent intervals of finite degree duration. If discard_small is true (which is the default), the iterator discards persistent intervals with a null degree duration (that is, small persistent holes).

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using value_type = PerIntervalInformation
 

Public Member Functions

 iterator (const Hdvf_persistence &per_hdvf, size_t i=0, bool discard_small=true)
 Iterator constructor.
 
bool has_discard_small ()
 Returns the discard_small flag.
 
value_type operator* () const
 Iterator dereference.
 
iteratoroperator++ ()
 Prefix incrementation.
 
iterator operator++ (int)
 Postfix incrementation.
 

Friends

bool operator== (const iterator &a, const iterator &b)
 Equality check.
 
bool operator!= (const iterator &a, const iterator &b)
 Inequality check.
 

Constructor & Destructor Documentation

◆ iterator()

template<typename CoefficientType , typename ComplexType , typename DegType , typename FiltrationType >
CGAL::HDVF::Hdvf_persistence< CoefficientType, ComplexType, DegType, FiltrationType >::iterator::iterator ( const Hdvf_persistence per_hdvf,
size_t  i = 0,
bool  discard_small = true 
)

Iterator constructor.

Parameters
[in]per_hdvfConstant reference over the Hdvf_persistence iterated.
[in]iThe initial index.
[in]discard_smallIf true (default), only persistent intervals of (strictly) positive degree duration are iterated. Otherwise, all persistent intervals are iterated.

Member Function Documentation

◆ operator*()

template<typename CoefficientType , typename ComplexType , typename DegType , typename FiltrationType >
value_type CGAL::HDVF::Hdvf_persistence< CoefficientType, ComplexType, DegType, FiltrationType >::iterator::operator* ( ) const

Iterator dereference.

Returns
A PerIntervalInformation structure containing the information of the current persistence interval.

◆ operator++() [1/2]

template<typename CoefficientType , typename ComplexType , typename DegType , typename FiltrationType >
iterator & CGAL::HDVF::Hdvf_persistence< CoefficientType, ComplexType, DegType, FiltrationType >::iterator::operator++ ( )

Prefix incrementation.

Finds next persistent interval.

If discard_small is true, the iterator searches next persistent interval with a (strictly) positive degree duration, otherwise, the iterator returns next persistent interval.

Returns
The reference to the current iterator.

◆ operator++() [2/2]

template<typename CoefficientType , typename ComplexType , typename DegType , typename FiltrationType >
iterator CGAL::HDVF::Hdvf_persistence< CoefficientType, ComplexType, DegType, FiltrationType >::iterator::operator++ ( int  )

Postfix incrementation.

Finds the next not-null index.

Returns
The pre-incremented iterator.

Friends And Related Function Documentation

◆ operator!=

template<typename CoefficientType , typename ComplexType , typename DegType , typename FiltrationType >
bool operator!= ( const iterator a,
const iterator b 
)
friend

Inequality check.

Returns
True if the indices are different.

◆ operator==

template<typename CoefficientType , typename ComplexType , typename DegType , typename FiltrationType >
bool operator== ( const iterator a,
const iterator b 
)
friend

Equality check.

Returns
True if the indices are equal.