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>
146 template <
class Boundary_range = Boundary>
148 Dimension dim = Master_matrix::template get_null_value<Dimension>());
166 template <
class Boundary_range = Boundary>
168 Dimension dim = Master_matrix::template get_null_value<Dimension>());
188 template <
class Boundary_range = Boundary>
190 Dimension dim = Master_matrix::template get_null_value<Dimension>());
390 if constexpr (Master_matrix::Option_list::has_column_pairings) Pair_opt::_reset();
391 if constexpr (Master_matrix::Option_list::can_retrieve_representative_cycles) Rep_opt::_reset();
392 reducedMatrixR_.reset(colSettings);
393 mirrorMatrixU_.reset(colSettings);
394 pivotToColumnIndex_.clear();
396 positionToID_.clear();
397 operators_ = Master_matrix::get_operator_ptr(colSettings);
414 swap(
static_cast<Pair_opt&
>(matrix1),
static_cast<Pair_opt&
>(matrix2));
415 swap(
static_cast<Swap_opt&
>(matrix1),
static_cast<Swap_opt&
>(matrix2));
416 swap(
static_cast<Rep_opt&
>(matrix1),
static_cast<Rep_opt&
>(matrix2));
417 swap(matrix1.reducedMatrixR_, matrix2.reducedMatrixR_);
418 swap(matrix1.mirrorMatrixU_, matrix2.mirrorMatrixU_);
419 matrix1.pivotToColumnIndex_.swap(matrix2.pivotToColumnIndex_);
420 std::swap(matrix1.nextEventIndex_, matrix2.nextEventIndex_);
421 matrix1.positionToID_.swap(matrix2.positionToID_);
422 std::swap(matrix1.operators_, matrix2.operators_);
428 using Pivot_dictionary =
typename Master_matrix::template Dictionary<Index>;
429 using Position_dictionary = std::unordered_map<Pos_index, ID_index>;
430 using Barcode =
typename Master_matrix::Barcode;
431 using Bar_dictionary =
typename Master_matrix::Bar_dictionary;
432 using R_matrix =
typename Master_matrix::Master_boundary_matrix;
433 using U_matrix =
typename Master_matrix::Master_base_matrix;
439 R_matrix reducedMatrixR_;
442 U_matrix mirrorMatrixU_;
443 Pivot_dictionary pivotToColumnIndex_;
445 Position_dictionary positionToID_;
449 void _insert_boundary(Index currentIndex);
450 void _initialize_U();
452 void _reduce_last_column(Index lastIndex);
453 void _reduce_column(Index target, Index eventIndex);
454 void _reduce_column_by(Index target, Index source);
455 Index _get_column_with_pivot(
ID_index pivot)
const;
457 void _add_bar(Dimension dim,
Pos_index birth);
458 void _remove_last_in_barcode(
Pos_index eventIndex);
461template <
class Master_matrix>
466 reducedMatrixR_(colSettings),
467 mirrorMatrixU_(colSettings),
469 operators_(Master_matrix::get_operator_ptr(colSettings))
472template <
class Master_matrix>
473template <
class Boundary_range>
479 reducedMatrixR_(orderedBoundaries, colSettings),
480 mirrorMatrixU_(orderedBoundaries.size(), colSettings),
481 nextEventIndex_(orderedBoundaries.size()),
482 operators_(Master_matrix::get_operator_ptr(colSettings))
484 if constexpr (Master_matrix::Option_list::has_map_column_container) {
485 pivotToColumnIndex_.reserve(orderedBoundaries.size());
487 pivotToColumnIndex_.resize(orderedBoundaries.size(), Master_matrix::template get_null_value<Index>());
494template <
class Master_matrix>
499 reducedMatrixR_(numberOfColumns, colSettings),
500 mirrorMatrixU_(numberOfColumns, colSettings),
502 positionToID_(numberOfColumns),
503 operators_(Master_matrix::get_operator_ptr(colSettings))
505 if constexpr (Master_matrix::Option_list::has_map_column_container) {
506 pivotToColumnIndex_.reserve(numberOfColumns);
508 pivotToColumnIndex_.resize(numberOfColumns, Master_matrix::template get_null_value<Index>());
510 if constexpr (Master_matrix::Option_list::has_column_pairings) {
511 Pair_opt::_reserve(numberOfColumns);
515template <
class Master_matrix>
517 : Pair_opt(static_cast<const Pair_opt&>(matrixToCopy)),
518 Swap_opt(static_cast<const Swap_opt&>(matrixToCopy)),
519 Rep_opt(static_cast<const Rep_opt&>(matrixToCopy)),
520 reducedMatrixR_(matrixToCopy.reducedMatrixR_, colSettings),
521 mirrorMatrixU_(matrixToCopy.mirrorMatrixU_, colSettings),
522 pivotToColumnIndex_(matrixToCopy.pivotToColumnIndex_),
523 nextEventIndex_(matrixToCopy.nextEventIndex_),
524 positionToID_(matrixToCopy.positionToID_),
525 operators_(colSettings == nullptr ? matrixToCopy.operators_ : Master_matrix::get_operator_ptr(colSettings))
528template <
class Master_matrix>
530 : Pair_opt(std::move(
static_cast<Pair_opt&
>(other))),
531 Swap_opt(std::move(
static_cast<Swap_opt&
>(other))),
532 Rep_opt(std::move(
static_cast<Rep_opt&
>(other))),
533 reducedMatrixR_(std::move(other.reducedMatrixR_)),
534 mirrorMatrixU_(std::move(other.mirrorMatrixU_)),
535 pivotToColumnIndex_(std::move(other.pivotToColumnIndex_)),
536 nextEventIndex_(std::exchange(other.nextEventIndex_, 0)),
537 positionToID_(std::move(other.positionToID_)),
538 operators_(std::exchange(other.operators_,
nullptr))
541template <
class Master_matrix>
542template <
class Boundary_range>
545 _insert_boundary(reducedMatrixR_.insert_boundary(boundary, dim));
548template <
class Master_matrix>
549template <
class Boundary_range>
553 if (cellIndex != nextEventIndex_) {
554 positionToID_.emplace(nextEventIndex_, cellIndex);
555 if constexpr (Master_matrix::Option_list::has_column_pairings) {
556 Pair_opt::_insert_id_position(cellIndex, nextEventIndex_);
560 _insert_boundary(reducedMatrixR_.insert_boundary(cellIndex, boundary, dim));
563template <
class Master_matrix>
564template <
class Boundary_range>
567 static_assert(Master_matrix::Option_list::has_vine_update,
568 "'insert_maximal_cell' is not implemented for the chosen options.");
576 Swap_opt::vine_swap(curr - 1);
580template <
class Master_matrix>
584 return reducedMatrixR_.get_column(columnIndex);
586 return mirrorMatrixU_.get_column(columnIndex);
589template <
class Master_matrix>
592 static_assert(Master_matrix::Option_list::has_row_access,
"'get_row' is not implemented for the chosen options.");
595 return reducedMatrixR_.get_row(rowIndex);
597 return mirrorMatrixU_.get_row(rowIndex);
600template <
class Master_matrix>
603 reducedMatrixR_.erase_empty_row(rowIndex);
606template <
class Master_matrix>
609 static_assert(Master_matrix::Option_list::has_removable_columns && Master_matrix::Option_list::has_vine_update,
610 "'remove_maximal_cell' is not implemented for the chosen options.");
614 for (
Index curr = columnIndex; curr < nextEventIndex_ - 1; ++curr) {
615 Swap_opt::vine_swap(curr);
621template <
class Master_matrix>
624 static_assert(Master_matrix::Option_list::has_removable_columns,
625 "'remove_last' is not implemented for the chosen options.");
627 if (nextEventIndex_ == 0)
return;
631 _remove_last_in_barcode(nextEventIndex_);
633 mirrorMatrixU_.remove_last();
634 if constexpr (Master_matrix::Option_list::has_map_column_container) {
635 pivotToColumnIndex_.erase(reducedMatrixR_.remove_last());
637 ID_index lastPivot = reducedMatrixR_.remove_last();
638 if (lastPivot != Master_matrix::template get_null_value<ID_index>())
639 pivotToColumnIndex_[lastPivot] = Master_matrix::template get_null_value<Index>();
644 if constexpr (!Master_matrix::Option_list::has_column_pairings) {
645 positionToID_.erase(nextEventIndex_);
649template <
class Master_matrix>
652 return reducedMatrixR_.get_max_dimension();
655template <
class Master_matrix>
658 return reducedMatrixR_.get_number_of_columns();
661template <
class Master_matrix>
663 Index columnIndex)
const
665 return reducedMatrixR_.get_column_dimension(columnIndex);
668template <
class Master_matrix>
671 reducedMatrixR_.add_to(sourceColumnIndex, targetColumnIndex);
673 if constexpr (Master_matrix::Option_list::is_z2)
674 mirrorMatrixU_.add_to(targetColumnIndex, sourceColumnIndex);
676 mirrorMatrixU_.multiply_source_and_add_to(
677 operators_->get_characteristic() - 1, targetColumnIndex, sourceColumnIndex);
680template <
class Master_matrix>
683 Index targetColumnIndex)
685 reducedMatrixR_.multiply_target_and_add_to(sourceColumnIndex, coefficient, targetColumnIndex);
687 mirrorMatrixU_.get_column(targetColumnIndex) *= coefficient;
688 mirrorMatrixU_.multiply_source_and_add_to(operators_->get_characteristic() - 1, targetColumnIndex, sourceColumnIndex);
691template <
class Master_matrix>
693 Index sourceColumnIndex,
694 Index targetColumnIndex)
696 reducedMatrixR_.multiply_source_and_add_to(coefficient, sourceColumnIndex, targetColumnIndex);
698 if constexpr (Master_matrix::Option_list::is_z2) {
699 if (coefficient) mirrorMatrixU_.add_to(targetColumnIndex, sourceColumnIndex);
701 mirrorMatrixU_.multiply_source_and_add_to(
702 operators_->get_characteristic() - coefficient, targetColumnIndex, sourceColumnIndex);
706template <
class Master_matrix>
710 return reducedMatrixR_.zero_entry(columnIndex, rowIndex);
712 return mirrorMatrixU_.zero_entry(columnIndex, rowIndex);
715template <
class Master_matrix>
719 return reducedMatrixR_.zero_column(columnIndex);
721 return mirrorMatrixU_.zero_column(columnIndex);
724template <
class Master_matrix>
728 return reducedMatrixR_.is_zero_entry(columnIndex, rowIndex);
730 return mirrorMatrixU_.is_zero_entry(columnIndex, rowIndex);
733template <
class Master_matrix>
737 return reducedMatrixR_.is_zero_column(columnIndex);
739 return mirrorMatrixU_.is_zero_column(columnIndex);
742template <
class Master_matrix>
745 if constexpr (Master_matrix::Option_list::has_map_column_container) {
746 return pivotToColumnIndex_.at(cellIndex);
748 return pivotToColumnIndex_[cellIndex];
752template <
class Master_matrix>
755 return reducedMatrixR_.get_column(columnIndex).get_pivot();
758template <
class Master_matrix>
761 if (
this == &other)
return *
this;
763 Swap_opt::operator=(other);
764 Pair_opt::operator=(other);
765 Rep_opt::operator=(other);
766 reducedMatrixR_ = other.reducedMatrixR_;
767 mirrorMatrixU_ = other.mirrorMatrixU_;
768 pivotToColumnIndex_ = other.pivotToColumnIndex_;
769 nextEventIndex_ = other.nextEventIndex_;
770 positionToID_ = other.positionToID_;
771 operators_ = other.operators_;
776template <
class Master_matrix>
779 if (
this == &other)
return *
this;
781 Pair_opt::operator=(std::move(other));
782 Swap_opt::operator=(std::move(other));
783 Rep_opt::operator=(std::move(other));
785 reducedMatrixR_ = std::move(other.reducedMatrixR_);
786 mirrorMatrixU_ = std::move(other.mirrorMatrixU_);
787 pivotToColumnIndex_ = std::move(other.pivotToColumnIndex_);
788 nextEventIndex_ = std::exchange(other.nextEventIndex_, 0);
789 positionToID_ = std::move(other.positionToID_);
790 operators_ = std::exchange(other.operators_,
nullptr);
793template <
class Master_matrix>
794inline void RU_matrix<Master_matrix>::print()
796 std::cout <<
"R_matrix:\n";
797 reducedMatrixR_.print();
798 std::cout <<
"U_matrix:\n";
799 mirrorMatrixU_.print();
802template <
class Master_matrix>
803inline void RU_matrix<Master_matrix>::_insert_boundary(Index currentIndex)
805 mirrorMatrixU_.insert_column(currentIndex, 1);
807 if constexpr (!Master_matrix::Option_list::has_map_column_container) {
808 ID_index pivot = reducedMatrixR_.get_column(currentIndex).get_pivot();
809 if (pivot != Master_matrix::template get_null_value<ID_index>() && pivotToColumnIndex_.size() <= pivot)
810 pivotToColumnIndex_.resize((pivot + 1) * 2, Master_matrix::template get_null_value<Index>());
813 _reduce_last_column(currentIndex);
817template <
class Master_matrix>
820 for (ID_index i = 0; i < reducedMatrixR_.get_number_of_columns(); i++) {
821 mirrorMatrixU_.insert_column(i, 1);
825template <
class Master_matrix>
828 if constexpr (Master_matrix::Option_list::has_column_pairings) {
829 Pair_opt::_reserve(reducedMatrixR_.get_number_of_columns());
832 for (Index i = 0; i < reducedMatrixR_.get_number_of_columns(); i++) {
833 if (!(reducedMatrixR_.is_zero_column(i))) {
834 _reduce_column(i, i);
836 _add_bar(get_column_dimension(i), i);
841template <
class Master_matrix>
844 if (reducedMatrixR_.get_column(lastIndex).is_empty()) {
845 _add_bar(get_column_dimension(lastIndex), nextEventIndex_);
849 _reduce_column(lastIndex, nextEventIndex_);
852template <
class Master_matrix>
855 Column& curr = reducedMatrixR_.
get_column(target);
856 ID_index pivot = curr.get_pivot();
857 Index currIndex = _get_column_with_pivot(pivot);
859 while (pivot != Master_matrix::template get_null_value<ID_index>() &&
860 currIndex != Master_matrix::template get_null_value<Index>()) {
861 _reduce_column_by(target, currIndex);
862 pivot = curr.get_pivot();
863 currIndex = _get_column_with_pivot(pivot);
866 if (pivot != Master_matrix::template get_null_value<ID_index>()) {
867 if constexpr (Master_matrix::Option_list::has_map_column_container) {
868 pivotToColumnIndex_.try_emplace(pivot, target);
870 pivotToColumnIndex_[pivot] = target;
872 _update_barcode(pivot, eventIndex);
874 _add_bar(get_column_dimension(target), eventIndex);
878template <
class Master_matrix>
881 Column& curr = reducedMatrixR_.
get_column(target);
882 if constexpr (Master_matrix::Option_list::is_z2) {
883 curr += reducedMatrixR_.get_column(source);
886 mirrorMatrixU_.get_column(source).push_back(*mirrorMatrixU_.get_column(target).begin());
888 Column& toadd = reducedMatrixR_.get_column(source);
889 Field_element coef = toadd.get_pivot_value();
890 coef = operators_->get_inverse(coef);
891 operators_->multiply_inplace(coef, operators_->get_characteristic() - curr.get_pivot_value());
893 curr.multiply_source_and_add(toadd, coef);
894 auto entry = *mirrorMatrixU_.get_column(target).begin();
895 operators_->multiply_inplace(entry.get_element(), operators_->get_characteristic() - coef);
898 mirrorMatrixU_.get_column(source).push_back(entry);
902template <
class Master_matrix>
905 if (pivot == Master_matrix::template get_null_value<ID_index>())
906 return Master_matrix::template get_null_value<Index>();
907 if constexpr (Master_matrix::Option_list::has_map_column_container) {
908 auto it = pivotToColumnIndex_.find(pivot);
909 if (it == pivotToColumnIndex_.end())
return Master_matrix::template get_null_value<Index>();
912 if (pivot >= pivotToColumnIndex_.size())
return Master_matrix::template get_null_value<Index>();
913 return pivotToColumnIndex_[pivot];
917template <
class Master_matrix>
920 if constexpr (Master_matrix::Option_list::has_column_pairings) {
921 Pair_opt::_update_barcode(birthPivot, death);
925template <
class Master_matrix>
928 if constexpr (Master_matrix::Option_list::has_column_pairings) {
929 Pair_opt::_add_bar(dim, birth);
933template <
class Master_matrix>
936 if constexpr (Master_matrix::Option_list::has_column_pairings) {
937 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)
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)
void insert_maximal_cell(Index columnIndex, const Boundary_range &boundary, Dimension dim=Matrix::get_null_value< Dimension >())
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:474
void remove_maximal_cell(Index columnIndex)
Only available if PersistenceMatrixOptions::has_removable_columns and PersistenceMatrixOptions::has_v...
Definition RU_matrix.h:607
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:734
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:565
void add_to(Index sourceColumnIndex, Index targetColumnIndex)
Adds column at sourceColumnIndex onto the column at targetColumnIndex in the matrix.
Definition RU_matrix.h:669
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:725
void remove_last()
Only available if PersistenceMatrixOptions::has_removable_columns is true. Removes the last cell in t...
Definition RU_matrix.h:622
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:550
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:743
RU_matrix(RU_matrix &&other) noexcept
Move constructor.
Definition RU_matrix.h:529
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:692
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:462
void erase_empty_row(Index rowIndex)
If PersistenceMatrixOptions::has_row_access and PersistenceMatrixOptions::has_removable_rows are true...
Definition RU_matrix.h:601
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:716
typename Matrix< PersistenceMatrixOptions >::Row Row
Definition RU_matrix.h:60
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:650
RU_matrix & operator=(RU_matrix &&other) noexcept
Move assign operator.
Definition RU_matrix.h:777
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:707
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:753
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:495
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:516
void reset(Column_settings *colSettings)
Resets the matrix to an empty matrix.
Definition RU_matrix.h:388
Dimension get_column_dimension(Index columnIndex) const
Returns the dimension of the given column.
Definition RU_matrix.h:662
Index get_number_of_columns() const
Returns the current number of columns in the matrix.
Definition RU_matrix.h:656
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:543
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:581
friend void swap(RU_matrix &matrix1, RU_matrix &matrix2) noexcept
Swap operator.
Definition RU_matrix.h:412
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:681
RU_matrix & operator=(const RU_matrix &other)
Assign operator.
Definition RU_matrix.h:759
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:590
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