Loading...
Searching...
No Matches
Matrix.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) 2022 Inria
6 *
7 * Modification(s):
8 * - 2025/11 Jānis Lazovskis: Added insert_maximal_cell method
9 * - YYYY/MM Author: Description of the modification
10 */
11
17
18#ifndef MASTER_MATRIX_H
19#define MASTER_MATRIX_H
20
21#include <type_traits>
22#include <vector>
23#include <unordered_map>
24#include <map>
25#include <initializer_list>
26
27#include <boost/intrusive/list.hpp>
28
29#include <gudhi/Debug_utils.h>
30
33
35
38
49
55
59
70
72namespace Gudhi {
74namespace persistence_matrix {
75
145template <class PersistenceMatrixOptions = Default_options<> >
147{
148 public:
149 using Option_list = PersistenceMatrixOptions; // to make it accessible from the other classes
154
164 using Element = typename Field_operators::Element;
165 using Characteristic = typename Field_operators::Characteristic;
166
170 template <typename T>
171 static constexpr T get_null_value()
172 {
173 return -1;
174 }
175
180
181 // tags for boost to associate a row and a column to a same entry
182 struct Matrix_row_tag;
183 struct Matrix_column_tag;
184
185 using Base_hook_matrix_row =
186 boost::intrusive::list_base_hook<boost::intrusive::tag<Matrix_row_tag>,
187 boost::intrusive::link_mode<boost::intrusive::auto_unlink> >;
188 using Base_hook_matrix_list_column =
189 boost::intrusive::list_base_hook<boost::intrusive::tag<Matrix_column_tag>,
190 boost::intrusive::link_mode<boost::intrusive::safe_link> >;
191 using Base_hook_matrix_set_column =
192 boost::intrusive::set_base_hook<boost::intrusive::tag<Matrix_column_tag>,
193 boost::intrusive::link_mode<boost::intrusive::safe_link> >;
194
195 // Two dummies are necessary to avoid double inheritance as an entry can inherit both a row and a column hook.
196 struct Dummy_row_hook {};
197
198 struct Dummy_column_hook {};
199
200 using Row_hook =
202 Base_hook_matrix_row,
203 Dummy_row_hook>;
204 using Column_hook =
206 Base_hook_matrix_list_column,
208 Base_hook_matrix_set_column,
209 Dummy_column_hook> >;
210
211 // Option to store the column index within the entry (additionally to the row index). Necessary only with row access.
212 using Entry_column_index_option = std::conditional_t<PersistenceMatrixOptions::has_row_access,
213 Entry_column_index<Index>,
214 Dummy_entry_column_index_mixin>;
215 // Option to store the value of the entry.
216 // Unnecessary for values in Z_2 as there are always 1 (0-valued entries are never stored).
217 using Entry_field_element_option = std::
218 conditional_t<PersistenceMatrixOptions::is_z2, Dummy_entry_field_element_mixin, Entry_field_element<Element> >;
223
229 inline static New_entry_constructor<Matrix_entry> defaultEntryConstructor;
234 using Entry_constructor = Pool_entry_constructor<Matrix_entry>;
235
244 std::conditional_t<PersistenceMatrixOptions::is_z2, ID_index, std::pair<ID_index, Element> >;
245
249 static ID_index get_row_index(const Matrix_entry& e)
250 {
251 return e.get_row_index();
252 }
256 static ID_index get_row_index(const Entry_representative& e)
257 {
258 if constexpr (PersistenceMatrixOptions::is_z2) {
259 return e;
260 } else {
261 return e.first;
262 }
263 }
267 static ID_index& get_row_index(Entry_representative& e)
268 {
269 if constexpr (PersistenceMatrixOptions::is_z2) {
270 return e;
271 } else {
272 return e.first;
273 }
274 }
278 static Element get_element(const Matrix_entry& e)
279 {
280 return e.get_element();
281 }
285 static Element get_element(const Entry_representative& e)
286 {
287 if constexpr (PersistenceMatrixOptions::is_z2) {
288 return Field_operators::get_multiplicative_identity();
289 } else {
290 return e.second;
291 }
292 }
293
298 bool operator()(const Matrix_entry& c1, const Matrix_entry& c2) const
299 {
300 return c1.get_column_index() < c2.get_column_index();
301 }
302 };
303
310 boost::intrusive::list<Matrix_entry,
311 boost::intrusive::constant_time_size<false>,
312 boost::intrusive::base_hook<Base_hook_matrix_row> >,
313 std::set<Matrix_entry, RowEntryComp> >;
314
315 using Row_container =
316 std::conditional_t<PersistenceMatrixOptions::has_removable_rows, std::map<ID_index, Row>, std::vector<Row> >;
317
318 // Row access at column level
319 using Row_access_option = std::conditional_t<PersistenceMatrixOptions::has_row_access,
322 // Row access at matrix level
323 using Matrix_row_access_option =
327
328 template <typename value_type>
329 using Dictionary = std::conditional_t<PersistenceMatrixOptions::has_map_column_container,
330 std::unordered_map<unsigned int, value_type>,
331 std::vector<value_type> >;
332
333 static const bool isNonBasic = PersistenceMatrixOptions::has_column_pairings ||
336
337 using Column_dimension_option = std::
338 conditional_t<isNonBasic, Column_dimension_holder<Matrix<PersistenceMatrixOptions> >, Dummy_dimension_holder>;
339 // Extra information needed for a column when the matrix is a @ref chainmatrix "chain matrix".
340 using Chain_column_option = std::conditional_t<isNonBasic && !PersistenceMatrixOptions::is_of_boundary_type,
343
344 using Matrix_heap_column = Heap_column<Matrix<PersistenceMatrixOptions> >;
345 using Matrix_list_column = List_column<Matrix<PersistenceMatrixOptions> >;
346 using Matrix_vector_column = Vector_column<Matrix<PersistenceMatrixOptions> >;
347 using Matrix_naive_vector_column = Naive_std_vector_column<Matrix<PersistenceMatrixOptions> >;
348 using Matrix_small_vector_column = Naive_small_vector_column<Matrix<PersistenceMatrixOptions> >;
349 using Matrix_set_column = Set_column<Matrix<PersistenceMatrixOptions> >;
350 using Matrix_unordered_set_column = Unordered_set_column<Matrix<PersistenceMatrixOptions> >;
351 using Matrix_intrusive_list_column = Intrusive_list_column<Matrix<PersistenceMatrixOptions> >;
352 using Matrix_intrusive_set_column = Intrusive_set_column<Matrix<PersistenceMatrixOptions> >;
353
359 using Column = std::conditional_t<
361 Matrix_heap_column,
362 std::conditional_t<
364 Matrix_list_column,
365 std::conditional_t<
367 Matrix_set_column,
368 std::conditional_t<
370 Matrix_unordered_set_column,
371 std::conditional_t<
373 Matrix_vector_column,
374 std::conditional_t<
376 Matrix_intrusive_list_column,
377 std::conditional_t<
379 Matrix_naive_vector_column,
381 Matrix_small_vector_column,
382 Matrix_intrusive_set_column>
383 > > > > > > >;
384
385 struct Column_z2_settings {
386 Column_z2_settings() : entryConstructor() {}
387 Column_z2_settings([[maybe_unused]] Characteristic characteristic) : entryConstructor() {}
388 Column_z2_settings([[maybe_unused]] const Column_z2_settings& toCopy) : entryConstructor() {}
389 Column_z2_settings([[maybe_unused]] Column_z2_settings&& toMove) noexcept : entryConstructor() {}
390 ~Column_z2_settings() = default;
391 Column_z2_settings& operator=([[maybe_unused]] const Column_z2_settings& other) { return *this; }
392 Column_z2_settings& operator=([[maybe_unused]] Column_z2_settings&& other) noexcept { return *this; }
393
394 Entry_constructor entryConstructor; // will be replaced by more specific allocators depending on the column type.
395 };
396
397 struct Column_zp_settings {
398 Column_zp_settings() : operators(), entryConstructor() {}
399 Column_zp_settings(Characteristic characteristic) : operators(characteristic), entryConstructor() {}
400 Column_zp_settings(const Column_zp_settings& toCopy) : operators(toCopy.operators), entryConstructor() {}
401 Column_zp_settings(Column_zp_settings&& toMove) noexcept
402 : operators(std::move(toMove.operators)), entryConstructor() {}
403 ~Column_zp_settings() = default;
404 Column_zp_settings& operator=(const Column_zp_settings& other)
405 {
406 operators = other.operators;
407 return *this;
408 }
409 Column_zp_settings& operator=(Column_zp_settings&& other) noexcept
410 {
411 if (this == &other) return *this;
412
413 operators = std::move(other.operators);
414 return *this;
415 }
416
417 Field_operators operators;
418 Entry_constructor entryConstructor; // will be replaced by more specific allocators depending on the column type.
419 };
420
421 // struct Column_z2_with_rows_settings {
422 // Column_z2_with_rows_settings() : entryConstructor(), rows(nullptr) {}
423 // Column_z2_with_rows_settings([[maybe_unused]] Characteristic characteristic)
424 // : entryConstructor(), rows(nullptr) {}
425
426 // Entry_constructor entryConstructor;
427 // Row_container* rows;
428 // };
429
430 // struct Column_zp_with_rows_settings {
431 // Column_zp_with_rows_settings() : operators(), entryConstructor(), rows(nullptr) {}
432 // Column_zp_with_rows_settings(Characteristic characteristic)
433 // : operators(characteristic), entryConstructor(), rows(nullptr) {}
434
435 // Field_operators operators;
436 // Entry_constructor entryConstructor;
437 // Row_container* rows;
438 // };
439
440 // To prepare a more flexible use of the column types later (custom allocators depending on the column type etc.)
441 using Column_settings = std::conditional_t<PersistenceMatrixOptions::is_z2, Column_z2_settings, Column_zp_settings>;
442
446 static Field_operators const* get_operator_ptr(Column_settings const* colSettings)
447 {
448 if constexpr (PersistenceMatrixOptions::is_z2) {
449 return nullptr;
450 } else {
451 if (colSettings == nullptr) return nullptr; // used for dummy columns
452 return &(colSettings->operators);
453 }
454 }
458 template <typename T>
459 static Element get_coefficient_value(T v, [[maybe_unused]] Field_operators const* operators)
460 {
461 if constexpr (PersistenceMatrixOptions::is_z2) {
462 return Field_operators::get_value(v);
463 } else {
464 return operators->get_value(v);
465 }
466 }
470 static Element get_coefficient_value(bool v, [[maybe_unused]] Field_operators const* operators) { return v; }
471
472 // using Column_settings = typename std::conditional<
473 // PersistenceMatrixOptions::is_z2,
474 // typename std::conditional<PersistenceMatrixOptions::has_row_access,
475 // Column_z2_with_rows_settings,
476 // Column_z2_settings
477 // >::type,
478 // typename std::conditional<PersistenceMatrixOptions::has_row_access,
479 // Column_zp_with_rows_settings,
480 // Column_zp_settings
481 // >::type
482 // >::type;
483
484 using Column_container = std::conditional_t<PersistenceMatrixOptions::has_map_column_container,
485 std::unordered_map<Index, Column>,
486 std::vector<Column> >;
487
493 using Barcode = std::conditional_t<
494 hasFixedBarcode,
495 std::vector<Bar>,
496 std::conditional_t<PersistenceMatrixOptions::has_removable_columns, std::list<Bar>, std::vector<Bar> > >;
497 using Bar_dictionary =
498 std::conditional_t<hasFixedBarcode,
500 std::vector<Index>, // RU
501 std::unordered_map<Pos_index, Index> // boundary
502 >,
504 std::unordered_map<Pos_index, typename Barcode::iterator>,
505 std::vector<Index> > >;
506
507 // default type for boundaries to permit list initialization directly in function parameters
508 using Boundary = std::conditional_t<PersistenceMatrixOptions::is_z2,
509 std::initializer_list<ID_index>,
510 std::initializer_list<std::pair<ID_index, Element> > >;
511
512 // i.e. is simple @ref boundarymatrix "boundary matrix". Also, only needed because of the reduction algorithm.
513 // TODO: remove the necessity and recalculate when needed or keep it like that?
514 static const bool maxDimensionIsNeeded =
517
518 using Matrix_dimension_option =
519 std::conditional_t<PersistenceMatrixOptions::has_matrix_maximal_dimension_access || maxDimensionIsNeeded,
524
525 using Master_base_matrix = std::conditional_t<PersistenceMatrixOptions::has_column_compression,
528 using Master_boundary_matrix = Boundary_matrix<Matrix<PersistenceMatrixOptions> >;
529 using Master_RU_matrix = RU_matrix<Matrix<PersistenceMatrixOptions> >;
530 using Master_chain_matrix = Chain_matrix<Matrix<PersistenceMatrixOptions> >;
531
532 template <class Base>
533 using Base_swap_option = std::conditional_t<PersistenceMatrixOptions::has_vine_update ||
537 using Base_pairing_option =
542
543 using RU_pairing_option = std::conditional_t<PersistenceMatrixOptions::has_column_pairings,
548 using RU_vine_swap_option = std::conditional_t<PersistenceMatrixOptions::has_vine_update,
551 using RU_representative_cycles_option =
555
556 using Chain_pairing_option =
562 using Chain_vine_swap_option = std::conditional_t<PersistenceMatrixOptions::has_vine_update,
565 using Chain_representative_cycles_option =
569
573 using Cycle = std::vector<Entry_representative>;
574
578 template <class EntryRange>
579 static Cycle build_cycle_from_range(const EntryRange& entries)
580 {
581 Cycle cycle;
582 if constexpr (RangeTraits<EntryRange>::has_size) {
583 cycle.reserve(entries.size());
584 }
585 for (const auto& c : entries) {
586 if constexpr (PersistenceMatrixOptions::is_z2) {
587 cycle.push_back(c.get_row_index());
588 } else {
589 cycle.push_back({c.get_row_index(), c.get_element()});
590 }
591 }
592 return cycle;
593 }
594
595 // Return types to factorize the corresponding methods
596
597 // The returned column is `const` if the matrix uses column compression
598 using Returned_column =
599 std::conditional_t<!isNonBasic && PersistenceMatrixOptions::has_column_compression, const Column, Column>;
600 // The returned row is `const` if the matrix uses column compression
601 using Returned_row =
602 std::conditional_t<!isNonBasic && PersistenceMatrixOptions::has_column_compression, const Row, Row>;
603 // If the matrix is a chain matrix, the insertion method returns the pivots of its unpaired columns used to reduce the
604 // inserted boundary. Otherwise, void.
605 using Insertion_return =
606 std::conditional_t<PersistenceMatrixOptions::is_of_boundary_type || !isNonBasic ||
608 void,
609 std::vector<Entry_representative> >;
610
641 template <class Container = Boundary>
642 Matrix(const std::vector<Container>& columns, Characteristic characteristic = 11);
652 Matrix(unsigned int numberOfColumns, Characteristic characteristic = Field_operators::nullCharacteristic);
673 Matrix(const std::function<bool(Pos_index, Pos_index)>& birthComparator,
674 const std::function<bool(Pos_index, Pos_index)>& deathComparator);
700 template <class Boundary_range = Boundary>
701 Matrix(const std::vector<Boundary_range>& orderedBoundaries,
702 const std::function<bool(Pos_index, Pos_index)>& birthComparator,
703 const std::function<bool(Pos_index, Pos_index)>& deathComparator,
704 Characteristic characteristic = 11);
728 Matrix(unsigned int numberOfColumns,
729 const std::function<bool(Pos_index, Pos_index)>& birthComparator,
730 const std::function<bool(Pos_index, Pos_index)>& deathComparator,
731 Characteristic characteristic = Field_operators::nullCharacteristic);
737 Matrix(const Matrix& matrixToCopy);
744 Matrix(Matrix&& other) noexcept;
745
746 ~Matrix();
747
748 // TODO: compatibility with multi fields:
749 // - set_characteristic(Characteristic min, Characteristic max)
750 // - readapt reduction?
762 void set_characteristic(Characteristic characteristic);
763
764 // (TODO: if there is no row access and the column type corresponds to the internal column type of the matrix,
765 // moving the column instead of copying it should be possible. Is it worth implementing it?)
776 template <class Container, class = std::enable_if_t<!std::is_arithmetic_v<Container> > >
777 void insert_column(const Container& column);
789 template <class Container, class = std::enable_if_t<!std::is_arithmetic_v<Container> > >
790 void insert_column(const Container& column, Index columnIndex);
797 void insert_column(ID_index idx, Element e = 1U);
798 // TODO: for simple boundary matrices, add an index pointing to the first column inserted after the last call of
799 // get_current_barcode to enable several calls to get_current_barcode
832 template <class Boundary_range = Boundary>
833 Insertion_return insert_boundary(const Boundary_range& boundary, Dimension dim = Matrix::get_null_value<Dimension>());
853 template <class Boundary_range = Boundary>
854 Insertion_return insert_boundary(ID_index cellIndex, const Boundary_range& boundary,
856
884 template <class Boundary_range = Boundary>
885 Insertion_return insert_maximal_cell(Index columnIndex,
886 const Boundary_range& boundary,
888
909 template <class Boundary_range = Boundary>
910 Insertion_return insert_maximal_cell(Index columnIndex,
911 ID_index cellIndex,
912 const Boundary_range& boundary,
914
924 Returned_column& get_column(Index columnIndex);
932 const Column& get_column(Index columnIndex) const;
933 // TODO: there is no particular reason that this method is not available for identifier indexing,
934 // just has to be added to the interface...
945 const Column& get_column(Index columnIndex, bool inR);
946
947 // TODO: update column indices when reordering rows (after lazy swap) such that always MatIdx are returned.
958 Returned_row& get_row(ID_index rowIndex);
968 const Row& get_row(ID_index rowIndex) const;
969 // TODO: there is no particular reason that this method is not available for identifier indexing,
970 // just has to be added to the interface...
981 const Row& get_row(ID_index rowIndex, bool inR);
982
991 void remove_column(Index columnIndex);
992 // TODO: rename method to be less confusing.
1016 // TODO: for chain matrices, replace IDIdx input with MatIdx input to homogenize.
1037 void remove_maximal_cell(Index columnIndex);
1038 // TODO: See if it would be better to use something more general than a vector for columnsToSwap, such that
1039 // the user do not have to construct the vector from scratch. Like passing iterators instead. But it would be nice,
1040 // to still be able to do (cell, {})...
1064 void remove_maximal_cell(ID_index cellIndex, const std::vector<ID_index>& columnsToSwap);
1082
1104
1118 template <typename Integer_index>
1119 std::enable_if_t<std::is_integral_v<Integer_index> > add_to(Integer_index sourceColumnIndex,
1120 Integer_index targetColumnIndex);
1133 template <class Entry_range>
1134 std::enable_if_t<!std::is_integral_v<Entry_range> > add_to(const Entry_range& sourceColumn, Index targetColumnIndex);
1135
1152 template <typename Integer_index>
1153 std::enable_if_t<std::is_integral_v<Integer_index> > multiply_target_and_add_to(Integer_index sourceColumnIndex,
1154 int coefficient,
1155 Integer_index targetColumnIndex);
1170 template <class Entry_range>
1171 std::enable_if_t<!std::is_integral_v<Entry_range> > multiply_target_and_add_to(const Entry_range& sourceColumn,
1172 int coefficient,
1173 Index targetColumnIndex);
1174
1191 template <typename Integer_index>
1192 std::enable_if_t<std::is_integral_v<Integer_index> > multiply_source_and_add_to(int coefficient,
1193 Integer_index sourceColumnIndex,
1194 Integer_index targetColumnIndex);
1209 template <class Entry_range>
1210 std::enable_if_t<!std::is_integral_v<Entry_range> > multiply_source_and_add_to(int coefficient,
1211 const Entry_range& sourceColumn,
1212 Index targetColumnIndex);
1213
1226 void zero_entry(Index columnIndex, ID_index rowIndex);
1236 void zero_entry(Index columnIndex, ID_index rowIndex, bool inR);
1248 void zero_column(Index columnIndex);
1257 void zero_column(Index columnIndex, bool inR);
1270 bool is_zero_entry(Index columnIndex, ID_index rowIndex);
1281 bool is_zero_entry(Index columnIndex, ID_index rowIndex, bool inR) const;
1295 bool is_zero_column(Index columnIndex);
1307 bool is_zero_column(Index columnIndex, bool inR);
1308
1330
1344 Matrix& operator=(Matrix&& other) && noexcept;
1345
1352 friend void swap(Matrix& matrix1, Matrix& matrix2) noexcept
1353 {
1354 swap(matrix1.matrix_, matrix2.matrix_);
1355 std::swap(matrix1.colSettings_, matrix2.colSettings_);
1356 }
1357
1358 void print(); // for debug
1359
1360 // TODO: change the behaviour for boundary matrices.
1387
1398 void swap_columns(Index columnIndex1, Index columnIndex2);
1409 void swap_rows(Index rowIndex1, Index rowIndex2);
1410 // TODO: find better name. And benchmark also to verify if it is really worth it to have this extra version in
1411 // addition to vine_swap.
1436 Index vine_swap_with_z_eq_1_case(Index columnIndex1, Index columnIndex2);
1469 Index vine_swap(Index columnIndex1, Index columnIndex2);
1470
1497 const std::vector<Cycle>& get_all_representative_cycles() const;
1507 const Cycle& get_representative_cycle(const Bar& bar) const;
1508
1509 private:
1510 using Underlying_matrix = std::conditional_t<
1511 isNonBasic,
1512 std::conditional_t<
1514 std::conditional_t<
1516 std::conditional_t<
1519 Master_RU_matrix,
1521 > >,
1522 std::conditional_t<
1525 Master_boundary_matrix,
1527 > > >,
1528 std::conditional_t<
1530 Master_chain_matrix,
1534 > > > >,
1535 Master_base_matrix>;
1536
1537 // Field_operators* operators_;
1538 // Entry_constructor* entryPool_;
1539 Column_settings* colSettings_; // pointer because the of swap operator on matrix_ which also stores the pointer
1540 Underlying_matrix matrix_;
1541
1542 static constexpr void _assert_options();
1543
1544 Element _get_value(int coefficient) const;
1545};
1546
1547template <class PersistenceMatrixOptions>
1548inline Matrix<PersistenceMatrixOptions>::Matrix() : colSettings_(new Column_settings()), matrix_(colSettings_)
1549{
1550 static_assert(
1553 "When no barcode is recorded with vine swaps, comparison functions for the columns have to be provided.");
1554 _assert_options();
1555}
1556
1557template <class PersistenceMatrixOptions>
1558template <class Container>
1559inline Matrix<PersistenceMatrixOptions>::Matrix(const std::vector<Container>& columns, Characteristic characteristic)
1560 : colSettings_(new Column_settings(characteristic)), matrix_(columns, colSettings_)
1561{
1564 "When no barcode is recorded with vine swaps for chain matrices, comparison functions for the columns "
1565 "have to be provided.");
1566 _assert_options();
1567}
1568
1569template <class PersistenceMatrixOptions>
1570inline Matrix<PersistenceMatrixOptions>::Matrix(unsigned int numberOfColumns, Characteristic characteristic)
1571 : colSettings_(new Column_settings(characteristic)), matrix_(numberOfColumns, colSettings_)
1572{
1575 "When no barcode is recorded with vine swaps for chain matrices, comparison functions for the columns "
1576 "have to be provided.");
1577 _assert_options();
1578}
1579
1580template <class PersistenceMatrixOptions>
1581inline Matrix<PersistenceMatrixOptions>::Matrix(const std::function<bool(Pos_index, Pos_index)>& birthComparator,
1582 const std::function<bool(Pos_index, Pos_index)>& deathComparator)
1583 : colSettings_(new Column_settings()), matrix_(colSettings_, birthComparator, deathComparator)
1584{
1585 static_assert(
1588 "Constructor only available for chain matrices when vine swaps are enabled, but the barcode is not recorded.");
1589 _assert_options();
1590}
1591
1592template <class PersistenceMatrixOptions>
1593template <class Boundary_range>
1594inline Matrix<PersistenceMatrixOptions>::Matrix(const std::vector<Boundary_range>& orderedBoundaries,
1595 const std::function<bool(Pos_index, Pos_index)>& birthComparator,
1596 const std::function<bool(Pos_index, Pos_index)>& deathComparator,
1597 Characteristic characteristic)
1598 : colSettings_(new Column_settings(characteristic)),
1599 matrix_(orderedBoundaries, colSettings_, birthComparator, deathComparator)
1600{
1601 static_assert(
1604 "Constructor only available for chain matrices when vine swaps are enabled, but the barcode is not recorded.");
1605 _assert_options();
1606}
1607
1608template <class PersistenceMatrixOptions>
1609inline Matrix<PersistenceMatrixOptions>::Matrix(unsigned int numberOfColumns,
1610 const std::function<bool(Pos_index, Pos_index)>& birthComparator,
1611 const std::function<bool(Pos_index, Pos_index)>& deathComparator,
1612 Characteristic characteristic)
1613 : colSettings_(new Column_settings(characteristic)),
1614 matrix_(numberOfColumns, colSettings_, birthComparator, deathComparator)
1615{
1616 static_assert(
1619 "Constructor only available for chain matrices when vine swaps are enabled, but the barcode is not recorded.");
1620 _assert_options();
1621}
1622
1623template <class PersistenceMatrixOptions>
1625 : colSettings_(new Column_settings(*matrixToCopy.colSettings_)), matrix_(matrixToCopy.matrix_, colSettings_)
1626{
1627 _assert_options();
1628}
1629
1630template <class PersistenceMatrixOptions>
1632 : colSettings_(std::exchange(other.colSettings_, nullptr)), matrix_(std::move(other.matrix_))
1633{
1634 _assert_options();
1635}
1636
1637template <class PersistenceMatrixOptions>
1638inline Matrix<PersistenceMatrixOptions>::~Matrix()
1639{
1640 matrix_.reset(colSettings_); // to avoid crashes at destruction, all columns have to be destroyed first
1641 delete colSettings_;
1642}
1643
1644template <class PersistenceMatrixOptions>
1645inline void Matrix<PersistenceMatrixOptions>::set_characteristic(Characteristic characteristic)
1646{
1647 if constexpr (!PersistenceMatrixOptions::is_z2) {
1648 if (colSettings_->operators.get_characteristic() != Field_operators::nullCharacteristic) {
1649 std::cerr << "Warning: Characteristic already initialised. Changing it could lead to incoherences in the matrix "
1650 "as the modulo was already applied to values in existing columns.";
1651 }
1652
1653 colSettings_->operators.set_characteristic(characteristic);
1654 }
1655}
1656
1657template <class PersistenceMatrixOptions>
1658template <class Container, class>
1659inline void Matrix<PersistenceMatrixOptions>::insert_column(const Container& column)
1660{
1661 if constexpr (!PersistenceMatrixOptions::is_z2) {
1662 GUDHI_CHECK(colSettings_->operators.get_characteristic() != Field_operators::nullCharacteristic,
1663 std::logic_error("Matrix::insert_column - Columns cannot be initialized if the coefficient field "
1664 "characteristic is not specified."));
1665 }
1666
1667 static_assert(
1668 !isNonBasic,
1669 "'insert_column' not available for the chosen options. The input has to be in the form of a cell boundary.");
1670 matrix_.insert_column(column);
1671}
1672
1673template <class PersistenceMatrixOptions>
1674template <class Container, class>
1675inline void Matrix<PersistenceMatrixOptions>::insert_column(const Container& column, Index columnIndex)
1676{
1677 if constexpr (!PersistenceMatrixOptions::is_z2) {
1678 GUDHI_CHECK(colSettings_->operators.get_characteristic() != Field_operators::nullCharacteristic,
1679 std::logic_error("Matrix::insert_column - Columns cannot be initialized if the coefficient field "
1680 "characteristic is not specified."));
1681 }
1682
1683 static_assert(!isNonBasic && !PersistenceMatrixOptions::has_column_compression,
1684 "'insert_column' with those parameters is not available for the chosen options.");
1686 "Columns have to be inserted at the end of the matrix when row access is enabled.");
1687 matrix_.insert_column(column, columnIndex);
1688}
1689
1690template <class PersistenceMatrixOptions>
1692{
1693 static_assert(
1694 !isNonBasic,
1695 "'insert_column' not available for the chosen options. The input has to be in the form of a cell boundary.");
1696
1697 if constexpr (PersistenceMatrixOptions::is_z2) {
1698 matrix_.insert_column(idx);
1699 } else {
1700 GUDHI_CHECK(colSettings_->operators.get_characteristic() != Field_operators::nullCharacteristic,
1701 std::logic_error("Matrix::insert_column - Columns cannot be initialized if the coefficient field "
1702 "characteristic is not specified."));
1703 matrix_.insert_column(idx, e);
1704 }
1705}
1706
1707template <class PersistenceMatrixOptions>
1708template <class Boundary_range>
1709inline typename Matrix<PersistenceMatrixOptions>::Insertion_return Matrix<PersistenceMatrixOptions>::insert_boundary(
1710 const Boundary_range& boundary,
1711 Dimension dim)
1712{
1713 if constexpr (!PersistenceMatrixOptions::is_z2) {
1714 GUDHI_CHECK(colSettings_->operators.get_characteristic() != Field_operators::nullCharacteristic,
1715 std::logic_error("Matrix::insert_boundary - Columns cannot be initialized if the coefficient field "
1716 "characteristic is not specified."));
1717 }
1718
1719 if constexpr (isNonBasic && !PersistenceMatrixOptions::is_of_boundary_type &&
1721 return matrix_.insert_boundary(boundary, dim);
1722 else
1723 matrix_.insert_boundary(boundary, dim);
1724}
1725
1726template <class PersistenceMatrixOptions>
1727template <class Boundary_range>
1728inline typename Matrix<PersistenceMatrixOptions>::Insertion_return
1729Matrix<PersistenceMatrixOptions>::insert_boundary(ID_index cellIndex, const Boundary_range& boundary, Dimension dim)
1730{
1731 if constexpr (!PersistenceMatrixOptions::is_z2) {
1732 GUDHI_CHECK(colSettings_->operators.get_characteristic() != Field_operators::nullCharacteristic,
1733 std::logic_error("Matrix::insert_boundary - Columns cannot be initialized if the coefficient field "
1734 "characteristic is not specified."));
1735 }
1736
1737 static_assert(isNonBasic, "Only enabled for non-basic matrices.");
1740 return matrix_.insert_boundary(cellIndex, boundary, dim);
1741 else
1742 matrix_.insert_boundary(cellIndex, boundary, dim);
1743}
1744
1745template <class PersistenceMatrixOptions>
1746template <class Boundary_range>
1747inline typename Matrix<PersistenceMatrixOptions>::Insertion_return
1748Matrix<PersistenceMatrixOptions>::insert_maximal_cell(Index columnIndex, const Boundary_range& boundary, Dimension dim)
1749{
1750 static_assert(isNonBasic && PersistenceMatrixOptions::has_vine_update,
1751 "'insert_maximal_cell' is not available for the chosen options.");
1752
1753 if constexpr (isNonBasic && !PersistenceMatrixOptions::is_of_boundary_type &&
1755 return matrix_.insert_maximal_cell(columnIndex, boundary, dim);
1756 else
1757 matrix_.insert_maximal_cell(columnIndex, boundary, dim);
1758}
1759
1760template <class PersistenceMatrixOptions>
1761template <class Boundary_range>
1762inline typename Matrix<PersistenceMatrixOptions>::Insertion_return
1764 ID_index cellIndex,
1765 const Boundary_range& boundary,
1766 Dimension dim)
1767{
1768 static_assert(isNonBasic && PersistenceMatrixOptions::has_vine_update,
1769 "'insert_maximal_cell' is not available for the chosen options.");
1770
1771 if constexpr (isNonBasic && !PersistenceMatrixOptions::is_of_boundary_type &&
1773 return matrix_.insert_maximal_cell(columnIndex, cellIndex, boundary, dim);
1774 else
1775 matrix_.insert_maximal_cell(columnIndex, cellIndex, boundary, dim);
1776}
1777
1778template <class PersistenceMatrixOptions>
1779inline typename Matrix<PersistenceMatrixOptions>::Returned_column& Matrix<PersistenceMatrixOptions>::get_column(
1780 Index columnIndex)
1781{
1782 return matrix_.get_column(columnIndex);
1783}
1784
1785template <class PersistenceMatrixOptions>
1787 Index columnIndex) const
1788{
1789 return matrix_.get_column(columnIndex);
1790}
1791
1792template <class PersistenceMatrixOptions>
1794 Index columnIndex,
1795 bool inR)
1796{
1797 // TODO: I don't think there is a particular reason why the indexation is forced, should be removed.
1798 static_assert(
1802 "Only enabled for position indexed RU matrices.");
1803
1804 return matrix_.get_column(columnIndex, inR);
1805}
1806
1807template <class PersistenceMatrixOptions>
1808inline typename Matrix<PersistenceMatrixOptions>::Returned_row& Matrix<PersistenceMatrixOptions>::get_row(
1809 ID_index rowIndex)
1810{
1811 static_assert(PersistenceMatrixOptions::has_row_access, "'get_row' is not available for the chosen options.");
1812
1813 return matrix_.get_row(rowIndex);
1814}
1815
1816template <class PersistenceMatrixOptions>
1818 ID_index rowIndex) const
1819{
1820 static_assert(PersistenceMatrixOptions::has_row_access, "'get_row' is not available for the chosen options.");
1821
1822 return matrix_.get_row(rowIndex);
1823}
1824
1825template <class PersistenceMatrixOptions>
1827 ID_index rowIndex,
1828 bool inR)
1829{
1830 static_assert(PersistenceMatrixOptions::has_row_access, "'get_row' is not available for the chosen options.");
1831 // TODO: I don't think there is a particular reason why the indexation is forced, should be removed.
1832 static_assert(
1836 "Only enabled for position indexed RU matrices.");
1837
1838 return matrix_.get_row(rowIndex, inR);
1839}
1840
1841template <class PersistenceMatrixOptions>
1843{
1844 static_assert(PersistenceMatrixOptions::has_map_column_container && !isNonBasic &&
1846 "'remove_column' is not available for the chosen options.");
1847
1848 matrix_.remove_column(columnIndex);
1849}
1850
1851template <class PersistenceMatrixOptions>
1853{
1854 static_assert(
1856 "'erase_empty_row' is not available for the chosen options.");
1857
1858 matrix_.erase_empty_row(rowIndex);
1859}
1860
1861template <class PersistenceMatrixOptions>
1863{
1865 "'remove_maximal_cell(ID_index)' is not available for the chosen options.");
1866 static_assert(isNonBasic && PersistenceMatrixOptions::has_vine_update,
1867 "'remove_maximal_cell(ID_index)' is not available for the chosen options.");
1870 "'remove_maximal_cell(ID_index)' is not available for the chosen options.");
1871
1872 matrix_.remove_maximal_cell(columnIndex);
1873}
1874
1875template <class PersistenceMatrixOptions>
1877 const std::vector<ID_index>& columnsToSwap)
1878{
1880 "'remove_maximal_cell(ID_index,const std::vector<Index>&)' is not available for the chosen options.");
1881 static_assert(isNonBasic && !PersistenceMatrixOptions::is_of_boundary_type,
1882 "'remove_maximal_cell(ID_index,const std::vector<Index>&)' is not available for the chosen options.");
1884 "'remove_maximal_cell(ID_index,const std::vector<Index>&)' is not available for the chosen options.");
1885
1886 matrix_.remove_maximal_cell(cellIndex, columnsToSwap);
1887}
1888
1889template <class PersistenceMatrixOptions>
1891{
1892 static_assert(PersistenceMatrixOptions::has_removable_columns || !isNonBasic,
1893 "'remove_last' is not available for the chosen options.");
1894 static_assert(!PersistenceMatrixOptions::has_column_compression || isNonBasic,
1895 "'remove_last' is not available for the chosen options.");
1896 static_assert(!isNonBasic || PersistenceMatrixOptions::is_of_boundary_type ||
1898 "'remove_last' is not available for the chosen options.");
1899
1900 matrix_.remove_last();
1901}
1902
1903template <class PersistenceMatrixOptions>
1905{
1906 static_assert(isNonBasic, "'get_max_dimension' is not available for the chosen options.");
1907
1908 return matrix_.get_max_dimension();
1909}
1910
1911template <class PersistenceMatrixOptions>
1913{
1914 return matrix_.get_number_of_columns();
1915}
1916
1917template <class PersistenceMatrixOptions>
1919 Index columnIndex) const
1920{
1921 static_assert(isNonBasic, "'get_column_dimension' is not available for the chosen options.");
1922
1923 return matrix_.get_column_dimension(columnIndex);
1924}
1925
1926template <class PersistenceMatrixOptions>
1927template <typename Integer_index>
1928inline std::enable_if_t<std::is_integral_v<Integer_index> > Matrix<PersistenceMatrixOptions>::add_to(
1929 Integer_index sourceColumnIndex,
1930 Integer_index targetColumnIndex)
1931{
1932 matrix_.add_to(sourceColumnIndex, targetColumnIndex);
1933}
1934
1935template <class PersistenceMatrixOptions>
1936template <class Entry_range>
1937inline std::enable_if_t<!std::is_integral_v<Entry_range> > Matrix<PersistenceMatrixOptions>::add_to(
1938 const Entry_range& sourceColumn,
1939 Index targetColumnIndex)
1940{
1941 static_assert(!isNonBasic,
1942 "For boundary or chain matrices, only additions with columns inside the matrix is allowed to maintain "
1943 "algebraic consistency.");
1944
1945 matrix_.add_to(sourceColumn, targetColumnIndex);
1946}
1947
1948template <class PersistenceMatrixOptions>
1949template <typename Integer_index>
1950inline std::enable_if_t<std::is_integral_v<Integer_index> >
1952 int coefficient,
1953 Integer_index targetColumnIndex)
1954{
1955 matrix_.multiply_target_and_add_to(sourceColumnIndex, _get_value(coefficient), targetColumnIndex);
1956}
1957
1958template <class PersistenceMatrixOptions>
1959template <class Entry_range>
1960inline std::enable_if_t<!std::is_integral_v<Entry_range> > Matrix<PersistenceMatrixOptions>::multiply_target_and_add_to(
1961 const Entry_range& sourceColumn,
1962 int coefficient,
1963 Index targetColumnIndex)
1964{
1965 static_assert(!isNonBasic,
1966 "For boundary or chain matrices, only additions with columns inside the matrix is allowed to maintain "
1967 "algebraic consistency.");
1968
1969 matrix_.multiply_target_and_add_to(sourceColumn, _get_value(coefficient), targetColumnIndex);
1970}
1971
1972template <class PersistenceMatrixOptions>
1973template <typename Integer_index>
1974inline std::enable_if_t<std::is_integral_v<Integer_index> >
1976 Integer_index sourceColumnIndex,
1977 Integer_index targetColumnIndex)
1978{
1979 matrix_.multiply_source_and_add_to(_get_value(coefficient), sourceColumnIndex, targetColumnIndex);
1980}
1981
1982template <class PersistenceMatrixOptions>
1983template <class Entry_range>
1984inline std::enable_if_t<!std::is_integral_v<Entry_range> > Matrix<PersistenceMatrixOptions>::multiply_source_and_add_to(
1985 int coefficient,
1986 const Entry_range& sourceColumn,
1987 Index targetColumnIndex)
1988{
1989 static_assert(!isNonBasic,
1990 "For boundary or chain matrices, only additions with columns inside the matrix is allowed to maintain "
1991 "algebraic consistency.");
1992
1993 matrix_.multiply_source_and_add_to(_get_value(coefficient), sourceColumn, targetColumnIndex);
1994}
1995
1996template <class PersistenceMatrixOptions>
1998{
2000 "'zero_entry' is not available for the chosen options.");
2001
2002 return matrix_.zero_entry(columnIndex, rowIndex);
2003}
2004
2005template <class PersistenceMatrixOptions>
2006inline void Matrix<PersistenceMatrixOptions>::zero_entry(Index columnIndex, ID_index rowIndex, bool inR)
2007{
2008 // TODO: I don't think there is a particular reason why the indexation is forced, should be removed.
2009 static_assert(
2013 "Only enabled for RU matrices.");
2014
2015 return matrix_.zero_entry(columnIndex, rowIndex, inR);
2016}
2017
2018template <class PersistenceMatrixOptions>
2020{
2022 "'zero_column' is not available for the chosen options.");
2023
2024 return matrix_.zero_column(columnIndex);
2025}
2026
2027template <class PersistenceMatrixOptions>
2029{
2030 // TODO: I don't think there is a particular reason why the indexation is forced, should be removed.
2031 static_assert(
2035 "Only enabled for RU matrices.");
2036
2037 return matrix_.zero_column(columnIndex, inR);
2038}
2039
2040template <class PersistenceMatrixOptions>
2042{
2043 return matrix_.is_zero_entry(columnIndex, rowIndex);
2044}
2045
2046template <class PersistenceMatrixOptions>
2047inline bool Matrix<PersistenceMatrixOptions>::is_zero_entry(Index columnIndex, ID_index rowIndex, bool inR) const
2048{
2049 // TODO: I don't think there is a particular reason why the indexation is forced, should be removed.
2050 static_assert(
2054 "Only enabled for RU matrices.");
2055
2056 return matrix_.is_zero_entry(columnIndex, rowIndex, inR);
2057}
2058
2059template <class PersistenceMatrixOptions>
2061{
2062 return matrix_.is_zero_column(columnIndex);
2063}
2064
2065template <class PersistenceMatrixOptions>
2067{
2068 // TODO: I don't think there is a particular reason why the indexation is forced, should be removed.
2069 static_assert(
2073 "Only enabled for RU matrices.");
2074
2075 return matrix_.is_zero_column(columnIndex, inR);
2076}
2077
2078template <class PersistenceMatrixOptions>
2080 ID_index cellIndex) const
2081{
2082 static_assert(isNonBasic && (!PersistenceMatrixOptions::is_of_boundary_type ||
2085 "'get_column_with_pivot' is not available for the chosen options.");
2086
2087 return matrix_.get_column_with_pivot(cellIndex);
2088}
2089
2090template <class PersistenceMatrixOptions>
2092 Index columnIndex)
2093{
2094 static_assert(isNonBasic, "'get_pivot' is not available for the chosen options.");
2095
2096 return matrix_.get_pivot(columnIndex);
2097}
2098
2099template <class PersistenceMatrixOptions>
2101{
2102 swap(matrix_, other.matrix_);
2103 std::swap(colSettings_, other.colSettings_);
2104
2105 return *this;
2106}
2107
2108template <class PersistenceMatrixOptions>
2110{
2111 if (this == &other) return *this;
2112
2113 matrix_ = std::move(other.matrix_);
2114 colSettings_ = std::exchange(other.colSettings_, nullptr);
2115
2116 return *this;
2117}
2118
2119template <class PersistenceMatrixOptions>
2120inline void Matrix<PersistenceMatrixOptions>::print()
2121{
2122 return matrix_.print();
2123}
2124
2125template <class PersistenceMatrixOptions>
2127{
2128 static_assert(PersistenceMatrixOptions::has_column_pairings, "This method was not enabled.");
2129
2130 return matrix_.get_current_barcode();
2131}
2132
2133template <class PersistenceMatrixOptions>
2135 const
2136{
2137 static_assert(PersistenceMatrixOptions::has_column_pairings, "This method was not enabled.");
2138 static_assert(
2141 "'get_current_barcode' is not const for boundary matrices as the barcode is only computed when explicitly "
2142 "asked.");
2143
2144 return matrix_.get_current_barcode();
2145}
2146
2147template <class PersistenceMatrixOptions>
2148inline void Matrix<PersistenceMatrixOptions>::swap_columns(Index columnIndex1, Index columnIndex2)
2149{
2150 static_assert(
2154 "This method was not enabled.");
2155 return matrix_.swap_columns(columnIndex1, columnIndex2);
2156}
2157
2158template <class PersistenceMatrixOptions>
2160{
2161 static_assert(
2165 "This method was not enabled.");
2166 return matrix_.swap_rows(rowIndex1, rowIndex2);
2167}
2168
2169template <class PersistenceMatrixOptions>
2171{
2172 static_assert(PersistenceMatrixOptions::has_vine_update, "This method was not enabled.");
2176 "This method was not enabled.");
2177 return matrix_.vine_swap_with_z_eq_1_case(index);
2178}
2179
2180template <class PersistenceMatrixOptions>
2182 Index columnIndex1,
2183 Index columnIndex2)
2184{
2185 static_assert(PersistenceMatrixOptions::has_vine_update, "This method was not enabled.");
2189 "This method was not enabled.");
2190
2191 return matrix_.vine_swap_with_z_eq_1_case(columnIndex1, columnIndex2);
2192}
2193
2194template <class PersistenceMatrixOptions>
2196{
2197 static_assert(PersistenceMatrixOptions::has_vine_update, "This method was not enabled.");
2201 "This method was not enabled.");
2202 return matrix_.vine_swap(index);
2203}
2204
2205template <class PersistenceMatrixOptions>
2207 Index columnIndex2)
2208{
2209 static_assert(PersistenceMatrixOptions::has_vine_update, "This method was not enabled.");
2213 "This method was not enabled.");
2214 return matrix_.vine_swap(columnIndex1, columnIndex2);
2215}
2216
2217template <class PersistenceMatrixOptions>
2219{
2220 static_assert(PersistenceMatrixOptions::can_retrieve_representative_cycles, "This method was not enabled.");
2221 matrix_.update_all_representative_cycles(dim);
2222}
2223
2224template <class PersistenceMatrixOptions>
2226{
2227 static_assert(PersistenceMatrixOptions::can_retrieve_representative_cycles, "This method was not enabled.");
2228 matrix_.update_representative_cycle(bar);
2229}
2230
2231template <class PersistenceMatrixOptions>
2232inline const std::vector<typename Matrix<PersistenceMatrixOptions>::Cycle>&
2234{
2235 static_assert(PersistenceMatrixOptions::can_retrieve_representative_cycles, "This method was not enabled.");
2236 return matrix_.get_all_representative_cycles();
2237}
2238
2239template <class PersistenceMatrixOptions>
2240inline const typename Matrix<PersistenceMatrixOptions>::Cycle&
2242{
2243 static_assert(PersistenceMatrixOptions::can_retrieve_representative_cycles, "This method was not enabled.");
2244 return matrix_.get_representative_cycle(bar);
2245}
2246
2247template <class PersistenceMatrixOptions>
2248constexpr void Matrix<PersistenceMatrixOptions>::_assert_options()
2249{
2250 static_assert(
2252 "Row access is not possible for heap columns.");
2254 "Vine update currently works only for Z_2 coefficients.");
2255 // static_assert(!PersistenceMatrixOptions::can_retrieve_representative_cycles || PersistenceMatrixOptions::is_z2,
2256 // "Representative cycles can currently only be computed with Z_2 coefficients.");
2257 static_assert(
2259 "Column compression not compatible with heap columns.");
2260
2261 // // This should be warnings instead, as PersistenceMatrixOptions::has_column_compression is just ignored in those
2262 // // cases and don't produces errors as long as the corresponding methods are not called.
2263 // static_assert(!PersistenceMatrixOptions::has_column_compression || !PersistenceMatrixOptions::has_column_pairings,
2264 // "Column compression not available to compute persistence homology (it would bring no advantages; "
2265 // "use it for co-homology instead).");
2266 // static_assert(!PersistenceMatrixOptions::has_column_compression || !PersistenceMatrixOptions::has_vine_update,
2267 // "Column compression not available for vineyards.");
2268 // static_assert(!PersistenceMatrixOptions::has_column_compression ||
2269 // !PersistenceMatrixOptions::can_retrieve_representative_cycles,
2270 // "Column compression not available to retrieve representative cycles.");
2271 // // Would column removal while column compression be useful? If yes, should erase() remove a single column or the
2272 // // class of columns identical to the input?
2273 // // For a single column, I have an implementation for union-find (not the current one) which allows deleting a
2274 // // single element in constant time, but find becomes log n in worst case.
2275 // // For a column class, we either just ignore the removed class (constant time), but this results in memory
2276 // // residues, or, we have an erase method which is at least linear in the size of the class.
2277 // static_assert(
2278 // !PersistenceMatrixOptions::has_column_compression || !PersistenceMatrixOptions::has_map_column_container,
2279 // "When column compression is used, the removal of columns is not implemented yet.");
2280}
2281
2282template <class PersistenceMatrixOptions>
2283inline typename Matrix<PersistenceMatrixOptions>::Element Matrix<PersistenceMatrixOptions>::_get_value(
2284 int coefficient) const
2285{
2286 return get_coefficient_value(coefficient, get_operator_ptr(colSettings_));
2287}
2288
2289} // namespace persistence_matrix
2290} // namespace Gudhi
2291
2292#endif // MASTER_MATRIX_H
Contains the Gudhi::persistence_matrix::Base_matrix class.
Contains the Gudhi::persistence_matrix::Base_matrix_with_column_compression class.
Contains the Gudhi::persistence_matrix::Boundary_matrix class.
Contains the Gudhi::persistence_matrix::Chain_matrix class.
Contains the Gudhi::persistence_matrix::Id_to_index_overlay class.
Contains the Gudhi::persistence_matrix::Position_to_index_overlay class.
Contains the Gudhi::persistence_matrix::RU_matrix class.
Contains the Gudhi::persistence_fields::Z2_field_operators class.
Contains the Gudhi::persistence_matrix::Base_pairing class and Gudhi::persistence_matrix::Dummy_base_...
Contains the Gudhi::persistence_matrix::Base_swap class and Gudhi::persistence_matrix::Dummy_base_swa...
Contains the Gudhi::persistence_matrix::Chain_column_extra_properties class and Gudhi::persistence_ma...
Contains the Gudhi::persistence_matrix::Chain_pairing class and Gudhi::persistence_matrix::Dummy_chai...
Contains the Gudhi::persistence_matrix::Chain_representative_cycles class and Gudhi::persistence_matr...
Contains the Gudhi::persistence_matrix::Chain_barcode_swap and Gudhi::persistence_matrix::Chain_vine_...
Class defining operators for the field.
Definition Z2_field_operators.h:32
A base matrix (also see Base_matrix), but with column compression. That is, all identical columns in ...
Definition Base_matrix_with_column_compression.h:46
A basic matrix structure allowing to easily manipulate and access entire columns and rows,...
Definition Base_matrix.h:39
Class managing the barcode for Boundary_matrix if the option was enabled.
Definition base_pairing.h:56
Class managing the column and row swaps in Base_matrix and Boundary_matrix.
Definition base_swap.h:50
Matrix structure to store the ordered boundary matrix of a filtered complex in order to compute its ...
Definition Boundary_matrix.h:45
Class managing the barcode for Chain_vine_swap.
Definition chain_vine_swap.h:89
Class managing the pivot and partitioning of columns in Chain_matrix.
Definition chain_column_extra_properties.h:58
Matrix structure storing a compatible base of a filtered chain complex. See zigzag....
Definition Chain_matrix.h:58
Class managing the barcode for Chain_matrix if the option was enabled.
Definition chain_pairing.h:48
Class managing the representative cycles for Chain_matrix if the option was enabled.
Definition chain_rep_cycles.h:56
Class managing the vine swaps for Chain_matrix.
Definition chain_vine_swap.h:235
Matrix entry class. Stores by default only the row index it belongs to, but can also store its column...
Definition entry_types.h:163
ID_index get_row_index() const
Returns the row index stored in the entry.
Definition entry_types.h:217
Column class following the PersistenceMatrixColumn concept. Not compatible with row access.
Definition heap_column.h:52
Overlay for non-basic matrices replacing all input and output MatIdx indices of the original methods ...
Definition Id_to_index_overlay.h:41
Column class following the PersistenceMatrixColumn concept.
Definition intrusive_list_column.h:50
Column class following the PersistenceMatrixColumn concept.
Definition intrusive_set_column.h:50
Column class following the PersistenceMatrixColumn concept.
Definition list_column.h:51
Class managing the maximal dimension of a cell represented in the inheriting matrix,...
Definition matrix_dimension_holders.h:136
Class managing the maximal dimension of a cell represented in the inheriting matrix,...
Definition matrix_dimension_holders.h:58
Class managing the row access for the inheriting matrix.
Definition matrix_row_access.h:54
std::enable_if_t< std::is_integral_v< Integer_index > > multiply_target_and_add_to(Integer_index sourceColumnIndex, int coefficient, Integer_index targetColumnIndex)
Multiplies the target column with the coefficient and then adds the source column to it....
Definition Matrix.h:1951
void set_characteristic(Characteristic characteristic)
Sets the characteristic of the coefficient field if PersistenceMatrixOptions::is_z2 is false,...
Definition Matrix.h:1645
Persistence_interval< Dimension, Pos_index > Bar
Definition Matrix.h:179
Dimension get_column_dimension(Index columnIndex) const
Returns the dimension of the given cell. Only available for non-basic matrices.
Definition Matrix.h:1918
void swap_rows(Index rowIndex1, Index rowIndex2)
Only available for base matrices without column compression and simple boundary matrices (only storin...
Definition Matrix.h:2159
Index get_column_with_pivot(ID_index cellIndex) const
Returns the MatIdx index of the column which has the given row index as pivot. Only available for RU ...
Definition Matrix.h:2079
std::conditional_t< RU_rep_cycles_options::has_intrusive_rows, boost::intrusive::list< Matrix_entry, boost::intrusive::constant_time_size< false >, boost::intrusive::base_hook< Base_hook_matrix_row > >, std::set< Matrix_entry, RowEntryComp > > Row
Definition Matrix.h:309
std::enable_if_t< std::is_integral_v< Integer_index > > multiply_source_and_add_to(int coefficient, Integer_index sourceColumnIndex, Integer_index targetColumnIndex)
Multiplies the source column with the coefficient before adding it to the target column....
Definition Matrix.h:1975
static constexpr T get_null_value()
Returns value from a type when not set.
Definition Matrix.h:171
Entry< Matrix< RU_rep_cycles_options > > Matrix_entry
Definition Matrix.h:222
std::enable_if_t<!std::is_integral_v< Entry_range > > multiply_target_and_add_to(const Entry_range &sourceColumn, int coefficient, Index targetColumnIndex)
Multiplies the target column with the coefficient and then adds the given range of Entry to it....
Definition Matrix.h:1960
void update_representative_cycle(const Bar &bar)
Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true....
Definition Matrix.h:2225
void zero_column(Index columnIndex)
Zeroes the column at the given index. Not available for chain matrices and for base matrices with col...
Definition Matrix.h:2019
Index vine_swap(Index columnIndex1, Index columnIndex2)
Only available if PersistenceMatrixOptions::has_vine_update is true and if it is either a chain matri...
Definition Matrix.h:2206
void zero_column(Index columnIndex, bool inR)
Only available for RU matrices. Zeroes the column at the given index in if inR is true or in if inR...
Definition Matrix.h:2028
Insertion_return insert_maximal_cell(Index columnIndex, const Boundary_range &boundary, Dimension dim=Matrix::get_null_value< Dimension >())
Only available for RU and chain matrices and if PersistenceMatrixOptions::has_vine_update is true....
Definition Matrix.h:1748
const Cycle & get_representative_cycle(const Bar &bar) const
Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true....
Definition Matrix.h:2241
Matrix(const Matrix &matrixToCopy)
Copy constructor.
Definition Matrix.h:1624
const Barcode & get_current_barcode()
Returns the current barcode of the matrix. Available only if PersistenceMatrixOptions::has_column_pai...
Definition Matrix.h:2126
void insert_column(ID_index idx, Element e=1U)
Inserts a new column at the end of the matrix. The column will consist of the given index only.
Definition Matrix.h:1691
std::enable_if_t<!std::is_integral_v< Entry_range > > add_to(const Entry_range &sourceColumn, Index targetColumnIndex)
Adds the given range of Entry onto the column at targetColumnIndex in the matrix. Only available for ...
Definition Matrix.h:1937
typename Field_operators::Element Element
Definition Matrix.h:164
const std::vector< Cycle > & get_all_representative_cycles() const
Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true....
Definition Matrix.h:2233
std::enable_if_t<!std::is_integral_v< Entry_range > > multiply_source_and_add_to(int coefficient, const Entry_range &sourceColumn, Index targetColumnIndex)
Multiplies the source column with the coefficient before adding it to the target column....
Definition Matrix.h:1984
Insertion_return insert_maximal_cell(Index columnIndex, ID_index cellIndex, const Boundary_range &boundary, Dimension dim=Matrix::get_null_value< Dimension >())
Only available for RU and chain matrices and if PersistenceMatrixOptions::has_vine_update is true....
Definition Matrix.h:1763
Matrix(unsigned int numberOfColumns, const std::function< bool(Pos_index, Pos_index)> &birthComparator, const std::function< bool(Pos_index, Pos_index)> &deathComparator, Characteristic characteristic=Field_operators::nullCharacteristic)
Constructs a new empty matrix and reserves space for the given number of columns. Only available when...
Definition Matrix.h:1609
ID_index get_pivot(Index columnIndex)
Returns the row index of the pivot of the given column. Only available for non-basic matrices.
Definition Matrix.h:2091
Returned_column & get_column(Index columnIndex)
Returns the column at the given MatIdx index. For RU matrices, is equivalent to get_column(columnInde...
Definition Matrix.h:1779
typename RU_rep_cycles_options::Dimension Dimension
Definition Matrix.h:153
std::conditional_t< hasFixedBarcode, std::vector< Bar >, std::conditional_t< RU_rep_cycles_options::has_removable_columns, std::list< Bar >, std::vector< Bar > > > Barcode
Definition Matrix.h:493
void swap_columns(Index columnIndex1, Index columnIndex2)
Only available for base matrices without column compression and simple boundary matrices (only storin...
Definition Matrix.h:2148
bool is_zero_entry(Index columnIndex, ID_index rowIndex)
Indicates if the entry at given coordinates has value zero.
Definition Matrix.h:2041
typename RU_rep_cycles_options::Index Index
Definition Matrix.h:150
void zero_entry(Index columnIndex, ID_index rowIndex, bool inR)
Only available for RU matrices. Zeroes the entry at the given coordinates in if inR is true or in i...
Definition Matrix.h:2006
Matrix(const std::function< bool(Pos_index, Pos_index)> &birthComparator, const std::function< bool(Pos_index, Pos_index)> &deathComparator)
Constructs a new empty matrix with the given comparator functions. Only available when those comparat...
Definition Matrix.h:1581
void zero_entry(Index columnIndex, ID_index rowIndex)
Zeroes the entry at the given coordinates. Not available for chain matrices and for base matrices wit...
Definition Matrix.h:1997
Insertion_return insert_boundary(const Boundary_range &boundary, Dimension dim=Matrix::get_null_value< Dimension >())
Inserts at the end of the matrix a new ordered column corresponding to the given boundary....
Definition Matrix.h:1709
Returned_row & get_row(ID_index rowIndex)
Only available if PersistenceMatrixOptions::has_row_access is true. Returns the row at the given row ...
Definition Matrix.h:1808
Pool_entry_constructor< Matrix_entry > Entry_constructor
Definition Matrix.h:234
const Column & get_column(Index columnIndex, bool inR)
Only available for RU matrices without Column_indexation_types::IDENTIFIER indexing....
Definition Matrix.h:1793
static New_entry_constructor< Matrix_entry > defaultEntryConstructor
Definition Matrix.h:229
void remove_last()
Removes the last inserted column/cell from the matrix. If the matrix is non basic,...
Definition Matrix.h:1890
Insertion_return insert_boundary(ID_index cellIndex, const Boundary_range &boundary, Dimension dim=Matrix::get_null_value< Dimension >())
Only available for non-basic matrices. It does the same as the other version, but allows the boundary...
Definition Matrix.h:1729
Matrix & operator=(Matrix &&other) &&noexcept
Assign operator.
Definition Matrix.h:2109
bool is_zero_column(Index columnIndex)
Indicates if the column at given index has value zero.
Definition Matrix.h:2060
const Row & get_row(ID_index rowIndex, bool inR)
Only available for RU matrices without Column_indexation_types::IDENTIFIER indexing....
Definition Matrix.h:1826
void erase_empty_row(ID_index rowIndex)
The effect varies depending on the matrices and the options:
Definition Matrix.h:1852
Matrix(Matrix &&other) noexcept
Move constructor. After the move, the given matrix will be empty.
Definition Matrix.h:1631
std::vector< Entry_representative > Cycle
Definition Matrix.h:573
Matrix()
Default constructor. Initializes an empty matrix.
Definition Matrix.h:1548
const Column & get_column(Index columnIndex) const
Only available for chain matrices. Returns the column at the given MatIdx index. The type of the colu...
Definition Matrix.h:1786
bool vine_swap(Pos_index index)
Only available if PersistenceMatrixOptions::has_vine_update is true and if it is either a boundary ma...
Definition Matrix.h:2195
Matrix(unsigned int numberOfColumns, Characteristic characteristic=Field_operators::nullCharacteristic)
Constructs a new empty matrix and reserves space for the given number of columns.
Definition Matrix.h:1570
const Row & get_row(ID_index rowIndex) const
Only available for chain matrices and matrices with column compression. Returns the row at the given ...
Definition Matrix.h:1817
friend void swap(Matrix &matrix1, Matrix &matrix2) noexcept
Swap operator for two matrices.
Definition Matrix.h:1352
std::conditional_t< RU_rep_cycles_options::is_z2, Gudhi::persistence_fields::Z2_field_operators, typename RU_rep_cycles_options::Field_coeff_operators > Field_operators
Definition Matrix.h:158
void remove_column(Index columnIndex)
Only available for base matrices without column compression and if PersistenceMatrixOptions::has_map_...
Definition Matrix.h:1842
bool vine_swap_with_z_eq_1_case(Pos_index index)
Only available if PersistenceMatrixOptions::has_vine_update is true and if it is either a boundary ma...
Definition Matrix.h:2170
std::conditional_t< RU_rep_cycles_options::column_type==Column_types::HEAP, Matrix_heap_column, std::conditional_t< RU_rep_cycles_options::column_type==Column_types::LIST, Matrix_list_column, std::conditional_t< RU_rep_cycles_options::column_type==Column_types::SET, Matrix_set_column, std::conditional_t< RU_rep_cycles_options::column_type==Column_types::UNORDERED_SET, Matrix_unordered_set_column, std::conditional_t< RU_rep_cycles_options::column_type==Column_types::VECTOR, Matrix_vector_column, std::conditional_t< RU_rep_cycles_options::column_type==Column_types::INTRUSIVE_LIST, Matrix_intrusive_list_column, std::conditional_t< RU_rep_cycles_options::column_type==Column_types::NAIVE_VECTOR, Matrix_naive_vector_column, std::conditional_t< RU_rep_cycles_options::column_type==Column_types::SMALL_VECTOR, Matrix_small_vector_column, Matrix_intrusive_set_column > > > > > > > > Column
Definition Matrix.h:359
void insert_column(const Container &column, Index columnIndex)
Inserts a new ordered column at the given index by copying the given range of Entry_representative....
Definition Matrix.h:1675
typename RU_rep_cycles_options::Index ID_index
Definition Matrix.h:151
Index get_number_of_columns() const
Returns the current number of columns in the matrix.
Definition Matrix.h:1912
void update_all_representative_cycles(Dimension dim=get_null_value< Dimension >())
Only available if PersistenceMatrixOptions::can_retrieve_representative_cycles is true....
Definition Matrix.h:2218
Matrix(const std::vector< Container > &columns, Characteristic characteristic=11)
Constructs a new matrix from the given ranges of Entry_representative. Each range corresponds to a co...
Definition Matrix.h:1559
std::conditional_t< RU_rep_cycles_options::is_z2, ID_index, std::pair< ID_index, Element > > Entry_representative
Definition Matrix.h:243
typename RU_rep_cycles_options::Index Pos_index
Definition Matrix.h:152
Dimension get_max_dimension() const
Returns the maximal dimension of a cell stored in the matrix. Only available for non-basic matrices a...
Definition Matrix.h:1904
bool is_zero_entry(Index columnIndex, ID_index rowIndex, bool inR) const
Only available for RU matrices. Indicates if the entry at given coordinates has value zero in if inR...
Definition Matrix.h:2047
std::enable_if_t< std::is_integral_v< Integer_index > > add_to(Integer_index sourceColumnIndex, Integer_index targetColumnIndex)
Adds column at sourceColumnIndex onto the column at targetColumnIndex in the matrix....
Definition Matrix.h:1928
void remove_maximal_cell(ID_index cellIndex, const std::vector< ID_index > &columnsToSwap)
Only available for chain matrices and if PersistenceMatrixOptions::has_removable_columns,...
Definition Matrix.h:1876
const Barcode & get_current_barcode() const
Returns the current barcode of the matrix. Available only if PersistenceMatrixOptions::has_column_pai...
Definition Matrix.h:2134
Matrix(const std::vector< Boundary_range > &orderedBoundaries, const std::function< bool(Pos_index, Pos_index)> &birthComparator, const std::function< bool(Pos_index, Pos_index)> &deathComparator, Characteristic characteristic=11)
Constructs a new matrix from the given ranges with the given comparator functions....
Definition Matrix.h:1594
Index vine_swap_with_z_eq_1_case(Index columnIndex1, Index columnIndex2)
Only available if PersistenceMatrixOptions::has_vine_update is true and if it is either a chain matri...
Definition Matrix.h:2181
void remove_maximal_cell(Index columnIndex)
Only available for RU and chain matrices and if PersistenceMatrixOptions::has_removable_columns and P...
Definition Matrix.h:1862
bool is_zero_column(Index columnIndex, bool inR)
Only available for RU matrices. Indicates if the column at given index has value zero in if inR is t...
Definition Matrix.h:2066
void insert_column(const Container &column)
Inserts a new ordered column at the end of the matrix by copying the given range of Entry_representat...
Definition Matrix.h:1659
Overlay for chain matrices replacing all input and output MatIdx indices of the original methods with...
Definition Position_to_index_overlay.h:43
Class managing the barcode for RU_vine_swap.
Definition ru_vine_swap.h:62
Matrix structure to store the ordered boundary matrix of a filtered complex in order to compute its ...
Definition RU_matrix.h:47
Class managing the barcode for RU_matrix if the option was enabled.
Definition ru_pairing.h:50
Class managing the representative cycles for RU_matrix if the option was enabled.
Definition ru_rep_cycles.h:57
Class managing the vine swaps for RU_matrix.
Definition ru_vine_swap.h:185
Class managing the row access for the columns.
Definition row_access.h:52
Column class following the PersistenceMatrixColumn concept.
Definition set_column.h:51
Column class following the PersistenceMatrixColumn concept.
Definition unordered_set_column.h:68
Column class following the PersistenceMatrixColumn concept.
Definition vector_column.h:54
Contains the Gudhi::persistence_matrix::Column_dimension_holder class and Gudhi::persistence_matrix::...
Contains different versions of Gudhi::persistence_matrix::Entry factories.
Contains the Gudhi::persistence_matrix::Entry, Gudhi::persistence_matrix::Entry_column_index and Gudh...
@ IDENTIFIER
Definition persistence_matrix_options.h:56
@ POSITION
Definition persistence_matrix_options.h:55
@ CONTAINER
Definition persistence_matrix_options.h:54
@ LIST
Definition persistence_matrix_options.h:33
@ INTRUSIVE_SET
Definition persistence_matrix_options.h:44
@ INTRUSIVE_LIST
Definition persistence_matrix_options.h:43
@ UNORDERED_SET
Definition persistence_matrix_options.h:42
@ VECTOR
Definition persistence_matrix_options.h:37
@ SET
Definition persistence_matrix_options.h:34
@ SMALL_VECTOR
Definition persistence_matrix_options.h:40
@ NAIVE_VECTOR
Definition persistence_matrix_options.h:39
@ HEAP
Definition persistence_matrix_options.h:35
Contains the Gudhi::persistence_matrix::Heap_column class. Also defines the std::hash method for Gudh...
Contains the Gudhi::persistence_matrix::Intrusive_list_column class. Also defines the std::hash metho...
Contains the Gudhi::persistence_matrix::Intrusive_set_column class. Also defines the std::hash method...
Contains the Gudhi::persistence_matrix::List_column class. Also defines the std::hash method for Gudh...
Contains the Gudhi::persistence_matrix::Matrix_max_dimension_holder Gudhi::persistence_matrix::Matrix...
Contains the Gudhi::persistence_matrix::Matrix_row_access class and Gudhi::persistence_matrix::Dummy_...
Contains the Gudhi::persistence_matrix::Naive_vector_column class. Also defines the std::hash method ...
Persistence matrix namespace.
Definition FieldOperators.h:18
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14
Contains Gudhi::persistence_matrix::Persistence_interval class.
Contains the options for the matrix template.
Contains the Gudhi::persistence_matrix::Row_access class and Gudhi::persistence_matrix::Dummy_row_acc...
Contains the Gudhi::persistence_matrix::RU_pairing class and Gudhi::persistence_matrix::Dummy_ru_pair...
Contains the Gudhi::persistence_matrix::RU_representative_cycles class and Gudhi::persistence_matrix:...
Contains the Gudhi::persistence_matrix::RU_vine_swap class, as well as the Gudhi::persistence_matrix:...
Contains the Gudhi::persistence_matrix::Set_column class. Also defines the std::hash method for Gudhi...
Empty structure. Inherited instead of Base_pairing, when the computation of the barcode was not enabl...
Definition base_pairing.h:38
Empty structure. Inherited instead of Base_swap, when the column and row swaps are not enabled.
Definition base_swap.h:33
Empty structure. Inherited instead of Chain_pairing, when the computation of the barcode was not enab...
Definition chain_pairing.h:34
Empty structure. Inherited instead of Chain_column_extra_properties, when the columns are not meant f...
Definition chain_column_extra_properties.h:33
Empty structure. Inherited instead of Chain_representative_cycles, when the computation of the repres...
Definition chain_rep_cycles.h:40
Empty structure. Inherited instead of Chain_vine_swap, when vine swaps are not enabled.
Definition chain_vine_swap.h:55
Empty structure. Inherited instead of Column_dimension_holder, when the columns are not storing a dim...
Definition column_dimension_holder.h:32
Empty structure. Inherited instead of Matrix_max_dimension_holder or Matrix_all_dimension_holder,...
Definition matrix_dimension_holders.h:35
Empty structure. Inherited instead of Matrix_row_access, when the the row access is not enabled.
Definition matrix_row_access.h:32
Empty structure. Inherited instead of Row_access, if the row access is not enabled.
Definition row_access.h:32
Empty structure. Inherited instead of RU_pairing, when the computation of the barcode was not enabled...
Definition ru_pairing.h:36
Empty structure. Inherited instead of RU_representative_cycles, when the computation of the represent...
Definition ru_rep_cycles.h:41
Empty structure. Inherited instead of RU_vine_swap, when vine swaps are not enabled.
Definition ru_vine_swap.h:37
Compares two entries by their position in the row. They are assume to be in the same row.
Definition Matrix.h:297
Type for an interval in a persistent diagram or barcode. Stores the birth, death and dimension of the...
Definition persistence_interval.h:40
Concept of the template parameter for the class Matrix.
Definition PersistenceMatrixOptions.h:32
static const Column_indexation_types column_indexation_type
Specifies the desired indexation scheme to access the methods of the matrix. See matrix description a...
Definition PersistenceMatrixOptions.h:66
static const Column_types column_type
Specifies the desired column type. All possible column types are described in Column_types.
Definition PersistenceMatrixOptions.h:60
static const bool has_matrix_maximal_dimension_access
Only enabled for boundary and chain matrices, i.e., when at least one of the following is true: has_c...
Definition PersistenceMatrixOptions.h:142
unspecified Dimension
Type for the dimension. Has to be an integer type. If unsigned, the maximal value of the type should ...
Definition PersistenceMatrixOptions.h:42
static const bool has_map_column_container
If set to true, the underlying container containing the matrix columns is an std::unordered_map....
Definition PersistenceMatrixOptions.h:101
static const bool has_column_compression
Only enabled for base matrices (i.e., none of the following is true: has_column_pairings,...
Definition PersistenceMatrixOptions.h:83
static const bool has_row_access
If set to true, enables the method Matrix::get_row.
Definition PersistenceMatrixOptions.h:111
static const bool can_retrieve_representative_cycles
If set to true, enables the methods Matrix::update_all_representative_cycles and Matrix::get_all_repr...
Definition PersistenceMatrixOptions.h:162
static const bool has_removable_rows
Only enabled if has_row_access is true, ignored otherwise. If set to true, the underlying container c...
Definition PersistenceMatrixOptions.h:124
static const bool has_column_and_row_swaps
Only enabled for base matrices or simple boundary matrices, i.e., when both has_vine_update and can_r...
Definition PersistenceMatrixOptions.h:89
static const bool is_z2
If true, indicates that the values contained in the matrix are in and can therefore be treated like ...
Definition PersistenceMatrixOptions.h:56
unspecified Index
Type for the different indexation types and should be able to contain the maximal number of columns o...
Definition PersistenceMatrixOptions.h:48
static const bool has_column_pairings
If set to true, enables the method Matrix::get_current_barcode. The matrix will then either be a boun...
Definition PersistenceMatrixOptions.h:148
unspecified Field_coeff_operators
Field operators. Has to follow the FieldOperators concept. The type will not be used if is_z2 is set ...
Definition PersistenceMatrixOptions.h:37
static const bool has_vine_update
If set to true, enables the methods Matrix::vine_swap and Matrix::vine_swap_with_z_eq_1_case....
Definition PersistenceMatrixOptions.h:155
static const bool is_of_boundary_type
Only used, when at least one of the following is true: has_column_pairings, has_vine_update or can_re...
Definition PersistenceMatrixOptions.h:132
static const bool has_removable_columns
If set to true, enables the methods Matrix::remove_maximal_cell and Matrix::remove_last,...
Definition PersistenceMatrixOptions.h:106
static const bool has_intrusive_rows
Only enabled if has_row_access is true, ignored otherwise. If set to true, the underlying container r...
Definition PersistenceMatrixOptions.h:117
Contains the Gudhi::persistence_matrix::Unordered_set_column class. Also defines the std::hash method...
Contains the Gudhi::persistence_matrix::Vector_column class. Also defines the std::hash method for Gu...