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
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_type = unspecified;
67 using Field_element_type = unspecified;
68 using Cell = 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;
98 template <class Container_type = typename Master_matrix::boundary_type>
99 PersistenceMatrixColumn(const Container_type& nonZeroRowIndices,
100 Column_settings* colSettings);
117 template <class Container_type = typename Master_matrix::boundary_type, class Row_container_type>
119 const Container_type& nonZeroRowIndices,
120 Row_container_type* rowContainer,
121 Column_settings* colSettings);
133 template <class Container_type = typename Master_matrix::boundary_type>
134 PersistenceMatrixColumn(const Container_type& nonZeroChainRowIndices,
135 dimension_type dimension,
136 Column_settings* colSettings);
153 template <class Container_type = typename Master_matrix::boundary_type, class Row_container_type>
155 const Container_type& nonZeroChainRowIndices,
156 dimension_type dimension,
157 Row_container_type* rowContainer,
158 Column_settings* colSettings);
170 Column_settings* colSettings = nullptr);
186 template <class Row_container_type>
188 index columnIndex,
189 Row_container_type* rowContainer,
190 Column_settings* colSettings = nullptr);
201
210 std::vector<Field_element_type> get_content(int columnLength = -1) const;
218 bool is_non_zero(id_index rowIndex) const;
225 bool is_empty();
235 std::size_t size() const;
236
249 template <class Map_type>
250 void reorder(const Map_type& valueMap, [[maybe_unused]] index columnIndex = -1);
257 void clear();
269 void clear(id_index rowIndex);
270
289
298 iterator begin() noexcept;
307 const_iterator begin() const noexcept;
316 iterator end() noexcept;
325 const_iterator end() const noexcept;
363 const_reverse_iterator rend() const noexcept;
364
375 template <class Cell_range>
376 PersistenceMatrixColumn& operator+=(const Cell_range& column);
384
392
404 template <class Cell_range>
406
418 template <class Cell_range>
420
432 friend bool operator==(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
445 friend bool operator<(const PersistenceMatrixColumn& c1, const PersistenceMatrixColumn& c2);
446
455};
456
457} // namespace persistence_matrix
458} // namespace Gudhi
Class managing the pivot and partitioning of columns in Chain_matrix.
Definition chain_column_extra_properties.h:56
Concept of the column classes used by the Matrix class. The classes the columns inheritates from are ...
Definition PersistenceMatrixColumn.h:61
unspecified const_reverse_iterator
Definition PersistenceMatrixColumn.h:74
unspecified Cell
Definition PersistenceMatrixColumn.h:68
PersistenceMatrixColumn & multiply_source_and_add(const Cell_range &column, const Field_element_type &val)
this = this + column * val
std::size_t size() const
Returns the size of the underlying container.
bool is_non_zero(id_index rowIndex) const
Indicates if the cell at given row index has value zero.
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 C...
Field_element_type get_pivot_value()
Returns the value of the pivot. If the column does not have a pivot, returns 0.
unspecified id_index
Definition PersistenceMatrixColumn.h:65
unspecified const_iterator
Definition PersistenceMatrixColumn.h:72
reverse_iterator rend() noexcept
Returns a end Cell reverse iterator, iterating over all cells contained in the underlying container.
unspecified reverse_iterator
Definition PersistenceMatrixColumn.h:73
unspecified Field_element_type
Definition PersistenceMatrixColumn.h:67
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...
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,...
std::vector< Field_element_type > get_content(int columnLength=-1) const
Returns the values of the column, zero values included.
PersistenceMatrixColumn(Column_settings *colSettings=nullptr)
Constructs an empty column. If cellConstructor 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 index
Definition PersistenceMatrixColumn.h:64
void clear(id_index rowIndex)
Zeros the cell at given row index.
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....
unspecified iterator
Definition PersistenceMatrixColumn.h:71
unspecified dimension_type
Definition PersistenceMatrixColumn.h:66
reverse_iterator rbegin() noexcept
Returns a begin Cell reverse iterator to iterate over all cells contained in the underlying container...
unspecified Master
Definition PersistenceMatrixColumn.h:63
PersistenceMatrixColumn & multiply_target_and_add(const Field_element_type &val, const Cell_range &column)
this = val * this + column
PersistenceMatrixColumn(PersistenceMatrixColumn &&column) noexcept
Move constructor.
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....
iterator end() noexcept
Returns a end Cell iterator, iterating over all cells contained in the underlying container.
iterator begin() noexcept
Returns a begin Cell iterator to iterate over all cells contained in the underlying container.
id_index get_pivot()
Returns the row index of the pivot. If the column does not have a pivot, returns -1.
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,...
friend void swap(PersistenceMatrixColumn &col1, PersistenceMatrixColumn &col2)
Swap operator.
void reorder(const Map_type &valueMap, index columnIndex=-1)
Reorders the column with the given map of row indices. Also changes the column index stored in the ce...
Class managing the row access for the columns.
Definition row_access.h:50
typename Master_matrix::row_container_type Row_container_type
Definition row_access.h:55
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14
Class managing the dimension access of a column.
Definition column_dimension_holder.h:50