Base_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-24 Inria
6 *
7 * Modification(s):
8 * - YYYY/MM Author: Description of the modification
9 */
10
17#ifndef PM_BASE_MATRIX_H
18#define PM_BASE_MATRIX_H
19
20#include <iostream> //print() only
21#include <vector>
22#include <utility> //std::swap, std::move & std::exchange
23
24namespace Gudhi {
25namespace persistence_matrix {
26
36template <class Master_matrix>
37class Base_matrix : public Master_matrix::template Base_swap_option<Base_matrix<Master_matrix> >,
38 protected Master_matrix::Matrix_row_access_option
39{
40 public:
41 using Index = typename Master_matrix::Index;
42 using Dimension = typename Master_matrix::Dimension;
46 using Field_operators = typename Master_matrix::Field_operators;
47 using Field_element = typename Master_matrix::Element;
48 using Column = typename Master_matrix::Column;
49 using Boundary = typename Master_matrix::Boundary;
50 using Row = typename Master_matrix::Row;
52 using Entry_constructor = typename Master_matrix::Entry_constructor;
53 using Column_settings = typename Master_matrix::Column_settings;
62 Base_matrix(Column_settings* colSettings);
73 template <class Container = Boundary>
74 Base_matrix(const std::vector<Container>& columns,
75 Column_settings* colSettings);
83 Base_matrix(unsigned int numberOfColumns, Column_settings* colSettings);
93 Base_matrix(const Base_matrix& matrixToCopy,
94 Column_settings* colSettings = nullptr);
100 Base_matrix(Base_matrix&& other) noexcept;
101
110 template <class Container = Boundary>
111 void insert_column(const Container& column);
124 template <class Container = Boundary>
125 void insert_column(const Container& column, Index columnIndex);
135 template <class Boundary_range>
136 void insert_boundary(const Boundary_range& boundary,
137 Dimension dim = Master_matrix::template get_null_value<Dimension>());
149 Column& get_column(Index columnIndex);
162 Row& get_row(Index rowIndex);
176 void remove_column(Index columnIndex);
193 void remove_last();
209 void erase_empty_row(Index rowIndex);
210
217
226 template <class Entry_range_or_column_index>
227 void add_to(const Entry_range_or_column_index& sourceColumn, Index targetColumnIndex);
238 template <class Entry_range_or_column_index>
239 void multiply_target_and_add_to(const Entry_range_or_column_index& sourceColumn,
240 const Field_element& coefficient,
241 Index targetColumnIndex);
252 template <class Entry_range_or_column_index>
253 void multiply_source_and_add_to(const Field_element& coefficient,
254 const Entry_range_or_column_index& sourceColumn,
255 Index targetColumnIndex);
256
263 void zero_entry(Index columnIndex, Index rowIndex);
269 void zero_column(Index columnIndex);
278 bool is_zero_entry(Index columnIndex, Index rowIndex) const;
286 bool is_zero_column(Index columnIndex);
287
294 void reset(Column_settings* colSettings) {
295 matrix_.clear();
296 nextInsertIndex_ = 0;
297 colSettings_ = colSettings;
298 }
299
303 Base_matrix& operator=(const Base_matrix& other);
307 friend void swap(Base_matrix& matrix1, Base_matrix& matrix2) {
308 swap(static_cast<typename Master_matrix::template Base_swap_option<Base_matrix<Master_matrix> >&>(matrix1),
309 static_cast<typename Master_matrix::template Base_swap_option<Base_matrix<Master_matrix> >&>(matrix2));
310 matrix1.matrix_.swap(matrix2.matrix_);
311 std::swap(matrix1.nextInsertIndex_, matrix2.nextInsertIndex_);
312 std::swap(matrix1.colSettings_, matrix2.colSettings_);
313
315 swap(static_cast<typename Master_matrix::Matrix_row_access_option&>(matrix1),
316 static_cast<typename Master_matrix::Matrix_row_access_option&>(matrix2));
317 }
318 }
319
320 void print(); // for debug
321
322 private:
323 using Swap_opt = typename Master_matrix::template Base_swap_option<Base_matrix<Master_matrix> >;
324 using RA_opt = typename Master_matrix::Matrix_row_access_option;
325 using Column_container = typename Master_matrix::Column_container;
326 using Entry_representative =
327 typename std::conditional<Master_matrix::Option_list::is_z2,
328 Index,
329 std::pair<Index, Field_element>
330 >::type;
331
332 friend Swap_opt; // direct access to matrix_ to avoid row reorder.
333
334 Column_container matrix_;
335 Index nextInsertIndex_;
336 Column_settings* colSettings_;
338 template <class Container = Boundary>
339 void _insert(const Container& column, Index columnIndex, Dimension dim);
340 void _orderRowsIfNecessary();
341 const Column& _get_column(Index columnIndex) const;
342 Column& _get_column(Index columnIndex);
343 Index _get_real_row_index(Index rowIndex) const;
344 template <class Container>
345 void _container_insert(const Container& column, Index pos, Dimension dim);
346 void _container_insert(const Column& column, [[maybe_unused]] Index pos = 0);
347};
348
349template <class Master_matrix>
351 : Swap_opt(), RA_opt(), nextInsertIndex_(0), colSettings_(colSettings)
352{}
353
354template <class Master_matrix>
355template <class Container>
356inline Base_matrix<Master_matrix>::Base_matrix(const std::vector<Container>& columns,
357 Column_settings* colSettings)
358 : Swap_opt(columns.size()),
359 // not ideal if max row index is much smaller than max column index, does that happen often?
360 RA_opt(columns.size()),
361 matrix_(!Master_matrix::Option_list::has_map_column_container && Master_matrix::Option_list::has_row_access
362 ? 0
363 : columns.size()),
364 nextInsertIndex_(columns.size()),
365 colSettings_(colSettings)
366{
368 matrix_.reserve(columns.size());
369
370 for (Index i = 0; i < columns.size(); i++) {
371 _container_insert(columns[i], i, columns[i].size() == 0 ? 0 : columns[i].size() - 1);
372 }
373}
374
375template <class Master_matrix>
376inline Base_matrix<Master_matrix>::Base_matrix(unsigned int numberOfColumns,
377 Column_settings* colSettings)
378 : Swap_opt(numberOfColumns),
379 RA_opt(numberOfColumns),
380 matrix_(!Master_matrix::Option_list::has_map_column_container && Master_matrix::Option_list::has_row_access
381 ? 0
382 : numberOfColumns),
383 nextInsertIndex_(0),
384 colSettings_(colSettings)
385{
387 matrix_.reserve(numberOfColumns);
388}
389
390template <class Master_matrix>
392 Column_settings* colSettings)
393 : Swap_opt(static_cast<const Swap_opt&>(matrixToCopy)),
394 RA_opt(static_cast<const RA_opt&>(matrixToCopy)),
395 nextInsertIndex_(matrixToCopy.nextInsertIndex_),
396 colSettings_(colSettings == nullptr ? matrixToCopy.colSettings_ : colSettings)
397{
398 matrix_.reserve(matrixToCopy.matrix_.size());
399 for (const auto& cont : matrixToCopy.matrix_){
401 _container_insert(cont.second, cont.first);
402 } else {
403 _container_insert(cont);
404 }
405 }
406}
407
408template <class Master_matrix>
410 : Swap_opt(std::move(static_cast<Swap_opt&>(other))),
411 RA_opt(std::move(static_cast<RA_opt&>(other))),
412 matrix_(std::move(other.matrix_)),
413 nextInsertIndex_(std::exchange(other.nextInsertIndex_, 0)),
414 colSettings_(std::exchange(other.colSettings_, nullptr))
415{}
416
417template <class Master_matrix>
418template <class Container>
419inline void Base_matrix<Master_matrix>::insert_column(const Container& column)
420{
421 //TODO: dim not actually stored right now, so either get rid of it or store it again
422 _insert(column, nextInsertIndex_, column.size() == 0 ? 0 : column.size() - 1);
423 ++nextInsertIndex_;
424}
425
426template <class Master_matrix>
427template <class Container>
428inline void Base_matrix<Master_matrix>::insert_column(const Container& column, Index columnIndex)
429{
430 static_assert(!Master_matrix::Option_list::has_row_access,
431 "Columns have to be inserted at the end of the matrix when row access is enabled.");
432
433 if (columnIndex >= nextInsertIndex_) nextInsertIndex_ = columnIndex + 1;
434 //TODO: dim not actually stored right now, so either get rid of it or store it again
435 _insert(column, columnIndex, column.size() == 0 ? 0 : column.size() - 1);
436}
437
438template <class Master_matrix>
439template <class Boundary_range>
440inline void Base_matrix<Master_matrix>::insert_boundary(const Boundary_range& boundary, Dimension dim)
441{
442 if (dim == Master_matrix::template get_null_value<Dimension>()) dim = boundary.size() == 0 ? 0 : boundary.size() - 1;
443 //TODO: dim not actually stored right now, so either get rid of it or store it again
444 _insert(boundary, nextInsertIndex_++, dim);
445}
446
447template <class Master_matrix>
449{
450 _orderRowsIfNecessary();
451 return _get_column(columnIndex);
452}
453
454template <class Master_matrix>
456{
457 static_assert(Master_matrix::Option_list::has_row_access, "Row access has to be enabled for this method.");
458
459 _orderRowsIfNecessary();
460 return RA_opt::get_row(rowIndex);
461}
462
463template <class Master_matrix>
465{
466 static_assert(Master_matrix::Option_list::has_map_column_container,
467 "'remove_column' is not implemented for the chosen options.");
468
469 // assumes that eventual "holes" left at unused indices are considered as empty columns.
470 if (columnIndex == nextInsertIndex_ - 1) --nextInsertIndex_;
471
472 matrix_.erase(columnIndex);
473}
474
475template <class Master_matrix>
477{
478 if (nextInsertIndex_ == 0) return; //empty matrix
479 --nextInsertIndex_; // assumes that eventual "holes" left at unused indices are considered as empty columns.
480
481 if constexpr (Master_matrix::Option_list::has_map_column_container) {
482 matrix_.erase(nextInsertIndex_);
483 } else {
484 if constexpr (Master_matrix::Option_list::has_row_access) {
485 GUDHI_CHECK(nextInsertIndex_ == matrix_.size() - 1,
486 std::logic_error("Base_matrix::remove_last - Indexation problem."));
487 matrix_.pop_back();
488 } else {
489 matrix_[nextInsertIndex_].clear();
490 }
491 }
492}
493
494template <class Master_matrix>
496{
497 if constexpr (Master_matrix::Option_list::has_row_access && Master_matrix::Option_list::has_removable_rows) {
498 RA_opt::erase_empty_row(_get_real_row_index(rowIndex));
499 }
500 if constexpr ((Master_matrix::Option_list::has_column_and_row_swaps || Master_matrix::Option_list::has_vine_update) &&
501 Master_matrix::Option_list::has_map_column_container) {
502 auto it = Swap_opt::indexToRow_.find(rowIndex);
503 Swap_opt::rowToIndex_.erase(it->second);
504 Swap_opt::indexToRow_.erase(it);
505 }
506}
507
508template <class Master_matrix>
510{
511 if constexpr (Master_matrix::Option_list::has_map_column_container) {
512 return matrix_.size();
513 } else {
514 return nextInsertIndex_; // matrix could have been resized much bigger while insert
515 }
516}
517
518template <class Master_matrix>
519template <class Entry_range_or_column_index>
520inline void Base_matrix<Master_matrix>::add_to(const Entry_range_or_column_index& sourceColumn,
521 Index targetColumnIndex)
522{
523 if constexpr (std::is_integral_v<Entry_range_or_column_index>) {
524 _get_column(targetColumnIndex) += _get_column(sourceColumn);
525 } else {
526 _get_column(targetColumnIndex) += sourceColumn;
527 }
528}
529
530template <class Master_matrix>
531template <class Entry_range_or_column_index>
532inline void Base_matrix<Master_matrix>::multiply_target_and_add_to(const Entry_range_or_column_index& sourceColumn,
533 const Field_element& coefficient,
534 Index targetColumnIndex)
535{
536 if constexpr (std::is_integral_v<Entry_range_or_column_index>) {
537 _get_column(targetColumnIndex).multiply_target_and_add(coefficient, _get_column(sourceColumn));
538 } else {
539 _get_column(targetColumnIndex).multiply_target_and_add(coefficient, sourceColumn);
540 }
541}
542
543template <class Master_matrix>
544template <class Entry_range_or_column_index>
546 const Entry_range_or_column_index& sourceColumn,
547 Index targetColumnIndex)
548{
549 if constexpr (std::is_integral_v<Entry_range_or_column_index>) {
550 _get_column(targetColumnIndex).multiply_source_and_add(_get_column(sourceColumn), coefficient);
551 } else {
552 _get_column(targetColumnIndex).multiply_source_and_add(sourceColumn, coefficient);
553 }
554}
555
556template <class Master_matrix>
557inline void Base_matrix<Master_matrix>::zero_entry(Index columnIndex, Index rowIndex)
558{
559 _get_column(columnIndex).clear(_get_real_row_index(rowIndex));
560}
561
562template <class Master_matrix>
564 _get_column(columnIndex).clear();
565}
566
567template <class Master_matrix>
568inline bool Base_matrix<Master_matrix>::is_zero_entry(Index columnIndex, Index rowIndex) const
569{
570 return !(_get_column(columnIndex).is_non_zero(_get_real_row_index(rowIndex)));
571}
572
573template <class Master_matrix>
575{
576 return _get_column(columnIndex).is_empty();
577}
578
579template <class Master_matrix>
581{
582 Swap_opt::operator=(other);
583 RA_opt::operator=(other);
584 matrix_.clear();
585 nextInsertIndex_ = other.nextInsertIndex_;
586 colSettings_ = other.colSettings_;
587
588 matrix_.reserve(other.matrix_.size());
589 for (const auto& cont : other.matrix_){
590 if constexpr (Master_matrix::Option_list::has_map_column_container){
591 _container_insert(cont.second, cont.first);
592 } else {
593 _container_insert(cont);
594 }
595 }
596
597 return *this;
598}
599
600template <class Master_matrix>
602{
603 _orderRowsIfNecessary();
604 std::cout << "Base_matrix:\n";
605 for (Index i = 0; i < nextInsertIndex_; ++i) {
606 const Column& col = matrix_[i];
607 for (const auto& e : col.get_content(nextInsertIndex_)) {
608 if (e == 0u)
609 std::cout << "- ";
610 else
611 std::cout << e << " ";
612 }
613 std::cout << "\n";
614 }
615 std::cout << "\n";
616 if constexpr (Master_matrix::Option_list::has_row_access) {
617 std::cout << "Row Matrix:\n";
618 for (Index i = 0; i < nextInsertIndex_; ++i) {
619 const auto& row = (*RA_opt::rows_)[i];
620 for (const auto& entry : row) {
621 std::cout << entry.get_column_index() << " ";
622 }
623 std::cout << "(" << i << ")\n";
624 }
625 std::cout << "\n";
626 }
627}
628
629template <class Master_matrix>
630template <class Container>
631inline void Base_matrix<Master_matrix>::_insert(const Container& column, Index columnIndex, Dimension dim)
632{
633 _orderRowsIfNecessary();
634
635 //resize of containers when necessary:
636 Index pivot = 0;
637 if (column.begin() != column.end()) {
638 //first, compute pivot of `column`
639 if constexpr (Master_matrix::Option_list::is_z2) {
640 pivot = *std::prev(column.end());
641 } else {
642 pivot = std::prev(column.end())->first;
643 }
644 //row container
645 if constexpr (Master_matrix::Option_list::has_row_access && !Master_matrix::Option_list::has_removable_rows)
646 if (RA_opt::rows_->size() <= pivot) RA_opt::rows_->resize(pivot + 1);
647 }
648
649 //row swap map containers
650 if constexpr (Master_matrix::Option_list::has_map_column_container) {
651 if constexpr (Master_matrix::Option_list::has_column_and_row_swaps || Master_matrix::Option_list::has_vine_update) {
652 for (auto id : column) {
653 Index idx;
654 if constexpr (Master_matrix::Option_list::is_z2) {
655 idx = id;
656 } else {
657 idx = id.first;
658 }
659 Swap_opt::indexToRow_[idx] = idx;
660 Swap_opt::rowToIndex_[idx] = idx;
661 }
662 }
663 } else {
664 if constexpr (Master_matrix::Option_list::has_column_and_row_swaps || Master_matrix::Option_list::has_vine_update) {
665 Index size = Swap_opt::indexToRow_.size();
666 if (size <= pivot) {
667 for (Index i = size; i <= pivot; i++) {
668 Swap_opt::indexToRow_.push_back(i);
669 Swap_opt::rowToIndex_.push_back(i);
670 }
671 }
672 }
673 //column container
674 if constexpr (!Master_matrix::Option_list::has_row_access) {
675 if (matrix_.size() <= columnIndex) {
676 matrix_.resize(columnIndex + 1);
677 }
678 }
679 }
680
681 _container_insert(column, columnIndex, dim);
682}
683
684template <class Master_matrix>
686{
687 if constexpr (Master_matrix::Option_list::has_column_and_row_swaps || Master_matrix::Option_list::has_vine_update) {
688 if (Swap_opt::rowSwapped_) Swap_opt::_orderRows();
689 }
690}
691
692template <class Master_matrix>
694 Index columnIndex) const
695{
696 if constexpr (Master_matrix::Option_list::has_map_column_container) {
697 return matrix_.at(columnIndex);
698 } else {
699 return matrix_[columnIndex];
700 }
701}
702
703template <class Master_matrix>
705{
706 if constexpr (Master_matrix::Option_list::has_map_column_container) {
707 return matrix_.at(columnIndex);
708 } else {
709 return matrix_[columnIndex];
710 }
711}
712
713template <class Master_matrix>
715{
716 if constexpr (Master_matrix::Option_list::has_column_and_row_swaps || Master_matrix::Option_list::has_vine_update) {
717 if constexpr (Master_matrix::Option_list::has_map_column_container) {
718 return Swap_opt::indexToRow_.at(rowIndex);
719 } else {
720 return Swap_opt::indexToRow_[rowIndex];
721 }
722 } else {
723 return rowIndex;
724 }
725}
726
727template <class Master_matrix>
728template <class Container>
729inline void Base_matrix<Master_matrix>::_container_insert(const Container& column, Index pos, Dimension dim){
730 if constexpr (Master_matrix::Option_list::has_map_column_container) {
731 if constexpr (Master_matrix::Option_list::has_row_access) {
732 matrix_.try_emplace(pos, Column(pos, column, dim, RA_opt::rows_, colSettings_));
733 } else {
734 matrix_.try_emplace(pos, Column(column, dim, colSettings_));
735 }
736 } else {
737 if constexpr (Master_matrix::Option_list::has_row_access) {
738 matrix_.emplace_back(pos, column, dim, RA_opt::rows_, colSettings_);
739 } else {
740 matrix_[pos] = Column(column, dim, colSettings_);
741 }
742 }
743}
744
745template <class Master_matrix>
746inline void Base_matrix<Master_matrix>::_container_insert(const Column& column, [[maybe_unused]] Index pos){
747 if constexpr (Master_matrix::Option_list::has_map_column_container) {
748 if constexpr (Master_matrix::Option_list::has_row_access) {
749 matrix_.try_emplace(pos, Column(column, column.get_column_index(), RA_opt::rows_, colSettings_));
750 } else {
751 matrix_.try_emplace(pos, Column(column, colSettings_));
752 }
753 } else {
754 if constexpr (Master_matrix::Option_list::has_row_access) {
755 matrix_.emplace_back(column, column.get_column_index(), RA_opt::rows_, colSettings_);
756 } else {
757 matrix_.emplace_back(column, colSettings_);
758 }
759 }
760}
761
762} // namespace persistence_matrix
763} // namespace Gudhi
764
765#endif // PM_BASE_MATRIX_H
A basic matrix structure allowing to easily manipulate and access entire columns and rows,...
Definition: Base_matrix.h:39
Column & get_column(Index columnIndex)
Returns the column at the given MatIdx index. The type of the column depends on the chosen options,...
Definition: Base_matrix.h:448
bool is_zero_entry(Index columnIndex, Index rowIndex) const
Indicates if the entry at given coordinates has value zero.
Definition: Base_matrix.h:568
void add_to(const Entry_range_or_column_index &sourceColumn, Index targetColumnIndex)
Adds column represented by sourceColumn onto the column at targetColumnIndex in the matrix.
Definition: Base_matrix.h:520
friend void swap(Base_matrix &matrix1, Base_matrix &matrix2)
Swap operator.
Definition: Base_matrix.h:307
typename Master_matrix::Row Row
Definition: Base_matrix.h:51
Index get_number_of_columns() const
Returns the current number of columns in the matrix.
Definition: Base_matrix.h:509
void zero_column(Index columnIndex)
Zeroes the column at the given index.
Definition: Base_matrix.h:563
bool is_zero_column(Index columnIndex)
Indicates if the column at given index has value zero.
Definition: Base_matrix.h:574
typename Master_matrix::Element Field_element
Definition: Base_matrix.h:47
Row & get_row(Index rowIndex)
Only available if PersistenceMatrixOptions::has_row_access is true. Returns the row at the given row ...
Definition: Base_matrix.h:455
void insert_boundary(const Boundary_range &boundary, Dimension dim=Master_matrix::template get_null_value< Dimension >())
Same as insert_column, only for interface purposes. The given dimension is ignored and not stored.
Definition: Base_matrix.h:440
void reset(Column_settings *colSettings)
Resets the matrix to an empty matrix.
Definition: Base_matrix.h:294
Base_matrix & operator=(const Base_matrix &other)
Assign operator.
Definition: Base_matrix.h:580
typename Master_matrix::Field_operators Field_operators
Field operators class. Necessary only if PersistenceMatrixOptions::is_z2 is false.
Definition: Base_matrix.h:46
typename Master_matrix::Column Column
Definition: Base_matrix.h:48
void remove_last()
Removes the last column from the matrix. The last column is at index , where:
Definition: Base_matrix.h:476
typename Master_matrix::Column_settings Column_settings
Definition: Base_matrix.h:54
typename Master_matrix::Dimension Dimension
Definition: Base_matrix.h:42
typename Master_matrix::Index Index
Definition: Base_matrix.h:41
Base_matrix(Column_settings *colSettings)
Constructs an empty matrix.
Definition: Base_matrix.h:350
typename Master_matrix::Entry_constructor Entry_constructor
Definition: Base_matrix.h:52
void remove_column(Index columnIndex)
Only available if PersistenceMatrixOptions::has_map_column_container is true. Otherwise,...
Definition: Base_matrix.h:464
typename Master_matrix::Boundary Boundary
Definition: Base_matrix.h:49
void multiply_source_and_add_to(const Field_element &coefficient, const Entry_range_or_column_index &sourceColumn, Index targetColumnIndex)
Multiplies the source column with the coefficient before adding it to the target column....
Definition: Base_matrix.h:545
void zero_entry(Index columnIndex, Index rowIndex)
Zeroes the entry at the given coordinates.
Definition: Base_matrix.h:557
void insert_column(const Container &column)
Inserts a new ordered column at the end of the matrix by copying the given range of Matrix::Entry_rep...
Definition: Base_matrix.h:419
void erase_empty_row(Index rowIndex)
If PersistenceMatrixOptions::has_row_access and PersistenceMatrixOptions::has_removable_rows are true...
Definition: Base_matrix.h:495
void multiply_target_and_add_to(const Entry_range_or_column_index &sourceColumn, const Field_element &coefficient, Index targetColumnIndex)
Multiplies the target column with the coefficient and then adds the source column to it....
Definition: Base_matrix.h:532
Data structure for matrices, and in particular thought for matrices representing filtered complexes i...
Definition: Matrix.h:144
typename PersistenceMatrixOptions::Index Index
Definition: Matrix.h:147
typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::HEAP, Matrix_heap_column, typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::LIST, Matrix_list_column, typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::SET, Matrix_set_column, typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::UNORDERED_SET, Matrix_unordered_set_column, typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::VECTOR, Matrix_vector_column, typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::INTRUSIVE_LIST, Matrix_intrusive_list_column, typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::NAIVE_VECTOR, Matrix_naive_vector_column, typename std::conditional< PersistenceMatrixOptions::column_type==Column_types::SMALL_VECTOR, Matrix_small_vector_column, Matrix_intrusive_set_column >::type >::type >::type >::type >::type >::type >::type >::type Column
Type of the columns stored in the matrix. The type depends on the value of PersistenceMatrixOptions::...
Definition: Matrix.h:368
typename std::conditional< PersistenceMatrixOptions::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 > >::type Row
Type of the rows stored in the matrix. Is either an intrusive list of Matrix_entry (not ordered) if P...
Definition: Matrix.h:274
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
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_row_access
If set to true, enables the method Matrix::get_row.
Definition: PersistenceMatrixOptions.h:111
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