Loading [MathJax]/extensions/TeX/AMSsymbols.js
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Gudhi::persistence_matrix::Cell< Master_matrix > Class Template Reference

Matrix cell class. Stores by default only the row index it belongs to, but can also store its column index when the row access is enabled, as well as its value when they are different from only 0 and 1. Zero-valued cells are never explicited in the matrix. More...

Public Types

using Master = Master_matrix
 
using index = typename Master_matrix::index
 
using id_index = typename Master_matrix::id_index
 
using Field_element_type = typename Master_matrix::element_type
 

Public Member Functions

 Cell ()
 Constructs an cell with all attributes at default values.
 
 Cell (id_index rowIndex)
 Constructs a cell with given row index. Other possible attributes are set at default values. More...
 
 Cell (index columnIndex, id_index rowIndex)
 Constructs a cell with given row and column index. Other possible attributes are set at default values. More...
 
 Cell (const Cell &cell)
 Copy constructor. More...
 
 Cell (Cell &&cell) noexcept
 Move constructor. More...
 
id_index get_row_index () const
 Returns the row index stored in the cell. More...
 
void set_row_index (id_index rowIndex)
 Sets the row index stored in the cell. More...
 
Celloperator= (Cell other)
 Assign operator.
 
 operator id_index () const
 Converts the cell into a row index. More...
 
 operator std::pair< id_index, Field_element_type > () const
 Converts the cell into a pair of row index and cell value. More...
 

Friends

bool operator< (const Cell &c1, const Cell &c2)
 Strictly smaller than comparator. More...
 
bool operator== (const Cell &c1, const Cell &c2)
 Equality comparator. More...
 

Detailed Description

template<class Master_matrix>
class Gudhi::persistence_matrix::Cell< Master_matrix >

Matrix cell class. Stores by default only the row index it belongs to, but can also store its column index when the row access is enabled, as well as its value when they are different from only 0 and 1. Zero-valued cells are never explicited in the matrix.

Template Parameters
Master_matrixAn instanciation of Matrix from which all types and options are deduced.

Member Typedef Documentation

◆ Field_element_type

template<class Master_matrix >
using Gudhi::persistence_matrix::Cell< Master_matrix >::Field_element_type = typename Master_matrix::element_type

Value type.

◆ id_index

template<class Master_matrix >
using Gudhi::persistence_matrix::Cell< Master_matrix >::id_index = typename Master_matrix::id_index

Row index type.

◆ index

template<class Master_matrix >
using Gudhi::persistence_matrix::Cell< Master_matrix >::index = typename Master_matrix::index

Column index type.

◆ Master

template<class Master_matrix >
using Gudhi::persistence_matrix::Cell< Master_matrix >::Master = Master_matrix

Access to options from outside.

Constructor & Destructor Documentation

◆ Cell() [1/4]

template<class Master_matrix >
Gudhi::persistence_matrix::Cell< Master_matrix >::Cell ( id_index  rowIndex)
inline

Constructs a cell with given row index. Other possible attributes are set at default values.

Parameters
rowIndexRow index of the cell.

◆ Cell() [2/4]

template<class Master_matrix >
Gudhi::persistence_matrix::Cell< Master_matrix >::Cell ( index  columnIndex,
id_index  rowIndex 
)
inline

Constructs a cell with given row and column index. Other possible attributes are set at default values.

Parameters
columnIndexColumn index of the cell.
rowIndexRow index of the cell.

◆ Cell() [3/4]

template<class Master_matrix >
Gudhi::persistence_matrix::Cell< Master_matrix >::Cell ( const Cell< Master_matrix > &  cell)
inline

Copy constructor.

Parameters
cellCell to copy.

◆ Cell() [4/4]

template<class Master_matrix >
Gudhi::persistence_matrix::Cell< Master_matrix >::Cell ( Cell< Master_matrix > &&  cell)
inlinenoexcept

Move constructor.

Parameters
cellCell to move.

Member Function Documentation

◆ get_row_index()

template<class Master_matrix >
id_index Gudhi::persistence_matrix::Cell< Master_matrix >::get_row_index ( ) const
inline

Returns the row index stored in the cell.

Returns
Row index of the cell.

◆ operator id_index()

template<class Master_matrix >
Gudhi::persistence_matrix::Cell< Master_matrix >::operator id_index ( ) const
inline

Converts the cell into a row index.

Returns
The row index of the cell.

◆ operator std::pair< id_index, Field_element_type >()

template<class Master_matrix >
Gudhi::persistence_matrix::Cell< Master_matrix >::operator std::pair< id_index, Field_element_type > ( ) const
inline

Converts the cell into a pair of row index and cell value.

Returns
A std::pair with first element the row index and second element the value.

◆ set_row_index()

template<class Master_matrix >
void Gudhi::persistence_matrix::Cell< Master_matrix >::set_row_index ( id_index  rowIndex)
inline

Sets the row index stored in the cell.

Parameters
rowIndexRow index of the cell.

Friends And Related Function Documentation

◆ operator<

template<class Master_matrix >
bool operator< ( const Cell< Master_matrix > &  c1,
const Cell< Master_matrix > &  c2 
)
friend

Strictly smaller than comparator.

Parameters
c1First cell to compare.
c2Second cell to compare.
Returns
true If the row index of the first cell is strictly smaller than the row index of the second cell.
false Otherwise.

◆ operator==

template<class Master_matrix >
bool operator== ( const Cell< Master_matrix > &  c1,
const Cell< Master_matrix > &  c2 
)
friend

Equality comparator.

Parameters
c1First cell to compare.
c2Second cell to compare.
Returns
true If the row index of the first cell is equal to the row index of the second cell.
false Otherwise.

The documentation for this class was generated from the following file: