Loading...
Searching...
No Matches
Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix > Class Template Reference
Persistence Matrix

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

`#include <gudhi/Persistence_matrix/chain_vine_swap.h>`

## 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 | Column_container = typename Master_matrix::Column_container
using | Column = typename Master_matrix::Column
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.
| Chain_vine_swap (const Chain_vine_swap &matrixToCopy)
| Copy constructor.
| Chain_vine_swap (Chain_vine_swap &&other) noexcept
| Move constructor.
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.
Index | vine_swap (Index columnIndex1, Index columnIndex2)

Does a vine swap between two cells which are consecutive 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 cells at swapped positions. Of course, the two cells should not have a face/coface relation which each other ; \( F' \) has to be a valid filtration. See [vineyards] for more information about vine and vineyards.

Chain_vine_swap & | operator= (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_matrix | An instantiation of Matrix from which all types and options are deduced.

## Member Typedef Documentation

## Column

template<class Master_matrix>

using Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::Column = typename Master_matrix::Column

Column type.

## Column_container

template<class Master_matrix>

using Gudhi::persistence_matrix::Chain_vine_swap< Master_matrix >::Column_container = typename Master_matrix::Column_container

Column container 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.

## 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

  birthComparator | Method 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.
  deathComparator | Method 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

  matrixToCopy | Matrix 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 | ) |

inline noexcept

Move constructor.

Parameters

  other | Matrix 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 cells which are consecutive 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 cells at swapped positions. Of course, the two cells should not have a face/coface relation which each other ; \( F' \) has to be a valid filtration. See [vineyards] for more information about vine and vineyards.

Parameters

  columnIndex1 | MatIdx index of the first cell.
  columnIndex2 | MatIdx index of the second cell. 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

  columnIndex1 | MatIdx index of the first cell.
  columnIndex2 | MatIdx index of the second cell.

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:

- include/gudhi/Persistence_matrix/chain_vine_swap.h