Gudhi::persistence_matrix::PersistenceMatrixColumn Class Reference

Concept of the column classes used by the Matrix class. The classes the columns inherit 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...

#include <concept/Persistence_matrix/PersistenceMatrixColumn.h>

Public Types

using Master = unspecified
 
using Index = unspecified
 
using ID_index = unspecified
 
using Dimension = unspecified
 
using Field_element = unspecified
 
using Entry = 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 Matrix_entry = typename Master_matrix::Matrix_entry
 
using Row_container = typename Master_matrix::Row_container
 
- Public Types inherited from Gudhi::persistence_matrix::Column_dimension_holder< Master_matrix >
using Dimension = typename Master_matrix::Dimension
 
- 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 entryConstructor 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 = typename Master_matrix::Boundary>
 PersistenceMatrixColumn (const Container &nonZeroRowIndices, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::Entry_representative. If the dimension is stored, the cell 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 = typename Master_matrix::Boundary, class Row_container >
 PersistenceMatrixColumn (Index columnIndex, const Container &nonZeroRowIndices, Row_container *rowContainer, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::Entry_representative such that the rows can be accessed. Each new entry in the column is also inserted in a row using Row_access::insert_entry. If the dimension is stored, the cell 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 = typename Master_matrix::Boundary>
 PersistenceMatrixColumn (const Container &nonZeroChainRowIndices, Dimension dimension, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::Entry_representative and stores the given dimension if Column_dimension_option is not a dummy. More...
 
template<class Container = typename Master_matrix::Boundary, class Row_container >
 PersistenceMatrixColumn (Index columnIndex, const Container &nonZeroChainRowIndices, Dimension dimension, Row_container *rowContainer, Column_settings *colSettings)
 Constructs a column from the given range of Matrix::Entry_representative such that the rows can be accessed. Each new entry in the column is also inserted in a row using Row_access::insert_entry. 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 entryConstructor is not a null pointer, its value is kept instead of the one in the copied column. More...
 
template<class Row_container >
 PersistenceMatrixColumn (const PersistenceMatrixColumn &column, Index columnIndex, Row_container *rowContainer, Column_settings *colSettings=nullptr)
 Copy constructor with row access. If operators or entryConstructor stored in colSettings 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_elementget_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 entry 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 Row_index_map >
void reorder (const Row_index_map &valueMap, Index columnIndex=Matrix::get_null_value< Index >())
 Reorders the column with the given map of row indices. Also changes the column index stored in the entries if row access is enabled and columnIndex is not the null index. More...
 
void clear ()
 Zeros/empties the column. More...
 
void clear (ID_index rowIndex)
 Zeros the entry 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 null index. More...
 
Field_element 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 Entry iterator to iterate over all entries contained in the underlying container. More...
 
const_iterator begin () const noexcept
 Returns a begin Entry const iterator to iterate over all entries contained in the underlying container. More...
 
iterator end () noexcept
 Returns an end Entry iterator, iterating over all entries contained in the underlying container. More...
 
const_iterator end () const noexcept
 Returns an end Entry const iterator, iterating over all entries contained in the underlying container. More...
 
reverse_iterator rbegin () noexcept
 Returns a begin Entry reverse iterator to iterate over all entries contained in the underlying container. More...
 
const_reverse_iterator rbegin () const noexcept
 Returns a begin Entry const reverse iterator to iterate over all entries contained in the underlying container. More...
 
reverse_iterator rend () noexcept
 Returns an end Entry reverse iterator, iterating over all entries contained in the underlying container. More...
 
const_reverse_iterator rend () const noexcept
 Returns an end Entry const reverse iterator, iterating over all entries contained in the underlying container. More...
 
template<class Entry_range >
PersistenceMatrixColumnoperator+= (const Entry_range &column)
 Adds the given Entry range onto the column. More...
 
PersistenceMatrixColumnoperator+= (PersistenceMatrixColumn &column)
 Adds the given column onto this column. More...
 
PersistenceMatrixColumnoperator*= (const Field_element &val)
 Multiplies all values in the column with the given value. More...
 
template<class Entry_range >
PersistenceMatrixColumnmultiply_target_and_add (const Field_element &val, const Entry_range &column)
 this = val * this + column More...
 
template<class Entry_range >
PersistenceMatrixColumnmultiply_source_and_add (const Entry_range &column, const Field_element &val)
 this = this + column * val More...
 
void push_back (const Entry &entry)
 Adds a copy of the given entry at the end of the column. It is therefore assumed that the row index of the entry is higher than the current pivot of the column. Not available for chain matrices and is only needed for RU matrices. 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 null index and the row container to nullptr. Should only be used by dummy columns.
 
 Row_access (Index columnIndex, Row_container *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_entry (ID_index rowIndex, Matrix_entry *entry)
 Inserts the given entry at the given row index. More...
 
void unlink (Matrix_entry *entry)
 Removes the given entry from its row. More...
 
void update_entry (const Matrix_entry &entry)
 If PersistenceMatrixOptions::has_intrusive_rows is false, updates the copy of the entry 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 null index for chain matrices.
 
 Column_dimension_holder (Dimension 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 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 null index, which means "not existing".
 
 Chain_column_extra_properties (ID_index pivot)
 Constructor setting the pivot at the given value and the pair to null index (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 null index 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 ()
 Un-pairs 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 example, the underlying container of Vector_column can contain entries which were erased explicitly by clear(Index). Those entries 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 example, the underlying container of Vector_column can contain entries which were erased explicitly by clear(Index). Those entries 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 inherit 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

◆ Column_settings

Structure giving access to external classes eventually necessary, like an entry pool for example.

◆ const_iterator

Column const_iterator type.

◆ const_reverse_iterator

Column const_reverse_iterator type.

◆ Dimension

Type for dimension value.

◆ Entry

◆ Field_element

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 entryConstructor 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 common interface for all column types. If colSettings is not specified or is equal to nullptr, the column should still be constructable even though not necessarily "usable".

◆ PersistenceMatrixColumn() [2/8]

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

Constructs a column from the given range of Matrix::Entry_representative. If the dimension is stored, the cell 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
ContainerRange of Matrix::Entry_representative. Assumed to have a begin(), end() and size() method.
Parameters
nonZeroRowIndicesRange of Matrix::Entry_representative 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 common interface for all column types.

◆ PersistenceMatrixColumn() [3/8]

template<class Container = typename Master_matrix::Boundary, class Row_container >
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( Index  columnIndex,
const Container &  nonZeroRowIndices,
Row_container rowContainer,
Column_settings colSettings 
)

Constructs a column from the given range of Matrix::Entry_representative such that the rows can be accessed. Each new entry in the column is also inserted in a row using Row_access::insert_entry. If the dimension is stored, the cell 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
ContainerRange of Matrix::Entry_representative. Assumed to have a begin(), end() and size() method.
Row_containerEither std::map if PersistenceMatrixOptions::has_removable_rows is true or std::vector<Row>.
Parameters
columnIndexMatIdx column index that should be specified to the entries.
nonZeroRowIndicesRange of Matrix::Entry_representative 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 common interface for all column types.

◆ PersistenceMatrixColumn() [4/8]

template<class Container = typename Master_matrix::Boundary>
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( const Container &  nonZeroChainRowIndices,
Dimension  dimension,
Column_settings colSettings 
)

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

Template Parameters
ContainerRange of Matrix::Entry_representative. Assumed to have a begin(), end() and size() method.
Parameters
nonZeroChainRowIndicesRange of Matrix::Entry_representative 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 common interface for all column types.

◆ PersistenceMatrixColumn() [5/8]

template<class Container = typename Master_matrix::Boundary, class Row_container >
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( Index  columnIndex,
const Container &  nonZeroChainRowIndices,
Dimension  dimension,
Row_container rowContainer,
Column_settings colSettings 
)

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

Template Parameters
ContainerRange of Matrix::Entry_representative. Assumed to have a begin(), end() and size() method.
Row_containerEither std::map if PersistenceMatrixOptions::has_removable_rows is true or std::vector<Row>.
Parameters
columnIndexMatIdx column index that should be specified to the entries.
nonZeroChainRowIndicesRange of Matrix::Entry_representative 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 common 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 entryConstructor 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 common 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 >
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn ( const PersistenceMatrixColumn column,
Index  columnIndex,
Row_container rowContainer,
Column_settings colSettings = nullptr 
)

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

Template Parameters
Row_containerEither std::map if PersistenceMatrixOptions::has_removable_rows is true or std::vector<Row>.
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 common 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 Entry const iterator to iterate over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry const iterator.

◆ begin() [2/2]

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

Returns a begin Entry iterator to iterate over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry 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 entry at given row index.

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

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

◆ end() [1/2]

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

Returns an end Entry const iterator, iterating over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry const iterator.

◆ end() [2/2]

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

Returns an end Entry iterator, iterating over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry iterator.

◆ get_content()

std::vector< Field_element > 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. 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 null index.

Only useful for boundary and chain matrices.

Returns
Row index of the pivot or null index.

◆ get_pivot_value()

Field_element 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 entry at given row index has value zero.

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

◆ multiply_source_and_add()

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

this = this + column * val

Template Parameters
Entry_rangeEntry range with begin() and end() method. Has to be ordered by row index if not specified otherwise.
Parameters
columnEntry 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 Entry_range >
PersistenceMatrixColumn & Gudhi::persistence_matrix::PersistenceMatrixColumn::multiply_target_and_add ( const Field_element val,
const Entry_range &  column 
)

this = val * this + column

Template Parameters
Entry_rangeEntry range with begin() and end() method. Has to be ordered by row index if not specified otherwise.
Parameters
valValue to multiply.
columnEntry 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 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 Entry_range >
PersistenceMatrixColumn & Gudhi::persistence_matrix::PersistenceMatrixColumn::operator+= ( const Entry_range &  column)

Adds the given Entry range onto the column.

Template Parameters
Entry_rangeEntry range with begin() and end() method. Has to be ordered by row index if not specified otherwise.
Parameters
columnEntry 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.

◆ push_back()

void Gudhi::persistence_matrix::PersistenceMatrixColumn::push_back ( const Entry entry)

Adds a copy of the given entry at the end of the column. It is therefore assumed that the row index of the entry is higher than the current pivot of the column. Not available for chain matrices and is only needed for RU matrices.

Parameters
entryEntry to push back.

◆ rbegin() [1/2]

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

Returns a begin Entry const reverse iterator to iterate over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry const reverse iterator.

◆ rbegin() [2/2]

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

Returns a begin Entry reverse iterator to iterate over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry reverse iterator.

◆ rend() [1/2]

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

Returns an end Entry const reverse iterator, iterating over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry const reverse iterator.

◆ rend() [2/2]

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

Returns an end Entry reverse iterator, iterating over all entries 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 guaranteed. See description of the actual Column class for more details.
Returns
Entry reverse iterator.

◆ reorder()

template<class Row_index_map >
void Gudhi::persistence_matrix::PersistenceMatrixColumn::reorder ( const Row_index_map &  valueMap,
Index  columnIndex = Matrix::get_null_valueIndex >() 
)

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

Only useful for base and boundary matrices using lazy swaps.

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

◆ 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 entries. 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 example, the underlying container of Vector_column can contain entries which were erased explicitly by clear(Index). Those entries 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 example, the underlying container of Vector_column can contain entries which were erased explicitly by clear(Index). Those entries 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: