Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix > Class Template Reference

Overlay for chain matrices replacing all input and output MatIdx indices of the original methods with PosIdx indices. The overlay is useless for boundary matrices as MatIdx == PosIdx for them. More...

#include <gudhi/Persistence_matrix/Position_to_index_overlay.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 Dimension = typename Master_matrix::Dimension
 
using Field_operators = typename Master_matrix::Field_operators
 Field operators class. Necessary only if PersistenceMatrixOptions::is_z2 is false.
 
using Field_element = typename Master_matrix::Element
 
using Boundary = typename Master_matrix::Boundary
 
using Column = typename Master_matrix::Column
 
using Row = typename Master_matrix::Row
 
using Bar = typename Master_matrix::Bar
 
using Barcode = typename Master_matrix::Barcode
 
using Cycle = typename Master_matrix::Cycle
 
using Entry_representative = typename Master_matrix::Entry_representative
 
using Entry_constructor = typename Master_matrix::Entry_constructor
 
using Column_settings = typename Master_matrix::Column_settings
 

Public Member Functions

 Position_to_index_overlay (Column_settings *colSettings)
 Constructs an empty matrix. More...
 
template<class Boundary_range = Boundary>
 Position_to_index_overlay (const std::vector< Boundary_range > &orderedBoundaries, Column_settings *colSettings)
 Constructs a new matrix from the given ranges of Matrix::Entry_representative. Each range corresponds to a column (the order of the ranges are preserved). The content of the ranges is assumed to be sorted by increasing IDs. The IDs of the simplices are also assumed to be consecutive, ordered by filtration value, starting with 0. More...
 
 Position_to_index_overlay (unsigned int numberOfColumns, Column_settings *colSettings)
 Constructs a new empty matrix and reserves space for the given number of columns. More...
 
template<typename BirthComparatorFunction , typename DeathComparatorFunction >
 Position_to_index_overlay (Column_settings *colSettings, const BirthComparatorFunction &birthComparator, const DeathComparatorFunction &deathComparator)
 Only available for chain matrices. Constructs an empty matrix and stores the given comparators. More...
 
template<typename BirthComparatorFunction , typename DeathComparatorFunction , class Boundary_range >
 Position_to_index_overlay (const std::vector< Boundary_range > &orderedBoundaries, Column_settings *colSettings, const BirthComparatorFunction &birthComparator, const DeathComparatorFunction &deathComparator)
 Only available for chain matrices. Constructs a new matrix from the given ranges of Matrix::Entry_representative. Each range corresponds to a column (the order of the ranges are preserved). The content of the ranges is assumed to be sorted by increasing IDs. The IDs of the simplices are also assumed to be consecutive, ordered by filtration value, starting with 0. More...
 
template<typename BirthComparatorFunction , typename DeathComparatorFunction >
 Position_to_index_overlay (unsigned int numberOfColumns, Column_settings *colSettings, const BirthComparatorFunction &birthComparator, const DeathComparatorFunction &deathComparator)
 Only available for chain matrices. Constructs a new empty matrix and reserves space for the given number of columns. More...
 
 Position_to_index_overlay (const Position_to_index_overlay &matrixToCopy, Column_settings *colSettings=nullptr)
 Copy constructor. If colSettings is not a null pointer, its value is kept instead of the one in the copied matrix. More...
 
 Position_to_index_overlay (Position_to_index_overlay &&other) noexcept
 Move constructor. More...
 
template<class Boundary_range = Boundary>
void insert_boundary (const Boundary_range &boundary, Dimension dim=Master_matrix::template get_null_value< Dimension >())
 Inserts at the end of the matrix a new ordered column corresponding to the given boundary. This means that it is assumed that this method is called on boundaries in the order of the filtration. It also assumes that the cells in the given boundary are identified by their relative position in the filtration, starting at 0. If it is not the case, use the other insert_boundary instead by indicating the cell ID used in the boundaries when the cell is inserted. More...
 
template<class Boundary_range = Boundary>
void insert_boundary (ID_index cellIndex, const Boundary_range &boundary, Dimension dim=Master_matrix::template get_null_value< Dimension >())
 It does the same as the other version, but allows the boundary cells to be identified without restrictions except that all IDs have to be strictly increasing in the order of filtration. Note that you should avoid then to use the other insertion method to avoid overwriting IDs. More...
 
Columnget_column (Pos_index position)
 Returns the column at the given PosIdx index. The type of the column depends on the chosen options, see PersistenceMatrixOptions::column_type. More...
 
const Columnget_column (Pos_index position) const
 Returns the column at the given PosIdx index. The type of the column depends on the chosen options, see PersistenceMatrixOptions::column_type. More...
 
Rowget_row (ID_index rowIndex)
 Only available if PersistenceMatrixOptions::has_row_access is true. Returns the row at the given row index. The type of the row depends on the chosen options, see PersistenceMatrixOptions::has_intrusive_rows. More...
 
const Rowget_row (ID_index rowIndex) const
 Only available if PersistenceMatrixOptions::has_row_access is true. Returns the row at the given row index. The type of the row depends on the chosen options, see PersistenceMatrixOptions::has_intrusive_rows. More...
 
void erase_empty_row (ID_index rowIndex)
 Only available if PersistenceMatrixOptions::has_row_access and PersistenceMatrixOptions::has_removable_rows are true. Assumes that the row is empty and removes it. More...
 
void remove_maximal_cell (Pos_index position)
 Only available if PersistenceMatrixOptions::has_removable_columns, PersistenceMatrixOptions::has_vine_update and PersistenceMatrixOptions::has_map_column_container are true. Assumes that the cell is maximal in the current complex and removes it such that the matrix remains consistent (i.e., the matrix is still a compatible bases of the chain complex in the sense of [41]). The maximality of the cell is not verified. Also updates the barcode if it was computed. More...
 
void remove_last ()
 Only available if PersistenceMatrixOptions::has_removable_columns is true and, if PersistenceMatrixOptions::has_map_column_container is true or PersistenceMatrixOptions::has_vine_update is false. Removes the last cell in the filtration from the matrix and updates the barcode if it is stored. More...
 
Dimension get_max_dimension () const
 Returns the maximal dimension of a cell stored in the matrix. Only available if PersistenceMatrixOptions::has_matrix_maximal_dimension_access is true. More...
 
Index get_number_of_columns () const
 Returns the current number of columns in the matrix. More...
 
Dimension get_column_dimension (Pos_index position) const
 Returns the dimension of the given cell. More...
 
void add_to (Pos_index sourcePosition, Pos_index targetPosition)
 Adds column corresponding to sourcePosition onto the column corresponding to targetPosition. More...
 
void multiply_target_and_add_to (Pos_index sourcePosition, const Field_element &coefficient, Pos_index targetPosition)
 Multiplies the target column with the coefficient and then adds the source column to it. That is: targetColumn = (targetColumn * coefficient) + sourceColumn. More...
 
void multiply_source_and_add_to (const Field_element &coefficient, Pos_index sourcePosition, Pos_index targetPosition)
 Multiplies the source column with the coefficient before adding it to the target column. That is: targetColumn += (coefficient * sourceColumn). The source column will not be modified. More...
 
bool is_zero_entry (Pos_index position, ID_index rowIndex) const
 Indicates if the entry at given coordinates has value zero. More...
 
bool is_zero_column (Pos_index position)
 Indicates if the column at given index has value zero. More...
 
Pos_index get_column_with_pivot (ID_index cellIndex) const
 Returns the PosIdx index of the column which has the given row index as pivot. Assumes that the pivot exists. More...
 
ID_index get_pivot (Pos_index position)
 Returns the row index of the pivot of the given column. More...
 
void reset (Column_settings *colSettings)
 Resets the matrix to an empty matrix. More...
 
Position_to_index_overlayoperator= (const Position_to_index_overlay &other)
 Assign operator.
 
const Barcodeget_current_barcode () const
 Returns the current barcode of the matrix. Available only if PersistenceMatrixOptions::has_column_pairings is true. More...
 
void update_representative_cycles ()
 Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true. Pre-computes the representative cycles of the current state of the filtration represented by the matrix. It does not need to be called before get_representative_cycles is called for the first time, but needs to be called before calling get_representative_cycles again if the matrix was modified in between. Otherwise the old cycles will be returned.
 
const std::vector< Cycle > & get_representative_cycles ()
 Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true. Returns all representative cycles of the current filtration. More...
 
const Cycleget_representative_cycle (const Bar &bar)
 Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true. Returns the cycle representing the given bar. More...
 
bool vine_swap_with_z_eq_1_case (Pos_index position)
 Only available if PersistenceMatrixOptions::has_vine_update is true. Does the same than vine_swap, but assumes that the swap is non trivial and therefore skips a part of the case study. More...
 
bool vine_swap (Pos_index position)
 Only available if PersistenceMatrixOptions::has_vine_update is true. 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 cells at position position and position + 1 swapped. Of course, the two cells 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...
 

Friends

void swap (Position_to_index_overlay &matrix1, Position_to_index_overlay &matrix2)
 Swap operator.
 

Detailed Description

template<class Underlying_matrix, class Master_matrix>
class Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >

Overlay for chain matrices replacing all input and output MatIdx indices of the original methods with PosIdx indices. The overlay is useless for boundary matrices as MatIdx == PosIdx for them.

Template Parameters
%Underlying_matrixMatrix type taking the overlay.
Master_matrixAn instantiation of Matrix from which all types and options are deduced.

Member Typedef Documentation

◆ Bar

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Bar = typename Master_matrix::Bar

Bar type.

◆ Barcode

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Barcode = typename Master_matrix::Barcode

Barcode type.

◆ Boundary

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Boundary = typename Master_matrix::Boundary

Type of an input column.

◆ Column

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Column = typename Master_matrix::Column

Column type.

◆ Column_settings

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Column_settings = typename Master_matrix::Column_settings

Structure giving access to the columns to necessary external classes.

◆ Cycle

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Cycle = typename Master_matrix::Cycle

Cycle type.

◆ Dimension

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Dimension = typename Master_matrix::Dimension

Dimension value type.

◆ Entry_constructor

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Entry_constructor = typename Master_matrix::Entry_constructor

Factory of Entry classes.

◆ Entry_representative

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Entry_representative = typename Master_matrix::Entry_representative

Entry content representative.

◆ Field_element

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Field_element = typename Master_matrix::Element

Type of an field element.

◆ ID_index

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::ID_index = typename Master_matrix::ID_index

IDIdx index type.

◆ Index

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Index = typename Master_matrix::Index

MatIdx index type.

◆ Pos_index

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Pos_index = typename Master_matrix::Pos_index

PosIdx index type.

◆ Row

template<class Underlying_matrix , class Master_matrix >
using Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Row = typename Master_matrix::Row

Row type, only necessary with row access option.

Constructor & Destructor Documentation

◆ Position_to_index_overlay() [1/8]

template<class Underlying_matrix , class Master_matrix >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( Column_settings colSettings)
inline

Constructs an empty matrix.

Parameters
colSettingsPointer to an existing setting structure for the columns. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators.

◆ Position_to_index_overlay() [2/8]

template<class Underlying_matrix , class Master_matrix >
template<class Boundary_range >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( const std::vector< Boundary_range > &  orderedBoundaries,
Column_settings colSettings 
)
inline

Constructs a new matrix from the given ranges of Matrix::Entry_representative. Each range corresponds to a column (the order of the ranges are preserved). The content of the ranges is assumed to be sorted by increasing IDs. The IDs of the simplices are also assumed to be consecutive, ordered by filtration value, starting with 0.

Template Parameters
Boundary_rangeRange type for Matrix::Entry_representative ranges. Assumed to have a begin(), end() and size() method.
Parameters
orderedBoundariesRange of boundaries: orderedBoundaries is interpreted as a boundary matrix of a filtered simplicial complex, whose boundaries are ordered by filtration order. Therefore, orderedBoundaries[i] should store the boundary of the \( i^{th} \) simplex in the filtration, as an ordered list of indices of its facets (again those indices correspond to their respective position in the matrix). That is why the indices of the simplices are assumed to be consecutive and starting with 0 (an empty boundary is interpreted as a vertex boundary and not as a non existing simplex). All dimensions up to the maximal dimension of interest have to be present. If only a higher dimension is of interest and not everything should be stored, then use the insert_boundary method instead (after creating the matrix with the Position_to_index_overlay(unsigned int, Column_settings*) constructor preferably).
colSettingsPointer to an existing setting structure for the columns. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators.

◆ Position_to_index_overlay() [3/8]

template<class Underlying_matrix , class Master_matrix >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( unsigned int  numberOfColumns,
Column_settings colSettings 
)
inline

Constructs a new empty matrix and reserves space for the given number of columns.

Parameters
numberOfColumnsNumber of columns to reserve space for.
colSettingsPointer to an existing setting structure for the columns. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators.

◆ Position_to_index_overlay() [4/8]

template<class Underlying_matrix , class Master_matrix >
template<typename BirthComparatorFunction , typename DeathComparatorFunction >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( Column_settings colSettings,
const BirthComparatorFunction &  birthComparator,
const DeathComparatorFunction &  deathComparator 
)
inline

Only available for chain matrices. Constructs an empty matrix and stores the given comparators.

Warning
If PersistenceMatrixOptions::has_vine_update is false, the comparators are not used. And if PersistenceMatrixOptions::has_vine_update is true, but PersistenceMatrixOptions::has_column_pairings is also true, the comparators are ignored and the current barcode is used to compare birth and deaths. Therefore it is useless to provide them in those cases.
Template Parameters
BirthComparatorFunctionType of the birth comparator: (Pos_index, Pos_index) -> bool
DeathComparatorFunctionType of the death comparator: (Pos_index, Pos_index) -> bool
Parameters
colSettingsPointer to an existing setting structure for the columns. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators.
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.

◆ Position_to_index_overlay() [5/8]

template<class Underlying_matrix , class Master_matrix >
template<typename BirthComparatorFunction , typename DeathComparatorFunction , class Boundary_range >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( const std::vector< Boundary_range > &  orderedBoundaries,
Column_settings colSettings,
const BirthComparatorFunction &  birthComparator,
const DeathComparatorFunction &  deathComparator 
)
inline

Only available for chain matrices. Constructs a new matrix from the given ranges of Matrix::Entry_representative. Each range corresponds to a column (the order of the ranges are preserved). The content of the ranges is assumed to be sorted by increasing IDs. The IDs of the simplices are also assumed to be consecutive, ordered by filtration value, starting with 0.

Warning
If PersistenceMatrixOptions::has_vine_update is false, the comparators are not used. And if PersistenceMatrixOptions::has_vine_update is true, but PersistenceMatrixOptions::has_column_pairings is also true, the comparators are ignored and the current barcode is used to compare birth and deaths. Therefore it is useless to provide them in those cases.
Template Parameters
BirthComparatorFunctionType of the birth comparator: (Pos_index, Pos_index) -> bool
DeathComparatorFunctionType of the death comparator: (Pos_index, Pos_index) -> bool
Boundary_rangeRange type for Matrix::Entry_representative ranges. Assumed to have a begin(), end() and size() method.
Parameters
orderedBoundariesRange of boundaries: orderedBoundaries is interpreted as a boundary matrix of a filtered simplicial complex, whose boundaries are ordered by filtration order. Therefore, orderedBoundaries[i] should store the boundary of the \( i^{th} \) simplex in the filtration, as an ordered list of indices of its facets (again those indices correspond to their respective position in the matrix). That is why the indices of the simplices are assumed to be consecutive and starting with 0 (an empty boundary is interpreted as a vertex boundary and not as a non existing simplex). All dimensions up to the maximal dimension of interest have to be present. If only a higher dimension is of interest and not everything should be stored, then use the insert_boundary method instead (after creating the matrix with the Position_to_index_overlay(unsigned int, Column_settings*, const BirthComparatorFunction&, const DeathComparatorFunction&) constructor preferably).
colSettingsPointer to an existing setting structure for the columns. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators.
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.

◆ Position_to_index_overlay() [6/8]

template<class Underlying_matrix , class Master_matrix >
template<typename BirthComparatorFunction , typename DeathComparatorFunction >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( unsigned int  numberOfColumns,
Column_settings colSettings,
const BirthComparatorFunction &  birthComparator,
const DeathComparatorFunction &  deathComparator 
)
inline

Only available for chain matrices. Constructs a new empty matrix and reserves space for the given number of columns.

Warning
If PersistenceMatrixOptions::has_vine_update is false, the comparators are not used. And if PersistenceMatrixOptions::has_vine_update is true, but PersistenceMatrixOptions::has_column_pairings is also true, the comparators are ignored and the current barcode is used to compare birth and deaths. Therefore it is useless to provide them in those cases.
Template Parameters
BirthComparatorFunctionType of the birth comparator: (Pos_index, Pos_index) -> bool
DeathComparatorFunctionType of the death comparator: (Pos_index, Pos_index) -> bool
Parameters
numberOfColumnsNumber of columns to reserve space for.
colSettingsPointer to an existing setting structure for the columns. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators.
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.

◆ Position_to_index_overlay() [7/8]

template<class Underlying_matrix , class Master_matrix >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( const Position_to_index_overlay< Underlying_matrix, Master_matrix > &  matrixToCopy,
Column_settings colSettings = nullptr 
)
inline

Copy constructor. If colSettings is not a null pointer, its value is kept instead of the one in the copied matrix.

Parameters
matrixToCopyMatrix to copy.
colSettingsEither a pointer to an existing setting structure for the columns or a null pointer. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators. If null pointer, the pointer stored in matrixToCopy is used instead.

◆ Position_to_index_overlay() [8/8]

template<class Underlying_matrix , class Master_matrix >
Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::Position_to_index_overlay ( Position_to_index_overlay< Underlying_matrix, Master_matrix > &&  other)
inlinenoexcept

Move constructor.

Parameters
otherMatrix to move.

Member Function Documentation

◆ add_to()

template<class Underlying_matrix , class Master_matrix >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::add_to ( Pos_index  sourcePosition,
Pos_index  targetPosition 
)
inline

Adds column corresponding to sourcePosition onto the column corresponding to targetPosition.

Warning
They will be no verification to ensure that the addition makes sense for the validity of the matrix. For example, a right-to-left addition could corrupt the computation of the barcode if done blindly. So should be used with care.
Parameters
sourcePositionPosIdx index of the source column.
targetPositionPosIdx index of the target column.

◆ erase_empty_row()

template<class Underlying_matrix , class Master_matrix >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::erase_empty_row ( ID_index  rowIndex)
inline

Only available if PersistenceMatrixOptions::has_row_access and PersistenceMatrixOptions::has_removable_rows are true. Assumes that the row is empty and removes it.

Warning
The removed rows are always assumed to be empty. If it is not the case, the deleted row entries are not removed from their columns. And in the case of intrusive rows, this will generate a segmentation fault when the column entries are destroyed later. The row access is just meant as a "read only" access to the rows and the erase_empty_row method just as a way to specify that a row is empty and can therefore be removed from dictionaries. This allows to avoid testing the emptiness of a row at each column entry removal, what can be quite frequent.
Parameters
rowIndexRow index of the empty row to remove.

◆ get_column() [1/2]

template<class Underlying_matrix , class Master_matrix >
Position_to_index_overlay< Underlying_matrix, Master_matrix >::Column & Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_column ( Pos_index  position)
inline

Returns the column at the given PosIdx index. The type of the column depends on the chosen options, see PersistenceMatrixOptions::column_type.

Parameters
positionPosIdx index of the column to return.
Returns
Reference to the column.

◆ get_column() [2/2]

template<class Underlying_matrix , class Master_matrix >
const Position_to_index_overlay< Underlying_matrix, Master_matrix >::Column & Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_column ( Pos_index  position) const
inline

Returns the column at the given PosIdx index. The type of the column depends on the chosen options, see PersistenceMatrixOptions::column_type.

Parameters
positionPosIdx index of the column to return.
Returns
Const reference to the column.

◆ get_column_dimension()

template<class Underlying_matrix , class Master_matrix >
Position_to_index_overlay< Underlying_matrix, Master_matrix >::Dimension Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_column_dimension ( Pos_index  position) const
inline

Returns the dimension of the given cell.

Parameters
positionPosIdx index of the cell.
Returns
Dimension of the cell.

◆ get_column_with_pivot()

template<class Underlying_matrix , class Master_matrix >
Position_to_index_overlay< Underlying_matrix, Master_matrix >::Pos_index Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_column_with_pivot ( ID_index  cellIndex) const
inline

Returns the PosIdx index of the column which has the given row index as pivot. Assumes that the pivot exists.

Parameters
cellIndexRow index of the pivot.
Returns
PosIdx index of the column with the given pivot.

◆ get_current_barcode()

template<class Underlying_matrix , class Master_matrix >
const Position_to_index_overlay< Underlying_matrix, Master_matrix >::Barcode & Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_current_barcode
inline

Returns the current barcode of the matrix. Available only if PersistenceMatrixOptions::has_column_pairings is true.

Recall that we assume that the boundaries were inserted in the order of filtration for the barcode to be valid.

Returns
A reference to the barcode. The barcode is a vector of Matrix::Bar. A bar stores three attributes: the PosIdx birth index, the PosIdx death index and the dimension of the bar.

◆ get_max_dimension()

template<class Underlying_matrix , class Master_matrix >
Position_to_index_overlay< Underlying_matrix, Master_matrix >::Dimension Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_max_dimension
inline

Returns the maximal dimension of a cell stored in the matrix. Only available if PersistenceMatrixOptions::has_matrix_maximal_dimension_access is true.

Returns
The maximal dimension.

◆ get_number_of_columns()

template<class Underlying_matrix , class Master_matrix >
Position_to_index_overlay< Underlying_matrix, Master_matrix >::Index Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_number_of_columns
inline

Returns the current number of columns in the matrix.

Returns
The number of columns.

◆ get_pivot()

template<class Underlying_matrix , class Master_matrix >
Position_to_index_overlay< Underlying_matrix, Master_matrix >::ID_index Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_pivot ( Pos_index  position)
inline

Returns the row index of the pivot of the given column.

Parameters
positionPosIdx index of the cell corresponding to the column.
Returns
The row index of the pivot.

◆ get_representative_cycle()

template<class Underlying_matrix , class Master_matrix >
const Position_to_index_overlay< Underlying_matrix, Master_matrix >::Cycle & Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_representative_cycle ( const Bar bar)
inline

Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true. Returns the cycle representing the given bar.

Parameters
barA bar from the current barcode.
Returns
A const reference to the cycle representing bar.

◆ get_representative_cycles()

template<class Underlying_matrix , class Master_matrix >
const std::vector< typename Position_to_index_overlay< Underlying_matrix, Master_matrix >::Cycle > & Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_representative_cycles
inline

Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true. Returns all representative cycles of the current filtration.

Returns
A const reference to the vector of representative cycles.

◆ get_row() [1/2]

template<class Underlying_matrix , class Master_matrix >
Position_to_index_overlay< Underlying_matrix, Master_matrix >::Row & Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_row ( ID_index  rowIndex)
inline

Only available if PersistenceMatrixOptions::has_row_access is true. Returns the row at the given row index. The type of the row depends on the chosen options, see PersistenceMatrixOptions::has_intrusive_rows.

Parameters
rowIndexRow index of the row to return.
Returns
Reference to the row.

◆ get_row() [2/2]

template<class Underlying_matrix , class Master_matrix >
const Position_to_index_overlay< Underlying_matrix, Master_matrix >::Row & Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::get_row ( ID_index  rowIndex) const
inline

Only available if PersistenceMatrixOptions::has_row_access is true. Returns the row at the given row index. The type of the row depends on the chosen options, see PersistenceMatrixOptions::has_intrusive_rows.

Parameters
rowIndexRow index of the row to return.
Returns
Const reference to the row.

◆ insert_boundary() [1/2]

template<class Underlying_matrix , class Master_matrix >
template<class Boundary_range >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::insert_boundary ( const Boundary_range &  boundary,
Dimension  dim = Master_matrix::template get_null_value<Dimension>() 
)
inline

Inserts at the end of the matrix a new ordered column corresponding to the given boundary. This means that it is assumed that this method is called on boundaries in the order of the filtration. It also assumes that the cells in the given boundary are identified by their relative position in the filtration, starting at 0. If it is not the case, use the other insert_boundary instead by indicating the cell ID used in the boundaries when the cell is inserted.

Different to the constructor, the boundaries do not have to come from a simplicial complex, but also from a more general entry complex. This includes cubical complexes or Morse complexes for example.

When inserted, the given boundary is reduced and from the reduction process, the column is deduced in the form of: IDIdx + linear combination of older column IDIdxs. If the barcode is stored, it will be updated.

Template Parameters
Boundary_rangeRange of Matrix::Entry_representative. Assumed to have a begin(), end() and size() method.
Parameters
boundaryBoundary generating the new column. The content should be ordered by ID.
dimDimension of the cell whose boundary is given. If the complex is simplicial, this parameter can be omitted as it can be deduced from the size of the boundary.

◆ insert_boundary() [2/2]

template<class Underlying_matrix , class Master_matrix >
template<class Boundary_range >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::insert_boundary ( ID_index  cellIndex,
const Boundary_range &  boundary,
Dimension  dim = Master_matrix::template get_null_value<Dimension>() 
)
inline

It does the same as the other version, but allows the boundary cells to be identified without restrictions except that all IDs have to be strictly increasing in the order of filtration. Note that you should avoid then to use the other insertion method to avoid overwriting IDs.

As a cell has to be inserted before one of its cofaces in a valid filtration (recall that it is assumed that the cells are inserted by order of filtration), it is sufficient to indicate the ID of the cell being inserted.

Template Parameters
Boundary_rangeRange of Matrix::Entry_representative. Assumed to have a begin(), end() and size() method.
Parameters
cellIndexIDIdx index to use to identify the new cell.
boundaryBoundary generating the new column. The indices of the boundary have to correspond to the cellID values of precedent calls of the method for the corresponding cells and should be ordered in increasing order.
dimDimension of the cell whose boundary is given. If the complex is simplicial, this parameter can be omitted as it can be deduced from the size of the boundary.

◆ is_zero_column()

template<class Underlying_matrix , class Master_matrix >
bool Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::is_zero_column ( Pos_index  position)
inline

Indicates if the column at given index has value zero.

Note that this method should always return false, as a valid chain matrix never has empty columns.

Parameters
positionPosIdx index of the cell corresponding to the column.
Returns
true If the column has value zero.
false Otherwise.

◆ is_zero_entry()

template<class Underlying_matrix , class Master_matrix >
bool Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::is_zero_entry ( Pos_index  position,
ID_index  rowIndex 
) const
inline

Indicates if the entry at given coordinates has value zero.

Parameters
positionPosIdx index of the cell corresponding to the column of the entry.
rowIndexRow index of the row of the entry.
Returns
true If the entry has value zero.
false Otherwise.

◆ multiply_source_and_add_to()

template<class Underlying_matrix , class Master_matrix >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::multiply_source_and_add_to ( const Field_element coefficient,
Pos_index  sourcePosition,
Pos_index  targetPosition 
)
inline

Multiplies the source column with the coefficient before adding it to the target column. That is: targetColumn += (coefficient * sourceColumn). The source column will not be modified.

Warning
They will be no verification to ensure that the addition makes sense for the validity of the matrix. For example, a right-to-left addition could corrupt the computation of the barcode if done blindly. So should be used with care.
Parameters
coefficientValue to multiply.
sourcePositionPosIdx index of the source column.
targetPositionPosIdx index of the target column.

◆ multiply_target_and_add_to()

template<class Underlying_matrix , class Master_matrix >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::multiply_target_and_add_to ( Pos_index  sourcePosition,
const Field_element coefficient,
Pos_index  targetPosition 
)
inline

Multiplies the target column with the coefficient and then adds the source column to it. That is: targetColumn = (targetColumn * coefficient) + sourceColumn.

Warning
They will be no verification to ensure that the addition makes sense for the validity of the matrix. For example, a right-to-left addition could corrupt the computation of the barcode if done blindly. So should be used with care.
Parameters
sourcePositionPosIdx index of the source column.
coefficientValue to multiply.
targetPositionPosIdx index of the target column.

◆ remove_last()

template<class Underlying_matrix , class Master_matrix >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::remove_last
inline

Only available if PersistenceMatrixOptions::has_removable_columns is true and, if PersistenceMatrixOptions::has_map_column_container is true or PersistenceMatrixOptions::has_vine_update is false. Removes the last cell in the filtration from the matrix and updates the barcode if it is stored.

See also remove_maximal_cell.

◆ remove_maximal_cell()

template<class Underlying_matrix , class Master_matrix >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::remove_maximal_cell ( Pos_index  position)
inline

Only available if PersistenceMatrixOptions::has_removable_columns, PersistenceMatrixOptions::has_vine_update and PersistenceMatrixOptions::has_map_column_container are true. Assumes that the cell is maximal in the current complex and removes it such that the matrix remains consistent (i.e., the matrix is still a compatible bases of the chain complex in the sense of [41]). The maximality of the cell is not verified. Also updates the barcode if it was computed.

See also remove_last.

Parameters
positionPosIdx index of the cell to remove.

◆ reset()

template<class Underlying_matrix , class Master_matrix >
void Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::reset ( Column_settings colSettings)
inline

Resets the matrix to an empty matrix.

Parameters
colSettingsPointer to an existing setting structure for the columns. The structure should contain all the necessary external classes specifically necessary for the chosen column type, such as custom allocators.

◆ vine_swap()

template<class Underlying_matrix , class Master_matrix >
bool Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::vine_swap ( Pos_index  position)
inline

Only available if PersistenceMatrixOptions::has_vine_update is true. 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 cells at position position and position + 1 swapped. Of course, the two cells 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
positionPosIdx index of the first cell to swap. The second one has to be at position + 1.
Returns
true If the barcode changed from the swap.
false Otherwise.

◆ vine_swap_with_z_eq_1_case()

template<class Underlying_matrix , class Master_matrix >
bool Gudhi::persistence_matrix::Position_to_index_overlay< Underlying_matrix, Master_matrix >::vine_swap_with_z_eq_1_case ( Pos_index  position)
inline

Only available if PersistenceMatrixOptions::has_vine_update is true. Does the same than vine_swap, but assumes that the swap is non trivial and therefore skips a part of the case study.

Parameters
positionPosIdx index of the first cell to swap. The second one has to be at position + 1.
Returns
true If the barcode changed from the swap.
false Otherwise.

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