24#include <unordered_map>
29template <
class Master_matrix>
43template <
class Master_matrix>
44class RU_matrix :
public Master_matrix::RU_pairing_option,
45 public Master_matrix::RU_vine_swap_option,
46 public Master_matrix::RU_representative_cycles_option
49 using Pair_opt =
typename Master_matrix::RU_pairing_option;
50 using Swap_opt =
typename Master_matrix::RU_vine_swap_option;
51 using Rep_opt =
typename Master_matrix::RU_representative_cycles_option;
59 using Column =
typename Master_matrix::Column;
60 using Row =
typename Master_matrix::Row;
65 using Boundary =
typename Master_matrix::Boundary;
66 using Index =
typename Master_matrix::Index;
67 using ID_index =
typename Master_matrix::ID_index;
68 using Pos_index =
typename Master_matrix::Pos_index;
69 using Dimension =
typename Master_matrix::Dimension;
98 template <
class Boundary_range = Boundary>
147 template <
class Boundary_range = Boundary>
149 Dimension dim = Master_matrix::template get_null_value<Dimension>());
168 template <
class Boundary_range = Boundary>
170 Dimension dim = Master_matrix::template get_null_value<Dimension>());
188 template <
class Boundary_range = Boundary>
190 const Boundary_range& boundary,
191 Dimension dim = Master_matrix::template get_null_value<Dimension>());
209 template <
class Boundary_range = Boundary>
212 const Boundary_range& boundary,
213 Dimension dim = Master_matrix::template get_null_value<Dimension>());
414 if constexpr (Master_matrix::Option_list::has_column_pairings) Pair_opt::_reset();
415 if constexpr (Master_matrix::Option_list::can_retrieve_representative_cycles) Rep_opt::_reset();
416 reducedMatrixR_.reset(colSettings);
417 mirrorMatrixU_.reset(colSettings);
418 pivotToColumnIndex_.clear();
420 positionToID_.clear();
421 operators_ = Master_matrix::get_operator_ptr(colSettings);
438 swap(
static_cast<Pair_opt&
>(matrix1),
static_cast<Pair_opt&
>(matrix2));
439 swap(
static_cast<Swap_opt&
>(matrix1),
static_cast<Swap_opt&
>(matrix2));
440 swap(
static_cast<Rep_opt&
>(matrix1),
static_cast<Rep_opt&
>(matrix2));
441 swap(matrix1.reducedMatrixR_, matrix2.reducedMatrixR_);
442 swap(matrix1.mirrorMatrixU_, matrix2.mirrorMatrixU_);
443 matrix1.pivotToColumnIndex_.swap(matrix2.pivotToColumnIndex_);
444 std::swap(matrix1.nextEventIndex_, matrix2.nextEventIndex_);
445 matrix1.positionToID_.swap(matrix2.positionToID_);
446 std::swap(matrix1.operators_, matrix2.operators_);
452 using Pivot_dictionary =
typename Master_matrix::template Dictionary<Index>;
453 using Position_dictionary = std::unordered_map<Pos_index, ID_index>;
454 using Barcode =
typename Master_matrix::Barcode;
455 using Bar_dictionary =
typename Master_matrix::Bar_dictionary;
456 using R_matrix =
typename Master_matrix::Master_boundary_matrix;
457 using U_matrix =
typename Master_matrix::Master_base_matrix;
463 R_matrix reducedMatrixR_;
466 U_matrix mirrorMatrixU_;
467 Pivot_dictionary pivotToColumnIndex_;
469 Position_dictionary positionToID_;
473 void _insert_boundary(Index currentIndex);
474 void _initialize_U();
476 void _reduce_last_column(Index lastIndex);
477 void _reduce_column(Index target, Index eventIndex);
478 void _reduce_column_by(Index target, Index source);
479 Index _get_column_with_pivot(
ID_index pivot)
const;
481 void _add_bar(Dimension dim,
Pos_index birth);
482 void _remove_last_in_barcode(
Pos_index eventIndex);
485template <
class Master_matrix>
490 reducedMatrixR_(colSettings),
491 mirrorMatrixU_(colSettings),
493 operators_(Master_matrix::get_operator_ptr(colSettings))
496template <
class Master_matrix>
497template <
class Boundary_range>
503 reducedMatrixR_(orderedBoundaries, colSettings),
504 mirrorMatrixU_(orderedBoundaries.size(), colSettings),
505 nextEventIndex_(orderedBoundaries.size()),
506 operators_(Master_matrix::get_operator_ptr(colSettings))
508 if constexpr (Master_matrix::Option_list::has_map_column_container) {
509 pivotToColumnIndex_.reserve(orderedBoundaries.size());
511 pivotToColumnIndex_.resize(orderedBoundaries.size(), Master_matrix::template get_null_value<Index>());
518template <
class Master_matrix>
523 reducedMatrixR_(numberOfColumns, colSettings),
524 mirrorMatrixU_(numberOfColumns, colSettings),
526 positionToID_(numberOfColumns),
527 operators_(Master_matrix::get_operator_ptr(colSettings))
529 if constexpr (Master_matrix::Option_list::has_map_column_container) {
530 pivotToColumnIndex_.reserve(numberOfColumns);
532 pivotToColumnIndex_.resize(numberOfColumns, Master_matrix::template get_null_value<Index>());
534 if constexpr (Master_matrix::Option_list::has_column_pairings) {
535 Pair_opt::_reserve(numberOfColumns);
539template <
class Master_matrix>
541 : Pair_opt(static_cast<const Pair_opt&>(matrixToCopy)),
542 Swap_opt(static_cast<const Swap_opt&>(matrixToCopy)),
543 Rep_opt(static_cast<const Rep_opt&>(matrixToCopy)),
544 reducedMatrixR_(matrixToCopy.reducedMatrixR_, colSettings),
545 mirrorMatrixU_(matrixToCopy.mirrorMatrixU_, colSettings),
546 pivotToColumnIndex_(matrixToCopy.pivotToColumnIndex_),
547 nextEventIndex_(matrixToCopy.nextEventIndex_),
548 positionToID_(matrixToCopy.positionToID_),
549 operators_(colSettings == nullptr ? matrixToCopy.operators_ : Master_matrix::get_operator_ptr(colSettings))
552template <
class Master_matrix>
554 : Pair_opt(std::move(
static_cast<Pair_opt&
>(other))),
555 Swap_opt(std::move(
static_cast<Swap_opt&
>(other))),
556 Rep_opt(std::move(
static_cast<Rep_opt&
>(other))),
557 reducedMatrixR_(std::move(other.reducedMatrixR_)),
558 mirrorMatrixU_(std::move(other.mirrorMatrixU_)),
559 pivotToColumnIndex_(std::move(other.pivotToColumnIndex_)),
560 nextEventIndex_(std::exchange(other.nextEventIndex_, 0)),
561 positionToID_(std::move(other.positionToID_)),
562 operators_(std::exchange(other.operators_,
nullptr))
565template <
class Master_matrix>
566template <
class Boundary_range>
569 _insert_boundary(reducedMatrixR_.insert_boundary(boundary, dim));
572template <
class Master_matrix>
573template <
class Boundary_range>
577 if (cellIndex != nextEventIndex_) {
578 positionToID_.emplace(nextEventIndex_, cellIndex);
579 if constexpr (Master_matrix::Option_list::has_column_pairings) {
580 Pair_opt::_insert_id_position(cellIndex, nextEventIndex_);
584 _insert_boundary(reducedMatrixR_.insert_boundary(cellIndex, boundary, dim));
587template <
class Master_matrix>
588template <
class Boundary_range>
590 const Boundary_range& boundary,
593 static_assert(Master_matrix::Option_list::has_vine_update,
594 "'insert_maximal_cell' is not implemented for the chosen options.");
596 GUDHI_CHECK(columnIndex >= 0, std::invalid_argument(
"Indices have to be positive."));
604 Swap_opt::vine_swap(curr - 1);
608template <
class Master_matrix>
609template <
class Boundary_range>
612 const Boundary_range& boundary,
615 static_assert(Master_matrix::Option_list::has_vine_update,
616 "'insert_maximal_cell' is not implemented for the chosen options.");
618 GUDHI_CHECK(columnIndex >= 0, std::invalid_argument(
"Indices have to be positive."));
628 Swap_opt::vine_swap(curr - 1);
632template <
class Master_matrix>
636 return reducedMatrixR_.get_column(columnIndex);
638 return mirrorMatrixU_.get_column(columnIndex);
641template <
class Master_matrix>
644 static_assert(Master_matrix::Option_list::has_row_access,
"'get_row' is not implemented for the chosen options.");
647 return reducedMatrixR_.get_row(rowIndex);
649 return mirrorMatrixU_.get_row(rowIndex);
652template <
class Master_matrix>
655 reducedMatrixR_.erase_empty_row(rowIndex);
658template <
class Master_matrix>
661 static_assert(Master_matrix::Option_list::has_removable_columns && Master_matrix::Option_list::has_vine_update,
662 "'remove_maximal_cell' is not implemented for the chosen options.");
666 for (
Index curr = columnIndex; curr < nextEventIndex_ - 1; ++curr) {
667 Swap_opt::vine_swap(curr);
673template <
class Master_matrix>
676 static_assert(Master_matrix::Option_list::has_removable_columns,
677 "'remove_last' is not implemented for the chosen options.");
679 if (nextEventIndex_ == 0)
return;
683 _remove_last_in_barcode(nextEventIndex_);
685 mirrorMatrixU_.remove_last();
686 if constexpr (Master_matrix::Option_list::has_map_column_container) {
687 pivotToColumnIndex_.erase(reducedMatrixR_.remove_last());
689 ID_index lastPivot = reducedMatrixR_.remove_last();
690 if (lastPivot != Master_matrix::template get_null_value<ID_index>())
691 pivotToColumnIndex_[lastPivot] = Master_matrix::template get_null_value<Index>();
696 if constexpr (!Master_matrix::Option_list::has_column_pairings) {
697 positionToID_.erase(nextEventIndex_);
701template <
class Master_matrix>
704 return reducedMatrixR_.get_max_dimension();
707template <
class Master_matrix>
710 return reducedMatrixR_.get_number_of_columns();
713template <
class Master_matrix>
715 Index columnIndex)
const
717 return reducedMatrixR_.get_column_dimension(columnIndex);
720template <
class Master_matrix>
723 reducedMatrixR_.add_to(sourceColumnIndex, targetColumnIndex);
725 if constexpr (Master_matrix::Option_list::is_z2)
726 mirrorMatrixU_.add_to(targetColumnIndex, sourceColumnIndex);
728 mirrorMatrixU_.multiply_source_and_add_to(
729 operators_->get_characteristic() - 1, targetColumnIndex, sourceColumnIndex);
732template <
class Master_matrix>
735 Index targetColumnIndex)
737 reducedMatrixR_.multiply_target_and_add_to(sourceColumnIndex, coefficient, targetColumnIndex);
739 mirrorMatrixU_.get_column(targetColumnIndex) *= coefficient;
740 mirrorMatrixU_.multiply_source_and_add_to(operators_->get_characteristic() - 1, targetColumnIndex, sourceColumnIndex);
743template <
class Master_matrix>
745 Index sourceColumnIndex,
746 Index targetColumnIndex)
748 reducedMatrixR_.multiply_source_and_add_to(coefficient, sourceColumnIndex, targetColumnIndex);
750 if constexpr (Master_matrix::Option_list::is_z2) {
751 if (coefficient) mirrorMatrixU_.add_to(targetColumnIndex, sourceColumnIndex);
753 mirrorMatrixU_.multiply_source_and_add_to(
754 operators_->get_characteristic() - coefficient, targetColumnIndex, sourceColumnIndex);
758template <
class Master_matrix>
762 return reducedMatrixR_.zero_entry(columnIndex, rowIndex);
764 return mirrorMatrixU_.zero_entry(columnIndex, rowIndex);
767template <
class Master_matrix>
771 return reducedMatrixR_.zero_column(columnIndex);
773 return mirrorMatrixU_.zero_column(columnIndex);
776template <
class Master_matrix>
780 return reducedMatrixR_.is_zero_entry(columnIndex, rowIndex);
782 return mirrorMatrixU_.is_zero_entry(columnIndex, rowIndex);
785template <
class Master_matrix>
789 return reducedMatrixR_.is_zero_column(columnIndex);
791 return mirrorMatrixU_.is_zero_column(columnIndex);
794template <
class Master_matrix>
797 if constexpr (Master_matrix::Option_list::has_map_column_container) {
798 return pivotToColumnIndex_.at(cellIndex);
800 return pivotToColumnIndex_[cellIndex];
804template <
class Master_matrix>
807 return reducedMatrixR_.get_column(columnIndex).get_pivot();
810template <
class Master_matrix>
813 if (
this == &other)
return *
this;
815 Swap_opt::operator=(other);
816 Pair_opt::operator=(other);
817 Rep_opt::operator=(other);
818 reducedMatrixR_ = other.reducedMatrixR_;
819 mirrorMatrixU_ = other.mirrorMatrixU_;
820 pivotToColumnIndex_ = other.pivotToColumnIndex_;
821 nextEventIndex_ = other.nextEventIndex_;
822 positionToID_ = other.positionToID_;
823 operators_ = other.operators_;
828template <
class Master_matrix>
831 if (
this == &other)
return *
this;
833 Pair_opt::operator=(std::move(other));
834 Swap_opt::operator=(std::move(other));
835 Rep_opt::operator=(std::move(other));
837 reducedMatrixR_ = std::move(other.reducedMatrixR_);
838 mirrorMatrixU_ = std::move(other.mirrorMatrixU_);
839 pivotToColumnIndex_ = std::move(other.pivotToColumnIndex_);
840 nextEventIndex_ = std::exchange(other.nextEventIndex_, 0);
841 positionToID_ = std::move(other.positionToID_);
842 operators_ = std::exchange(other.operators_,
nullptr);
845template <
class Master_matrix>
846inline void RU_matrix<Master_matrix>::print()
848 std::cout <<
"R_matrix:\n";
849 reducedMatrixR_.print();
850 std::cout <<
"U_matrix:\n";
851 mirrorMatrixU_.print();
854template <
class Master_matrix>
855inline void RU_matrix<Master_matrix>::_insert_boundary(Index currentIndex)
857 mirrorMatrixU_.insert_column(currentIndex, 1);
859 if constexpr (!Master_matrix::Option_list::has_map_column_container) {
860 ID_index pivot = reducedMatrixR_.get_column(currentIndex).get_pivot();
861 if (pivot != Master_matrix::template get_null_value<ID_index>() && pivotToColumnIndex_.size() <= pivot)
862 pivotToColumnIndex_.resize((pivot + 1) * 2, Master_matrix::template get_null_value<Index>());
865 _reduce_last_column(currentIndex);
869template <
class Master_matrix>
872 for (ID_index i = 0; i < reducedMatrixR_.get_number_of_columns(); i++) {
873 mirrorMatrixU_.insert_column(i, 1);
877template <
class Master_matrix>
880 if constexpr (Master_matrix::Option_list::has_column_pairings) {
881 Pair_opt::_reserve(reducedMatrixR_.get_number_of_columns());
884 for (Index i = 0; i < reducedMatrixR_.get_number_of_columns(); i++) {
885 if (!(reducedMatrixR_.is_zero_column(i))) {
886 _reduce_column(i, i);
888 _add_bar(get_column_dimension(i), i);
893template <
class Master_matrix>
896 if (reducedMatrixR_.get_column(lastIndex).is_empty()) {
897 _add_bar(get_column_dimension(lastIndex), nextEventIndex_);
901 _reduce_column(lastIndex, nextEventIndex_);
904template <
class Master_matrix>
907 Column& curr = reducedMatrixR_.
get_column(target);
908 ID_index pivot = curr.get_pivot();
909 Index currIndex = _get_column_with_pivot(pivot);
911 while (pivot != Master_matrix::template get_null_value<ID_index>() &&
912 currIndex != Master_matrix::template get_null_value<Index>()) {
913 _reduce_column_by(target, currIndex);
914 pivot = curr.get_pivot();
915 currIndex = _get_column_with_pivot(pivot);
918 if (pivot != Master_matrix::template get_null_value<ID_index>()) {
919 if constexpr (Master_matrix::Option_list::has_map_column_container) {
920 pivotToColumnIndex_.try_emplace(pivot, target);
922 pivotToColumnIndex_[pivot] = target;
924 _update_barcode(pivot, eventIndex);
926 _add_bar(get_column_dimension(target), eventIndex);
930template <
class Master_matrix>
933 Column& curr = reducedMatrixR_.
get_column(target);
934 if constexpr (Master_matrix::Option_list::is_z2) {
935 curr += reducedMatrixR_.get_column(source);
938 mirrorMatrixU_.get_column(source).push_back(*mirrorMatrixU_.get_column(target).begin());
940 Column& toadd = reducedMatrixR_.get_column(source);
941 Field_element coef = toadd.get_pivot_value();
942 coef = operators_->get_inverse(coef);
943 operators_->multiply_inplace(coef, operators_->get_characteristic() - curr.get_pivot_value());
945 curr.multiply_source_and_add(toadd, coef);
946 auto entry = *mirrorMatrixU_.get_column(target).begin();
947 operators_->multiply_inplace(entry.get_element(), operators_->get_characteristic() - coef);
950 mirrorMatrixU_.get_column(source).push_back(entry);
954template <
class Master_matrix>
957 if (pivot == Master_matrix::template get_null_value<ID_index>())
958 return Master_matrix::template get_null_value<Index>();
959 if constexpr (Master_matrix::Option_list::has_map_column_container) {
960 auto it = pivotToColumnIndex_.find(pivot);
961 if (it == pivotToColumnIndex_.end())
return Master_matrix::template get_null_value<Index>();
964 if (pivot >= pivotToColumnIndex_.size())
return Master_matrix::template get_null_value<Index>();
965 return pivotToColumnIndex_[pivot];
969template <
class Master_matrix>
972 if constexpr (Master_matrix::Option_list::has_column_pairings) {
973 Pair_opt::_update_barcode(birthPivot, death);
977template <
class Master_matrix>
980 if constexpr (Master_matrix::Option_list::has_column_pairings) {
981 Pair_opt::_add_bar(dim, birth);
985template <
class Master_matrix>
988 if constexpr (Master_matrix::Option_list::has_column_pairings) {
989 Pair_opt::_remove_last(eventIndex);
std::enable_if_t< std::is_integral_v< Integer_index > > multiply_target_and_add_to(Integer_index sourceColumnIndex, int coefficient, Integer_index targetColumnIndex)
Dimension get_column_dimension(Index columnIndex) const
Index get_column_with_pivot(ID_index cellIndex) const
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)
void zero_column(Index columnIndex)
Insertion_return insert_maximal_cell(Index columnIndex, const Boundary_range &boundary, Dimension dim=Matrix::get_null_value< Dimension >())
ID_index get_pivot(Index columnIndex)
Returned_column & get_column(Index columnIndex)
typename RU_rep_cycles_options::Dimension Dimension
Definition Matrix.h:153
bool is_zero_entry(Index columnIndex, ID_index rowIndex)
typename RU_rep_cycles_options::Index Index
Definition Matrix.h:150
Matrix & operator=(Matrix other) &
void zero_entry(Index columnIndex, ID_index rowIndex)
Insertion_return insert_boundary(const Boundary_range &boundary, Dimension dim=Matrix::get_null_value< Dimension >())
Returned_row & get_row(ID_index rowIndex)
bool is_zero_column(Index columnIndex)
void erase_empty_row(ID_index rowIndex)
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
Index get_number_of_columns() const
Dimension get_max_dimension() const
std::enable_if_t< std::is_integral_v< Integer_index > > add_to(Integer_index sourceColumnIndex, Integer_index targetColumnIndex)
void remove_maximal_cell(Index columnIndex)
Matrix structure to store the ordered boundary matrix of a filtered complex in order to compute its ...
Definition RU_matrix.h:47
RU_matrix(const std::vector< Boundary_range > &orderedBoundaries, Column_settings *colSettings)
Constructs a new matrix from the given ranges of Matrix::Entry_representative. Each range corresponds...
Definition RU_matrix.h:498
void remove_maximal_cell(Index columnIndex)
Only available if PersistenceMatrixOptions::has_removable_columns and PersistenceMatrixOptions::has_v...
Definition RU_matrix.h:659
bool is_zero_column(Index columnIndex, bool inR=true)
Indicates if the column at given index has value zero in if inR is true or in if inR is false.
Definition RU_matrix.h:786
typename Matrix< PersistenceMatrixOptions >::ID_index ID_index
Definition RU_matrix.h:67
void insert_maximal_cell(Index columnIndex, const Boundary_range &boundary, Dimension dim=Master_matrix::template get_null_value< Dimension >())
Only available if PersistenceMatrixOptions::has_vine_update is true. Assumes that the cell will be ma...
Definition RU_matrix.h:589
void add_to(Index sourceColumnIndex, Index targetColumnIndex)
Adds column at sourceColumnIndex onto the column at targetColumnIndex in the matrix.
Definition RU_matrix.h:721
bool is_zero_entry(Index columnIndex, Index rowIndex, bool inR=true) const
Indicates if the entry at given coordinates has value zero in if inR is true or in if inR is false.
Definition RU_matrix.h:777
void remove_last()
Only available if PersistenceMatrixOptions::has_removable_columns is true. Removes the last cell in t...
Definition RU_matrix.h:674
void insert_boundary(ID_index cellIndex, const Boundary_range &boundary, Dimension dim=Master_matrix::template get_null_value< Dimension >())
It does the same as the other version, but allows the boundary cells to be identified without restric...
Definition RU_matrix.h:574
typename Matrix< PersistenceMatrixOptions >::Element Field_element
Definition RU_matrix.h:58
Index get_column_with_pivot(Index cellIndex) const
Returns the MatIdx index of the column which has the given row index as pivot in ....
Definition RU_matrix.h:795
RU_matrix(RU_matrix &&other) noexcept
Move constructor.
Definition RU_matrix.h:553
typename Matrix< PersistenceMatrixOptions >::Pos_index Pos_index
Definition RU_matrix.h:68
void multiply_source_and_add_to(const Field_element &coefficient, Index sourceColumnIndex, Index targetColumnIndex)
Multiplies the source column with the coefficient before adding it to the target column....
Definition RU_matrix.h:744
typename Matrix< PersistenceMatrixOptions >::Entry_constructor Entry_constructor
Definition RU_matrix.h:62
RU_matrix(Column_settings *colSettings)
Constructs an empty matrix.
Definition RU_matrix.h:486
void erase_empty_row(Index rowIndex)
If PersistenceMatrixOptions::has_row_access and PersistenceMatrixOptions::has_removable_rows are true...
Definition RU_matrix.h:653
void zero_column(Index columnIndex, bool inR=true)
Zeroes the column at the given index in if inR is true or in if inR is false. Should be used with c...
Definition RU_matrix.h:768
typename Matrix< PersistenceMatrixOptions >::Row Row
Definition RU_matrix.h:60
void insert_maximal_cell(Index columnIndex, ID_index cellIndex, const Boundary_range &boundary, Dimension dim=Master_matrix::template get_null_value< Dimension >())
Only available if PersistenceMatrixOptions::has_vine_update is true. It does the same as the other ve...
Definition RU_matrix.h:610
typename Matrix< PersistenceMatrixOptions >::Field_operators Field_operators
Definition RU_matrix.h:57
Dimension get_max_dimension() const
Returns the maximal dimension of a cell stored in the matrix. Only available if PersistenceMatrixOpti...
Definition RU_matrix.h:702
RU_matrix & operator=(RU_matrix &&other) noexcept
Move assign operator.
Definition RU_matrix.h:829
typename Matrix< PersistenceMatrixOptions >::Column Column
Definition RU_matrix.h:59
void zero_entry(Index columnIndex, Index rowIndex, bool inR=true)
Zeroes the entry at the given coordinates in if inR is true or in if inR is false....
Definition RU_matrix.h:759
typename Matrix< PersistenceMatrixOptions >::Index Index
Definition RU_matrix.h:66
typename Matrix< PersistenceMatrixOptions >::Boundary Boundary
Definition RU_matrix.h:65
Index get_pivot(Index columnIndex)
Returns the row index of the pivot of the given column in .
Definition RU_matrix.h:805
RU_matrix(unsigned int numberOfColumns, Column_settings *colSettings)
Constructs a new empty matrix and reserves space for the given number of columns.
Definition RU_matrix.h:519
typename Matrix< PersistenceMatrixOptions >::Dimension Dimension
Definition RU_matrix.h:69
RU_matrix(const RU_matrix &matrixToCopy, Column_settings *colSettings=nullptr)
Copy constructor. If colSettings is not a null pointer, its value is kept instead of the one in the c...
Definition RU_matrix.h:540
void reset(Column_settings *colSettings)
Resets the matrix to an empty matrix.
Definition RU_matrix.h:412
Dimension get_column_dimension(Index columnIndex) const
Returns the dimension of the given column.
Definition RU_matrix.h:714
Index get_number_of_columns() const
Returns the current number of columns in the matrix.
Definition RU_matrix.h:708
void insert_boundary(const Boundary_range &boundary, Dimension dim=Master_matrix::template get_null_value< Dimension >())
Inserts at the end of the matrix a new ordered column corresponding to the given boundary....
Definition RU_matrix.h:567
Column & get_column(Index columnIndex, bool inR=true)
Returns the column at the given MatIdx index in if inR is true and in if inR is false....
Definition RU_matrix.h:633
friend void swap(RU_matrix &matrix1, RU_matrix &matrix2) noexcept
Swap operator.
Definition RU_matrix.h:436
void multiply_target_and_add_to(Index sourceColumnIndex, const Field_element &coefficient, Index targetColumnIndex)
Multiplies the target column with the coefficient and then adds the source column to it....
Definition RU_matrix.h:733
RU_matrix & operator=(const RU_matrix &other)
Assign operator.
Definition RU_matrix.h:811
typename Matrix< PersistenceMatrixOptions >::Column_settings Column_settings
Definition RU_matrix.h:63
Row & get_row(Index rowIndex, bool inR=true)
Returns the row at the given row index in if inR is true and in if inR is false....
Definition RU_matrix.h:642
Class managing the barcode for RU_matrix if the option was enabled.
Definition ru_pairing.h:50
Persistence matrix namespace.
Definition FieldOperators.h:18
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14