Gudhi::persistence_matrix::PersistenceMatrixColumn Class Reference

Concept of the column classes used by the Matrix class. The classes the columns inheritates from are either real or dummy classes, see Row_access_option, Column_dimension_option, Chain_column_option. If used with column compression, the column type has to have its std::hash method. More...

Public Types

using Master = unspecified
 
using index = unspecified
 
using id_index = unspecified
 
using dimension_type = unspecified
 
using Field_element_type = unspecified
 
using Cell = unspecified
 
using Column_settings = unspecified
 
using iterator = unspecified
 
using const_iterator = unspecified
 
using reverse_iterator = unspecified
 
using const_reverse_iterator = unspecified
 
- Public Types inherited from Gudhi::persistence_matrix::Row_access< Master_matrix >
using index = typename Master_matrix::index
 
using id_index = typename Master_matrix::id_index
 
using Cell_type = typename Master_matrix::Cell_type
 
using Row_container_type = typename Master_matrix::row_container_type
 
- Public Types inherited from Gudhi::persistence_matrix::Column_dimension_holder< Master_matrix >
using dimension_type = typename Master_matrix::dimension_type
 
- Public Types inherited from Gudhi::persistence_matrix::Chain_column_extra_properties< Master_matrix >
using index = typename Master_matrix::index
 
using id_index = typename Master_matrix::id_index
 

Public Member Functions

 PersistenceMatrixColumn (Column_settings *colSettings=nullptr)
 Constructs an empty column. If cellConstructor is not specified or is set to nullptr, the column can only be used as a dummy, i.e., no modifying method should be used or there will be a segmentation fault. Same goes for operators if PersistenceMatrixOptions::is_z2 is false. More...
 
template<class Container_type = typename Master_matrix::boundary_type>
 PersistenceMatrixColumn (const Container_type &nonZeroRowIndices, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::cell_rep_type. If the dimension is stored, the face is assumed to be simplicial and its dimension to be nonZeroRowIndices length - 1 or 0. Otherwise, the dimension should be specified with another constructor. More...
 
template<class Container_type = typename Master_matrix::boundary_type, class Row_container_type >
 PersistenceMatrixColumn (index columnIndex, const Container_type &nonZeroRowIndices, Row_container_type *rowContainer, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::cell_rep_type such that the rows can be accessed. Each new cell in the column is also inserted in a row using Row_access::insert_cell. If the dimension is stored, the face is assumed to be simplicial and its dimension to be nonZeroRowIndices length - 1 or 0. Otherwise, the dimension should be specified with another constructor. More...
 
template<class Container_type = typename Master_matrix::boundary_type>
 PersistenceMatrixColumn (const Container_type &nonZeroChainRowIndices, dimension_type dimension, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::cell_rep_type and stores the given dimension if Column_dimension_option is not a dummy. More...
 
template<class Container_type = typename Master_matrix::boundary_type, class Row_container_type >
 PersistenceMatrixColumn (index columnIndex, const Container_type &nonZeroChainRowIndices, dimension_type dimension, Row_container_type *rowContainer, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::cell_rep_type such that the rows can be accessed. Each new cell in the column is also inserted in a row using Row_access::insert_cell. Stores the given dimension if Column_dimension_option is not a dummy. More...
 
 PersistenceMatrixColumn (const PersistenceMatrixColumn &column, Column_settings *colSettings=nullptr)
 Copy constructor. If operators or cellConstructor is not a null pointer, its value is kept instead of the one in the copied column. More...
 
template<class Row_container_type >
 PersistenceMatrixColumn (const PersistenceMatrixColumn &column, index columnIndex, Row_container_type *rowContainer, Column_settings *colSettings=nullptr)
 Copy constructor with row access. If operators or cellConstructor is not a null pointer, its value is kept instead of the one in the copied column. More...
 
 PersistenceMatrixColumn (PersistenceMatrixColumn &&column) noexcept
 Move constructor. More...
 
 ~PersistenceMatrixColumn ()
 Destructor.
 
std::vector< Field_element_typeget_content (int columnLength=-1) const
 Returns the values of the column, zero values included. More...
 
bool is_non_zero (id_index rowIndex) const
 Indicates if the cell at given row index has value zero. More...
 
bool is_empty ()
 Indicates if the column is empty or has only zero values. More...
 
std::size_t size () const
 Returns the size of the underlying container. More...
 
template<class Map_type >
void reorder (const Map_type &valueMap, [[maybe_unused]] index columnIndex=-1)
 Reorders the column with the given map of row indices. Also changes the column index stored in the cells if row access is enabled and columnIndex is not -1. More...
 
void clear ()
 Zeros/empties the column. More...
 
void clear (id_index rowIndex)
 Zeros the cell at given row index. More...
 
id_index get_pivot ()
 Returns the row index of the pivot. If the column does not have a pivot, returns -1. More...
 
Field_element_type get_pivot_value ()
 Returns the value of the pivot. If the column does not have a pivot, returns 0. More...
 
iterator begin () noexcept
 Returns a begin Cell iterator to iterate over all cells contained in the underlying container. More...
 
const_iterator begin () const noexcept
 Returns a begin Cell const iterator to iterate over all cells contained in the underlying container. More...
 
iterator end () noexcept
 Returns a end Cell iterator, iterating over all cells contained in the underlying container. More...
 
const_iterator end () const noexcept
 Returns a end Cell const iterator, iterating over all cells contained in the underlying container. More...
 
reverse_iterator rbegin () noexcept
 Returns a begin Cell reverse iterator to iterate over all cells contained in the underlying container. More...
 
const_reverse_iterator rbegin () const noexcept
 Returns a begin Cell const reverse iterator to iterate over all cells contained in the underlying container. More...
 
reverse_iterator rend () noexcept
 Returns a end Cell reverse iterator, iterating over all cells contained in the underlying container. More...
 
const_reverse_iterator rend () const noexcept
 Returns a end Cell const reverse iterator, iterating over all cells contained in the underlying container. More...
 
template<class Cell_range >
PersistenceMatrixColumnoperator+= (const Cell_range &column)
 Adds the given Cell range onto the column. More...
 
PersistenceMatrixColumnoperator+= (PersistenceMatrixColumn &column)
 Adds the given column onto this column. More...
 
PersistenceMatrixColumnoperator*= (const Field_element_type &val)
 Multiplies all values in the column with the given value. More...
 
template<class Cell_range >
PersistenceMatrixColumnmultiply_target_and_add (const Field_element_type &val, const Cell_range &column)
 this = val * this + column More...
 
template<class Cell_range >
PersistenceMatrixColumnmultiply_source_and_add (const Cell_range &column, const Field_element_type &val)
 this = this + column * val More...
 
PersistenceMatrixColumnoperator= (const PersistenceMatrixColumn &other)
 Assign operator. Should be disabled when row access is enabled.
 
- Public Member Functions inherited from Gudhi::persistence_matrix::Row_access< Master_matrix >
 Row_access ()
 Default constructor. Sets the column index to -1 and the row container to nullptr. Should only be used by dummy columns.
 
 Row_access (index columnIndex, Row_container_type *rows)
 Constructor setting the column index and the row container by the given values. More...
 
 Row_access (Row_access &&other) noexcept
 Move constructor. More...
 
void insert_cell (id_index rowIndex, Cell_type *cell)
 Inserts the given cell at the given row index. More...
 
void unlink (Cell_type *cell)
 Removes the given cell from its row. More...
 
void update_cell (const Cell_type &cell)
 If PersistenceMatrixOptions::has_intrusive_rows is false, updates the copy of the cell in its row. Otherwise does nothing. More...
 
index get_column_index () const
 Returns the MatIdx column index. More...
 
- Public Member Functions inherited from Gudhi::persistence_matrix::Column_dimension_holder< Master_matrix >
 Column_dimension_holder ()
 Default constructor. Sets the dimension to 0 for boundary matrices and to -1 for chain matrices.
 
 Column_dimension_holder (dimension_type dim)
 Constructor setting the dimension to the given value. More...
 
 Column_dimension_holder (const Column_dimension_holder &col)
 Copy constructor. More...
 
 Column_dimension_holder (Column_dimension_holder &&col)
 Move constructor. More...
 
dimension_type get_dimension () const
 Returns the dimension of the column. More...
 
Column_dimension_holderoperator= (const Column_dimension_holder &other)
 Assign operator.
 
- Public Member Functions inherited from Gudhi::persistence_matrix::Chain_column_extra_properties< Master_matrix >
 Chain_column_extra_properties ()
 Default constructor. Sets the pivot and pair to -1, which means "not existing".
 
 Chain_column_extra_properties (id_index pivot)
 Constructor setting the pivot at the given value and the pair to -1 (i.e. not paired). More...
 
 Chain_column_extra_properties (id_index pivot, index pair)
 Constructor setting the pivot and the pair at the given values. More...
 
 Chain_column_extra_properties (const Chain_column_extra_properties &col)
 Copy constructor. More...
 
 Chain_column_extra_properties (Chain_column_extra_properties &&col)
 Move constructor. More...
 
index get_paired_chain_index () const
 Returns -1 if the column is not paired, the MatIdx of the pair otherwise. More...
 
bool is_paired () const
 Indicates if the column is paired or not. More...
 
void assign_paired_chain (index other_col)
 Sets the value of the pair. More...
 
void unassign_paired_chain ()
 Unpairs a column.
 
Chain_column_extra_propertiesoperator= (const Chain_column_extra_properties &other)
 Assign operator.
 

Friends

bool operator== (const PersistenceMatrixColumn &c1, const PersistenceMatrixColumn &c2)
 Equality comparator. Equal in the sense that what is "supposed" to be contained in the columns is equal, not what is actually stored in the underlying container. For exemple, the underlying container of Vector_column can contain cells which were erased explicitely by clear(index). Those cells should not be taken into account while comparing. More...
 
bool operator< (const PersistenceMatrixColumn &c1, const PersistenceMatrixColumn &c2)
 "Strictly smaller than" comparator. Usually a lexicographical order, but what matters is that the order is total. The order should apply on what is "supposed" to be contained in the columns, not what is actually stored in the underlying container. For exemple, the underlying container of Vector_column can contain cells which were erased explicitely by clear(index). Those cells should not be taken into account while comparing. More...
 
void swap (PersistenceMatrixColumn &col1, PersistenceMatrixColumn &col2)
 Swap operator.
 

Detailed Description

Concept of the column classes used by the Matrix class. The classes the columns inheritates from are either real or dummy classes, see Row_access_option, Column_dimension_option, Chain_column_option. If used with column compression, the column type has to have its std::hash method.

Implementations of this concept are Heap_column, List_column, Vector_column, Naive_vector_column Set_column, Unordered_set_column, Intrusive_list_column and Intrusive_set_column.

Member Typedef Documentation

◆ Cell

◆ Column_settings

Structure giving access to external classes eventually necessary, like a cell pool for example.

◆ const_iterator

Column const_iterator type.

◆ const_reverse_iterator

Column const_reverse_iterator type.

◆ dimension_type

Type for dimension value.

◆ Field_element_type

Type of a field element.

◆ id_index

◆ index

◆ iterator

Column iterator type.

◆ Master

Master matrix, that is a templated Matrix.

◆ reverse_iterator

Column reverse_iterator type.

Constructor & Destructor Documentation

◆ PersistenceMatrixColumn() [1/8]

Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( Column_settings colSettings = nullptr)

Constructs an empty column. If cellConstructor is not specified or is set to nullptr, the column can only be used as a dummy, i.e., no modifying method should be used or there will be a segmentation fault. Same goes for operators if PersistenceMatrixOptions::is_z2 is false.

Parameters
colSettingsPointer to a setting structure or nullptr. The structure should contain all the necessary classes specific to the column type, such as custom allocators. The specificities are this way hidden behind a commun interface for all column types. If colSettings is not specified or is equal to nullptr, the column should still be constructable eventhough not necessarily "usable".

◆ PersistenceMatrixColumn() [2/8]

template<class Container_type = typename Master_matrix::boundary_type>
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( const Container_type &  nonZeroRowIndices,
Column_settings colSettings 
)

Constructs a column from the given range of Matrix::cell_rep_type. If the dimension is stored, the face is assumed to be simplicial and its dimension to be nonZeroRowIndices length - 1 or 0. Otherwise, the dimension should be specified with another constructor.

Template Parameters
Container_typeRange of Matrix::cell_rep_type. Assumed to have a begin(), end() and size() method.
Parameters
nonZeroRowIndicesRange of Matrix::cell_rep_type representing all rows with non zero values.
colSettingsPointer to an existing setting structure. The structure should contain all the necessary classes specific to the column type, such as custom allocators. The specificities are this way hidden behind a commun interface for all column types.

◆ PersistenceMatrixColumn() [3/8]

template<class Container_type = typename Master_matrix::boundary_type, class Row_container_type >
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( index  columnIndex,
const Container_type &  nonZeroRowIndices,
Row_container_type rowContainer,
Column_settings colSettings 
)

Constructs a column from the given range of Matrix::cell_rep_type such that the rows can be accessed. Each new cell in the column is also inserted in a row using Row_access::insert_cell. If the dimension is stored, the face is assumed to be simplicial and its dimension to be nonZeroRowIndices length - 1 or 0. Otherwise, the dimension should be specified with another constructor.

Template Parameters
Container_typeRange of Matrix::cell_rep_type. Assumed to have a begin(), end() and size() method.
Row_container_typeEither std::map if PersistenceMatrixOptions::has_removable_rows is true or std::vector<Row_type>.
Parameters
columnIndexMatIdx column index that should be specified to the cells.
nonZeroRowIndicesRange of Matrix::cell_rep_type representing all rows with non zero values.
rowContainerPointer to the row container that will be forwarded to Row_access at construction.
colSettingsPointer to an existing setting structure. The structure should contain all the necessary classes specific to the column type, such as custom allocators. The specificities are this way hidden behind a commun interface for all column types.

◆ PersistenceMatrixColumn() [4/8]

template<class Container_type = typename Master_matrix::boundary_type>
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( const Container_type &  nonZeroChainRowIndices,
dimension_type  dimension,
Column_settings colSettings 
)

Constructs a column from the given range of Matrix::cell_rep_type and stores the given dimension if Column_dimension_option is not a dummy.

Template Parameters
Container_typeRange of Matrix::cell_rep_type. Assumed to have a begin(), end() and size() method.
Parameters
nonZeroChainRowIndicesRange of Matrix::cell_rep_type representing all rows with non zero values.
dimensionDimension of the column. Is ignored if the dimension is not stored.
colSettingsPointer to an existing setting structure. The structure should contain all the necessary classes specific to the column type, such as custom allocators. The specificities are this way hidden behind a commun interface for all column types.

◆ PersistenceMatrixColumn() [5/8]

template<class Container_type = typename Master_matrix::boundary_type, class Row_container_type >
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( index  columnIndex,
const Container_type &  nonZeroChainRowIndices,
dimension_type  dimension,
Row_container_type rowContainer,
Column_settings colSettings 
)

Constructs a column from the given range of Matrix::cell_rep_type such that the rows can be accessed. Each new cell in the column is also inserted in a row using Row_access::insert_cell. Stores the given dimension if Column_dimension_option is not a dummy.

Template Parameters
Container_typeRange of Matrix::cell_rep_type. Assumed to have a begin(), end() and size() method.
Row_container_typeEither std::map if PersistenceMatrixOptions::has_removable_rows is true or std::vector<Row_type>.
Parameters
columnIndexMatIdx column index that should be specified to the cells.
nonZeroRowIndicesRange of Matrix::cell_rep_type representing all rows with non zero values.
dimensionDimension of the column. Is ignored if the dimension is not stored.
rowContainerPointer to the row container that will be forwarded to Row_access at construction.
colSettingsPointer to an existing setting structure. The structure should contain all the necessary classes specific to the column type, such as custom allocators. The specificities are this way hidden behind a commun interface for all column types.

◆ PersistenceMatrixColumn() [6/8]

Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( const PersistenceMatrixColumn column,
Column_settings colSettings = nullptr 
)

Copy constructor. If operators or cellConstructor is not a null pointer, its value is kept instead of the one in the copied column.

Parameters
columnColumn to copy.
colSettingsPointer to a setting structure or nullptr. The structure should contain all the necessary classes specific to the column type, such as custom allocators. The specificities are this way hidden behind a commun interface for all column types. If colSettings is not specified or is equal to nullptr, the structure stored in column is used instead.

◆ PersistenceMatrixColumn() [7/8]

template<class Row_container_type >
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( const PersistenceMatrixColumn column,
index  columnIndex,
Row_container_type rowContainer,
Column_settings colSettings = nullptr 
)

Copy constructor with row access. If operators or cellConstructor is not a null pointer, its value is kept instead of the one in the copied column.

Template Parameters
Row_container_typeEither std::map if PersistenceMatrixOptions::has_removable_rows is true or std::vector<Row_type>.
Parameters
columnColumn to copy.
columnIndexMatIdx column index of the new column once copied.
rowContainerPointer to the row container that will be forwarded to Row_access.
colSettingsPointer to a setting structure or nullptr. The structure should contain all the necessary classes specific to the column type, such as custom allocators. The specificities are this way hidden behind a commun interface for all column types. If colSettings is not specified or is equal to nullptr, the structure stored in column is used instead.

◆ PersistenceMatrixColumn() [8/8]

Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( PersistenceMatrixColumn &&  column)
noexcept

Move constructor.

Parameters
columnColumn to move.

Member Function Documentation

◆ begin() [1/2]

const_iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::begin ( ) const
noexcept

Returns a begin Cell const iterator to iterate over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell const iterator.

◆ begin() [2/2]

iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::begin ( )
noexcept

Returns a begin Cell iterator to iterate over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell iterator.

◆ clear() [1/2]

void Gudhi::persistence_matrix::PersistenceMatrixColumn::clear ( )

Zeros/empties the column.

Only useful for base and boundary matrices. Used in Matrix::zero_column and in the reduction algorithm for the persistence barcode.

◆ clear() [2/2]

void Gudhi::persistence_matrix::PersistenceMatrixColumn::clear ( id_index  rowIndex)

Zeros the cell at given row index.

Only useful for base and boundary matrices. Used in Matrix::zero_cell and during vine swaps.

Warning
For Vector_column, do not clear a cell that was already at zero or the results of size and is_empty will be wrong.
Parameters
rowIndexRow index of the cell to zero.

◆ end() [1/2]

const_iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::end ( ) const
noexcept

Returns a end Cell const iterator, iterating over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell const iterator.

◆ end() [2/2]

iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::end ( )
noexcept

Returns a end Cell iterator, iterating over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell iterator.

◆ get_content()

std::vector<Field_element_type> Gudhi::persistence_matrix::PersistenceMatrixColumn::get_content ( int  columnLength = -1) const

Returns the values of the column, zero values included.

Parameters
columnLengthNumber of rows to be returned. If -1, the number of rows is fixed at the biggest row index with non zero value. Default value: -1.
Returns
Vector of Field_element_type. At element \( i \) of the vector will be stored the value at row \( i \) of the column.

◆ get_pivot()

id_index Gudhi::persistence_matrix::PersistenceMatrixColumn::get_pivot ( )

Returns the row index of the pivot. If the column does not have a pivot, returns -1.

Only useful for boundary and chain matrices.

Returns
Row index of the pivot or -1.

◆ get_pivot_value()

Field_element_type Gudhi::persistence_matrix::PersistenceMatrixColumn::get_pivot_value ( )

Returns the value of the pivot. If the column does not have a pivot, returns 0.

Has to have value 1 if \( Z_2 \) coefficients are used.

Only useful for boundary and chain matrices.

Returns
The value of the pivot or 0.

◆ is_empty()

bool Gudhi::persistence_matrix::PersistenceMatrixColumn::is_empty ( )

Indicates if the column is empty or has only zero values.

Returns
true If the column is empty or only has zero values.
false Otherwise.

◆ is_non_zero()

bool Gudhi::persistence_matrix::PersistenceMatrixColumn::is_non_zero ( id_index  rowIndex) const

Indicates if the cell at given row index has value zero.

Parameters
rowIndexRow index to look at.
Returns
true If the cell has value zero.
false Otherwise.

◆ multiply_source_and_add()

template<class Cell_range >
PersistenceMatrixColumn& Gudhi::persistence_matrix::PersistenceMatrixColumn::multiply_source_and_add ( const Cell_range &  column,
const Field_element_type val 
)

this = this + column * val

Template Parameters
Cell_rangeCell range with begin() and end() method. Has to be ordered by row index if not specified otherwise.
Parameters
columnCell range. Only the stored row index and the stored element value (if PersistenceMatrixOptions::is_z2 is false) are token into account for this method. Even if PersistenceMatrixOptions::has_row_access is true, the column index does not need to be correct.
valValue to multiply.
Returns
Reference to this column.

◆ multiply_target_and_add()

template<class Cell_range >
PersistenceMatrixColumn& Gudhi::persistence_matrix::PersistenceMatrixColumn::multiply_target_and_add ( const Field_element_type val,
const Cell_range &  column 
)

this = val * this + column

Template Parameters
Cell_rangeCell range with begin() and end() method. Has to be ordered by row index if not specified otherwise.
Parameters
valValue to multiply.
columnCell range. Only the stored row index and the stored element value (if PersistenceMatrixOptions::is_z2 is false) are token into account for this method. Even if PersistenceMatrixOptions::has_row_access is true, the column index does not need to be correct.
Returns
Reference to this column.

◆ operator*=()

PersistenceMatrixColumn& Gudhi::persistence_matrix::PersistenceMatrixColumn::operator*= ( const Field_element_type val)

Multiplies all values in the column with the given value.

Parameters
valValue to multiply.
Returns
Reference to this column.

◆ operator+=() [1/2]

template<class Cell_range >
PersistenceMatrixColumn& Gudhi::persistence_matrix::PersistenceMatrixColumn::operator+= ( const Cell_range &  column)

Adds the given Cell range onto the column.

Template Parameters
Cell_rangeCell range with begin() and end() method. Has to be ordered by row index if not specified otherwise.
Parameters
columnCell range. Only the stored row index and the stored element value (if PersistenceMatrixOptions::is_z2 is false) are token into account for this method. Even if PersistenceMatrixOptions::has_row_access is true, the column index does not need to be correct.
Returns
Reference to this column.

◆ operator+=() [2/2]

PersistenceMatrixColumn& Gudhi::persistence_matrix::PersistenceMatrixColumn::operator+= ( PersistenceMatrixColumn column)

Adds the given column onto this column.

Parameters
columnColumn to add.
Returns
Reference to this column.

◆ rbegin() [1/2]

const_reverse_iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::rbegin ( ) const
noexcept

Returns a begin Cell const reverse iterator to iterate over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell const reverse iterator.

◆ rbegin() [2/2]

reverse_iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::rbegin ( )
noexcept

Returns a begin Cell reverse iterator to iterate over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell reverse iterator.

◆ rend() [1/2]

const_reverse_iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::rend ( ) const
noexcept

Returns a end Cell const reverse iterator, iterating over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell const reverse iterator.

◆ rend() [2/2]

reverse_iterator Gudhi::persistence_matrix::PersistenceMatrixColumn::rend ( )
noexcept

Returns a end Cell reverse iterator, iterating over all cells contained in the underlying container.

Warning
The iterators really just iterate over the underlying container. Depending of the column type, neither the content nor the order is garanteed. See description of the actual Column class for more details.
Returns
Cell reverse iterator.

◆ reorder()

template<class Map_type >
void Gudhi::persistence_matrix::PersistenceMatrixColumn::reorder ( const Map_type &  valueMap,
[[maybe_unused] ] index  columnIndex = -1 
)

Reorders the column with the given map of row indices. Also changes the column index stored in the cells if row access is enabled and columnIndex is not -1.

Only useful for base and boundary matrices using lazy swaps.

Template Parameters
Map_typeMap with an at() method.
Parameters
valueMapMap such that valueMap.at(i) indicates the new row index of the cell at current row index i.
columnIndexNew MatIdx column index of the column. If -1, the index does not change. Ignored if the row access is not enabled. Default value: -1.

◆ size()

std::size_t Gudhi::persistence_matrix::PersistenceMatrixColumn::size ( ) const

Returns the size of the underlying container.

Warning
Depending of the column type, the container does not have to contain only the non-zero cells. Even if for most of the types, the size of the container will correspond to the number of non-zero values in the column, it is not always the case. See description of the actual Column class for more details.
Returns
Size of the underlying container.

Friends And Related Function Documentation

◆ operator<

bool operator< ( const PersistenceMatrixColumn c1,
const PersistenceMatrixColumn c2 
)
friend

"Strictly smaller than" comparator. Usually a lexicographical order, but what matters is that the order is total. The order should apply on what is "supposed" to be contained in the columns, not what is actually stored in the underlying container. For exemple, the underlying container of Vector_column can contain cells which were erased explicitely by clear(index). Those cells should not be taken into account while comparing.

Parameters
c1First column to compare.
c2Second column to compare.
Returns
true If the first column is strictly smaller than the second one.
false Otherwise.

◆ operator==

bool operator== ( const PersistenceMatrixColumn c1,
const PersistenceMatrixColumn c2 
)
friend

Equality comparator. Equal in the sense that what is "supposed" to be contained in the columns is equal, not what is actually stored in the underlying container. For exemple, the underlying container of Vector_column can contain cells which were erased explicitely by clear(index). Those cells should not be taken into account while comparing.

Parameters
c1First column to compare.
c2Second column to compare.
Returns
true If both column are equal.
false Otherwise.

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