Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix > Class Template Reference

Class managing the vine swaps for Chain_matrix. More...

Public Types

using index = typename Master_matrix::index
 
using id_index = typename Master_matrix::id_index
 
using pos_index = typename Master_matrix::pos_index
 
using matrix_type = typename Master_matrix::column_container_type
 
using Column_type = typename Master_matrix::Column_type
 
typedef bool(* EventCompFuncPointer) (pos_index, pos_index)
 

Public Member Functions

 Chain_vine_swap ()
 Default constructor. Only available if PersistenceMatrixOptions::has_column_pairings is true.
 
 Chain_vine_swap (std::function< bool(pos_index, pos_index)> birthComparator, std::function< bool(pos_index, pos_index)> deathComparator=_no_G_death_comparator)
 Constructor storing the given comparators. More...
 
 Chain_vine_swap (const Chain_vine_swap &matrixToCopy)
 Copy constructor. More...
 
 Chain_vine_swap (Chain_vine_swap &&other) noexcept
 Move constructor. More...
 
index vine_swap_with_z_eq_1_case (index columnIndex1, index columnIndex2)
 Does the same than vine_swap, but assumes that the swap is non trivial and therefore skips a part of the case study. More...
 
index vine_swap (index columnIndex1, index columnIndex2)
 Does a vine swap between two faces which are consecutives in the filtration. Roughly, if \( F \) is the current filtration represented by the matrix, the method modifies the matrix such that the new state corresponds to a valid state for the filtration \( F' \) equal to \( F \) but with the two given faces at swapped positions. Of course, the two faces should not have a face/coface relation which each other ; \( F' \) has to be a valid filtration. See [21] for more information about vine and vineyards. More...
 
Chain_vine_swapoperator= (Chain_vine_swap other)
 Assign operator.
 

Friends

void swap (Chain_vine_swap &swap1, Chain_vine_swap &swap2)
 Swap operator.
 

Detailed Description

template<class Master_matrix>
class Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >

Class managing the vine swaps for Chain_matrix.

Template Parameters
Master_matrixAn instanciation of Matrix from which all types and options are deduced.

Member Typedef Documentation

◆ Column_type

template<class Master_matrix >
using Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::Column_type = typename Master_matrix::Column_type

Column type.

◆ EventCompFuncPointer

template<class Master_matrix >
typedef bool(* Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::EventCompFuncPointer) (pos_index, pos_index)

Pointer type for birth/death comparators.

◆ id_index

template<class Master_matrix >
using Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::id_index = typename Master_matrix::id_index

IDIdx index type.

◆ index

template<class Master_matrix >
using Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::index = typename Master_matrix::index

MatIdx index type.

◆ matrix_type

template<class Master_matrix >
using Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::matrix_type = typename Master_matrix::column_container_type

Column container type.

◆ pos_index

template<class Master_matrix >
using Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::pos_index = typename Master_matrix::pos_index

PosIdx index type.

Constructor & Destructor Documentation

◆ Chain_vine_swap() [1/3]

template<class Master_matrix >
Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::Chain_vine_swap ( std::function< bool(pos_index, pos_index)>  birthComparator,
std::function< bool(pos_index, pos_index)>  deathComparator = _no_G_death_comparator 
)
inline

Constructor storing the given comparators.

Parameters
birthComparatorMethod taking two PosIdx indices as input and returning true if and only if the birth associated to the first position is strictly less than birth associated to the second one with respect to some self defined order. It is used while swapping two unpaired or two negative columns.
deathComparatorMethod taking two PosIdx indices as input and returning true if and only if the death associated to the first position is strictly less than death associated to the second one with respect to some self defined order. It is used while swapping two positive but paired columns. Default value: _no_G_death_comparator.

◆ Chain_vine_swap() [2/3]

template<class Master_matrix >
Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::Chain_vine_swap ( const Chain_vine_swap< Master_matrix > &  matrixToCopy)
inline

Copy constructor.

Parameters
matrixToCopyMatrix to copy.

◆ Chain_vine_swap() [3/3]

template<class Master_matrix >
Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::Chain_vine_swap ( Chain_vine_swap< Master_matrix > &&  other)
inlinenoexcept

Move constructor.

Parameters
otherMatrix to move.

Member Function Documentation

◆ vine_swap()

template<class Master_matrix >
Chain_vine_swap< Master_matrix >::index Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::vine_swap ( index  columnIndex1,
index  columnIndex2 
)
inline

Does a vine swap between two faces which are consecutives in the filtration. Roughly, if \( F \) is the current filtration represented by the matrix, the method modifies the matrix such that the new state corresponds to a valid state for the filtration \( F' \) equal to \( F \) but with the two given faces at swapped positions. Of course, the two faces should not have a face/coface relation which each other ; \( F' \) has to be a valid filtration. See [21] for more information about vine and vineyards.

Parameters
columnIndex1MatIdx index of the first face.
columnIndex2MatIdx index of the second face. It is assumed that the PosIdx of both only differs by one if the barcode is maintained.
Returns
Let \( pos1 \) be the PosIdx index of columnIndex1 and \( pos2 \) be the PosIdx index of columnIndex2. The method returns the MatIdx of the column which has now, after the swap, the PosIdx \( max(pos1, pos2) \).

◆ vine_swap_with_z_eq_1_case()

template<class Master_matrix >
Chain_vine_swap< Master_matrix >::index Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::vine_swap_with_z_eq_1_case ( index  columnIndex1,
index  columnIndex2 
)
inline

Does the same than vine_swap, but assumes that the swap is non trivial and therefore skips a part of the case study.

Parameters
columnIndex1MatIdx index of the first face.
columnIndex2MatIdx index of the second face.
Returns
Let \( pos1 \) be the PosIdx index of columnIndex1 and \( pos2 \) be the PosIdx index of columnIndex2. The method returns the MatIdx of the column which has now, after the swap, the PosIdx \( max(pos1, pos2) \).

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