PersistenceMatrixColumn.h
Go to the documentation of this file.
1/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
2 * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
3 * Author(s): Hannah Schreiber
4 *
5 * Copyright (C) 2024 Inria
6 *
7 * Modification(s):
8 * - YYYY/MM Author: Description of the modification
9 */
10
17namespace Gudhi {
18namespace persistence_matrix {
19
46
58 public Row_access_option,
61{
62 public:
63 using Master = unspecified;
64 using Index = unspecified;
65 using ID_index = unspecified;
66 using Dimension = unspecified;
67 using Field_element = unspecified;
68 using Entry = unspecified;
69 using Column_settings = unspecified;
71 using iterator = unspecified;
72 using const_iterator = unspecified;
73 using reverse_iterator = unspecified;
74 using const_reverse_iterator = unspecified;
99 template <class Container = typename Master_matrix::Boundary>
100 PersistenceMatrixColumn(const Container& nonZeroRowIndices,
101 Column_settings* colSettings);
119 template <class Container = typename Master_matrix::Boundary, class Row_container>
121 const Container& nonZeroRowIndices,
122 Row_container* rowContainer,
123 Column_settings* colSettings);
137 template <class Container = typename Master_matrix::Boundary>
138 PersistenceMatrixColumn(const Container& nonZeroChainRowIndices,
139 Dimension dimension,
140 Column_settings* colSettings);
159 template <class Container = typename Master_matrix::Boundary, class Row_container>
161 const Container& nonZeroChainRowIndices,
162 Dimension dimension,
163 Row_container* rowContainer,
164 Column_settings* colSettings);
176 Column_settings* colSettings = nullptr);
192 template <class Row_container>
194 Index columnIndex,
195 Row_container* rowContainer,
196 Column_settings* colSettings = nullptr);
207
216 std::vector<Field_element> get_content(int columnLength = -1) const;
224 bool is_non_zero(ID_index rowIndex) const;
231 bool is_empty();
241 std::size_t size() const;
242
256 template <class Row_index_map>
257 void reorder(const Row_index_map& valueMap, [[maybe_unused]] Index columnIndex = Matrix::get_null_value<Index>());
264 void clear();
276 void clear(ID_index rowIndex);
277
297
306 iterator begin() noexcept;
315 const_iterator begin() const noexcept;
324 iterator end() noexcept;
333 const_iterator end() const noexcept;
373 const_reverse_iterator rend() const noexcept;
374
385 template <class Entry_range>
386 PersistenceMatrixColumn& operator+=(const Entry_range& column);
394
401 PersistenceMatrixColumn& operator*=(const Field_element& val);
402
414 template <class Entry_range>
415 PersistenceMatrixColumn& multiply_target_and_add(const Field_element& val, const Entry_range& column);
416
428 template <class Entry_range>
429 PersistenceMatrixColumn& multiply_source_and_add(const Entry_range& column, const Field_element& val);
430
438 void push_back(const Entry& entry);
439
451 friend bool operator==(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
464 friend bool operator<(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
465
474};
475
476} // namespace persistence_matrix
477} // namespace Gudhi
Class managing the pivot and partitioning of columns in Chain_matrix.
Definition: chain_column_extra_properties.h:57
Concept of the column classes used by the Matrix class. The classes the columns inherit from are eith...
Definition: PersistenceMatrixColumn.h:61
unspecified const_reverse_iterator
Definition: PersistenceMatrixColumn.h:74
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...
ID_index get_pivot()
Returns the row index of the pivot. If the column does not have a pivot, returns null index.
std::size_t size() const
Returns the size of the underlying container.
unspecified Entry
Definition: PersistenceMatrixColumn.h:68
unspecified Index
Definition: PersistenceMatrixColumn.h:64
void clear(ID_index rowIndex)
Zeros the entry at given row index.
unspecified const_iterator
Definition: PersistenceMatrixColumn.h:72
Field_element get_pivot_value()
Returns the value of the pivot. If the column does not have a pivot, returns 0.
reverse_iterator rend() noexcept
Returns an end Entry reverse iterator, iterating over all entries contained in the underlying contain...
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...
bool is_non_zero(ID_index rowIndex) const
Indicates if the entry at given row index has value zero.
unspecified reverse_iterator
Definition: PersistenceMatrixColumn.h:73
PersistenceMatrixColumn & multiply_source_and_add(const Entry_range &column, const Field_element &val)
this = this + column * val
unspecified ID_index
Definition: PersistenceMatrixColumn.h:65
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...
PersistenceMatrixColumn & multiply_target_and_add(const Field_element &val, const Entry_range &column)
this = val * this + column
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...
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...
PersistenceMatrixColumn(Column_settings *colSettings=nullptr)
Constructs an empty column. If entryConstructor is not specified or is set to nullptr,...
unspecified Column_settings
Definition: PersistenceMatrixColumn.h:70
bool is_empty()
Indicates if the column is empty or has only zero values.
unspecified iterator
Definition: PersistenceMatrixColumn.h:71
unspecified Field_element
Definition: PersistenceMatrixColumn.h:67
std::vector< Field_element > get_content(int columnLength=-1) const
Returns the values of the column, zero values included.
reverse_iterator rbegin() noexcept
Returns a begin Entry reverse iterator to iterate over all entries contained in the underlying contai...
unspecified Master
Definition: PersistenceMatrixColumn.h:63
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...
PersistenceMatrixColumn(PersistenceMatrixColumn &&column) noexcept
Move constructor.
iterator end() noexcept
Returns an end Entry iterator, iterating over all entries contained in the underlying container.
unspecified Dimension
Definition: PersistenceMatrixColumn.h:66
PersistenceMatrixColumn(const Container &nonZeroRowIndices, Column_settings *colSettings)
Constructs a column from the given range of Matrix::Entry_representative. If the dimension is stored,...
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...
iterator begin() noexcept
Returns a begin Entry iterator to iterate over all entries contained in the underlying container.
friend void swap(PersistenceMatrixColumn &col1, PersistenceMatrixColumn &col2)
Swap operator.
Class managing the row access for the columns.
Definition: row_access.h:51
typename Master_matrix::Row_container Row_container
Definition: row_access.h:56
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
Class managing the dimension access of a column.
Definition: column_dimension_holder.h:51