Loading...
Searching...
No Matches
PersistenceMatrixColumn.h
Go to the documentation of this file.
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Hannah Schreiber
*
* Copyright (C) 2024 Inria
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
*/
namespace Gudhi {
namespace persistence_matrix {
using Row_access_option = Row_access;
using Column_dimension_option = Column_dimension_holder;
using Chain_column_option = Chain_column_extra_properties;
class PersistenceMatrixColumn :
public Row_access_option,
public Column_dimension_option,
public Chain_column_option
{
public:
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;
PersistenceMatrixColumn(Column_settings* colSettings = nullptr);
template <class Container = typename Master_matrix::Boundary>
PersistenceMatrixColumn(const Container& nonZeroRowIndices,
Column_settings* colSettings);
template <class Container = typename Master_matrix::Boundary, class Row_container>
PersistenceMatrixColumn(Index columnIndex,
const Container& nonZeroRowIndices,
Row_container* rowContainer,
Column_settings* colSettings);
template <class Container = typename Master_matrix::Boundary>
PersistenceMatrixColumn(const Container& nonZeroChainRowIndices,
Dimension dimension,
Column_settings* colSettings);
template <class Container = typename Master_matrix::Boundary, class Row_container>
PersistenceMatrixColumn(Index columnIndex,
const Container& nonZeroChainRowIndices,
Dimension dimension,
Row_container* rowContainer,
Column_settings* colSettings);
PersistenceMatrixColumn(const PersistenceMatrixColumn& column,
Column_settings* colSettings = nullptr);
template <class Row_container>
PersistenceMatrixColumn(const PersistenceMatrixColumn& column,
Index columnIndex,
Row_container* rowContainer,
Column_settings* colSettings = nullptr);
PersistenceMatrixColumn(PersistenceMatrixColumn&& column) noexcept;
~PersistenceMatrixColumn();
std::vector<Field_element> get_content(int columnLength = -1) const;
bool is_non_zero(ID_index rowIndex) const;
bool is_empty();
std::size_t size() const;
template <class Row_index_map>
void reorder(const Row_index_map& valueMap, [[maybe_unused]] Index columnIndex = Matrix::get_null_value<Index>());
void clear();
void clear(ID_index rowIndex);
ID_index get_pivot();
Field_element get_pivot_value();
iterator begin() noexcept;
const_iterator begin() const noexcept;
iterator end() noexcept;
const_iterator end() const noexcept;
reverse_iterator rbegin() noexcept;
const_reverse_iterator rbegin() const noexcept;
reverse_iterator rend() noexcept;
const_reverse_iterator rend() const noexcept;
template <class Entry_range>
PersistenceMatrixColumn& operator+=(const Entry_range& column);
PersistenceMatrixColumn& operator+=(PersistenceMatrixColumn& column);
PersistenceMatrixColumn& operator*=(const Field_element& val);
template <class Entry_range>
PersistenceMatrixColumn& multiply_target_and_add(const Field_element& val, const Entry_range& column);
template <class Entry_range>
PersistenceMatrixColumn& multiply_source_and_add(const Entry_range& column, const Field_element& val);
void push_back(const Entry& entry);
friend bool operator==(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
friend bool operator<(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
PersistenceMatrixColumn& operator=(const PersistenceMatrixColumn& other);
friend void swap(PersistenceMatrixColumn& col1, PersistenceMatrixColumn& col2);
};
} // namespace persistence_matrix
} // namespace Gudhi
Gudhi::persistence_matrix::Chain_column_extra_properties
Class managing the pivot and partitioning of columns in Chain_matrix.
Definition chain_column_extra_properties.h:57
Gudhi::persistence_matrix::Matrix::get_null_value
static constexpr const T get_null_value()
Returns value from a type when not set.
Definition Matrix.h:170
Gudhi::persistence_matrix::PersistenceMatrixColumn::const_reverse_iterator
unspecified const_reverse_iterator
Definition PersistenceMatrixColumn.h:74
Gudhi::persistence_matrix::PersistenceMatrixColumn::push_back
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 o...
Gudhi::persistence_matrix::PersistenceMatrixColumn::get_pivot
ID_index get_pivot()
Returns the row index of the pivot. If the column does not have a pivot, returns null index.
Gudhi::persistence_matrix::PersistenceMatrixColumn::size
std::size_t size() const
Returns the size of the underlying container.
Gudhi::persistence_matrix::PersistenceMatrixColumn::Entry
unspecified Entry
Definition PersistenceMatrixColumn.h:68
Gudhi::persistence_matrix::PersistenceMatrixColumn::Index
unspecified Index
Definition PersistenceMatrixColumn.h:64
Gudhi::persistence_matrix::PersistenceMatrixColumn::clear
void clear(ID_index rowIndex)
Zeros the entry at given row index.
Gudhi::persistence_matrix::PersistenceMatrixColumn::const_iterator
unspecified const_iterator
Definition PersistenceMatrixColumn.h:72
Gudhi::persistence_matrix::PersistenceMatrixColumn::clear
void clear()
Zeros/empties the column.
Gudhi::persistence_matrix::PersistenceMatrixColumn::~PersistenceMatrixColumn
~PersistenceMatrixColumn()
Destructor.
Gudhi::persistence_matrix::PersistenceMatrixColumn::get_pivot_value
Field_element get_pivot_value()
Returns the value of the pivot. If the column does not have a pivot, returns 0.
Gudhi::persistence_matrix::PersistenceMatrixColumn::rend
reverse_iterator rend() noexcept
Returns an end Entry reverse iterator, iterating over all entries contained in the underlying contain...
Gudhi::persistence_matrix::PersistenceMatrixColumn::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 dimensi...
Gudhi::persistence_matrix::PersistenceMatrixColumn::is_non_zero
bool is_non_zero(ID_index rowIndex) const
Indicates if the entry at given row index has value zero.
Gudhi::persistence_matrix::PersistenceMatrixColumn::reverse_iterator
unspecified reverse_iterator
Definition PersistenceMatrixColumn.h:73
Gudhi::persistence_matrix::PersistenceMatrixColumn::multiply_source_and_add
PersistenceMatrixColumn & multiply_source_and_add(const Entry_range &column, const Field_element &val)
this = this + column * val
Gudhi::persistence_matrix::PersistenceMatrixColumn::ID_index
unspecified ID_index
Definition PersistenceMatrixColumn.h:65
Gudhi::persistence_matrix::PersistenceMatrixColumn::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 ac...
Gudhi::persistence_matrix::PersistenceMatrixColumn::multiply_target_and_add
PersistenceMatrixColumn & multiply_target_and_add(const Field_element &val, const Entry_range &column)
this = val * this + column
Gudhi::persistence_matrix::PersistenceMatrixColumn::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 o...
Gudhi::persistence_matrix::PersistenceMatrixColumn::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 nul...
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn
PersistenceMatrixColumn(Column_settings *colSettings=nullptr)
Constructs an empty column. If entryConstructor is not specified or is set to nullptr,...
Gudhi::persistence_matrix::PersistenceMatrixColumn::Column_settings
unspecified Column_settings
Definition PersistenceMatrixColumn.h:69
Gudhi::persistence_matrix::PersistenceMatrixColumn::is_empty
bool is_empty()
Indicates if the column is empty or has only zero values.
Gudhi::persistence_matrix::PersistenceMatrixColumn::iterator
unspecified iterator
Definition PersistenceMatrixColumn.h:71
Gudhi::persistence_matrix::PersistenceMatrixColumn::Field_element
unspecified Field_element
Definition PersistenceMatrixColumn.h:67
Gudhi::persistence_matrix::PersistenceMatrixColumn::get_content
std::vector< Field_element > get_content(int columnLength=-1) const
Returns the values of the column, zero values included.
Gudhi::persistence_matrix::PersistenceMatrixColumn::rbegin
reverse_iterator rbegin() noexcept
Returns a begin Entry reverse iterator to iterate over all entries contained in the underlying contai...
Gudhi::persistence_matrix::PersistenceMatrixColumn::Master
unspecified Master
Definition PersistenceMatrixColumn.h:63
Gudhi::persistence_matrix::PersistenceMatrixColumn::reorder
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 en...
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn
PersistenceMatrixColumn(PersistenceMatrixColumn &&column) noexcept
Move constructor.
Gudhi::persistence_matrix::PersistenceMatrixColumn::end
iterator end() noexcept
Returns an end Entry iterator, iterating over all entries contained in the underlying container.
Gudhi::persistence_matrix::PersistenceMatrixColumn::Dimension
unspecified Dimension
Definition PersistenceMatrixColumn.h:66
Gudhi::persistence_matrix::PersistenceMatrixColumn::PersistenceMatrixColumn
PersistenceMatrixColumn(const Container &nonZeroRowIndices, Column_settings *colSettings)
Constructs a column from the given range of Matrix::Entry_representative. If the dimension is stored,...
Gudhi::persistence_matrix::PersistenceMatrixColumn::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 ac...
Gudhi::persistence_matrix::PersistenceMatrixColumn::begin
iterator begin() noexcept
Returns a begin Entry iterator to iterate over all entries contained in the underlying container.
Gudhi::persistence_matrix::PersistenceMatrixColumn::swap
friend void swap(PersistenceMatrixColumn &col1, PersistenceMatrixColumn &col2)
Swap operator.
Gudhi::persistence_matrix::Row_access
Class managing the row access for the columns.
Definition row_access.h:51
Gudhi::persistence_matrix::Row_access::Row_container
typename Master_matrix::Row_container Row_container
Definition row_access.h:56
Gudhi::persistence_matrix::Row_access_option
Row_access Row_access_option
If PersistenceMatrixOptions::has_row_access is true, then Row_access. Otherwise Dummy_row_access....
Definition PersistenceMatrixColumn.h:28
Gudhi::persistence_matrix::Column_dimension_option
Column_dimension_holder Column_dimension_option
If PersistenceMatrixOptions::has_column_pairings or PersistenceMatrixOptions::has_vine_update or Pers...
Definition PersistenceMatrixColumn.h:36
Gudhi::persistence_matrix::Chain_column_option
Chain_column_extra_properties Chain_column_option
If PersistenceMatrixOptions::is_of_boundary_type is false, and, PersistenceMatrixOptions::has_column_...
Definition PersistenceMatrixColumn.h:45
Gudhi::persistence_matrix
Persistence matrix namespace.
Definition FieldOperators.h:18
Gudhi
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14
Gudhi::persistence_matrix::Column_dimension_holder
Class managing the dimension access of a column.
Definition column_dimension_holder.h:51