Loading...
Searching...
No Matches
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
16
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;
75 using Content_range = unspecified;
76
100 template <class Container = typename Master_matrix::Boundary>
101 PersistenceMatrixColumn(const Container& nonZeroRowIndices,
102 Column_settings* colSettings);
120 template <class Container = typename Master_matrix::Boundary, class Row_container>
122 const Container& nonZeroRowIndices,
123 Row_container* rowContainer,
124 Column_settings* colSettings);
138 template <class Container = typename Master_matrix::Boundary>
139 PersistenceMatrixColumn(const Container& nonZeroChainRowIndices,
140 Dimension dimension,
141 Column_settings* colSettings);
160 template <class Container = typename Master_matrix::Boundary, class Row_container>
162 const Container& nonZeroChainRowIndices,
163 Dimension dimension,
164 Row_container* rowContainer,
165 Column_settings* colSettings);
177 Column_settings* colSettings = nullptr);
193 template <class Row_container>
195 Index columnIndex,
196 Row_container* rowContainer,
197 Column_settings* colSettings = nullptr);
208
217 std::vector<Field_element> get_content(int columnLength = -1) const;
225 bool is_non_zero(ID_index rowIndex) const;
232 bool is_empty();
242 std::size_t size() const;
243
257 template <class Row_index_map>
258 void reorder(const Row_index_map& valueMap, [[maybe_unused]] Index columnIndex = Matrix::get_null_value<Index>());
265 void clear();
277 void clear(ID_index rowIndex);
278
298
307 iterator begin() noexcept;
316 const_iterator begin() const noexcept;
325 iterator end() noexcept;
334 const_iterator end() const noexcept;
374 const_reverse_iterator rend() const noexcept;
375
386
397 template <class Entry_range>
398 PersistenceMatrixColumn& operator+=(const Entry_range& column);
406
413 PersistenceMatrixColumn& operator*=(const Field_element& val);
414
426 template <class Entry_range>
427 PersistenceMatrixColumn& multiply_target_and_add(const Field_element& val, const Entry_range& column);
428
440 template <class Entry_range>
441 PersistenceMatrixColumn& multiply_source_and_add(const Entry_range& column, const Field_element& val);
442
450 void push_back(const Entry& entry);
451
463 friend bool operator==(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
476 friend bool operator<(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
477
486};
487
488} // namespace persistence_matrix
489} // namespace Gudhi
Class managing the pivot and partitioning of columns in Chain_matrix.
Definition chain_column_extra_properties.h:58
static constexpr T get_null_value()
Returns value from a type when not set.
Definition Matrix.h:171
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
Content_range get_non_zero_content_range()
Returns a range of the column's non-zero content such that the row indices are ordered by increasing ...
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:69
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.
unspecified Content_range
Definition PersistenceMatrixColumn.h:75
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:52
typename Master_matrix::Row_container Row_container
Definition row_access.h:57
Row_access Row_access_option
If PersistenceMatrixOptions::has_row_access is true, then Row_access. Otherwise Dummy_row_access....
Definition PersistenceMatrixColumn.h:28
Column_dimension_holder Column_dimension_option
If PersistenceMatrixOptions::has_column_pairings or PersistenceMatrixOptions::has_vine_update or Pers...
Definition PersistenceMatrixColumn.h:36
Chain_column_extra_properties Chain_column_option
If PersistenceMatrixOptions::is_of_boundary_type is false, and, PersistenceMatrixOptions::has_column_...
Definition PersistenceMatrixColumn.h:45
Persistence matrix namespace.
Definition FieldOperators.h:18
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14
Class managing the dimension access of a column.
Definition column_dimension_holder.h:53