|
CGAL 6.3-dev - Homological Discrete Vector Fields
|
#include <CGAL/HDVF/Sub_sparse_matrix.h>
CGAL::OSM::Sparse_matrix< CoefficientRing, StorageFormat, OSM::Sparse_chain >.
The class Sub_sparse_matrix is a technical class, deriving from Sparse_matrix together with a system of masks to partially screen matrices (and restrict computations to a subset of indices along their major direction).
This class is used to compute relative homology (and thus to compute persistent homology and Alexander duality).
Sub_sparse_matrix basically adds to Sparse_matrix two bitboards:
SparseMatrix | CoefficientRing | a model of the IntegralDomainWithoutDivision concept, providing the ring used to compute homology. |
| StorageFormat | an integer constant encoding the storage format of matrices (OSM::COLUMN or OSM::ROW). |
| SparseChainType | a model of SparseChain used to store chains of the sparse matrix (default: OSM::Sparse_chain). |
Public Member Functions | |
| Sub_sparse_matrix (size_t rowCount=0, size_t columnCount=0) | |
| Constructor with given rows/columns sizes and mask set to full. | |
| Sub_sparse_matrix (size_t rowCount, size_t columnCount, const Bitboard &subChain) | |
| Constructor with given rows/columns sizes and a mask. | |
| Bitboard::iterator | begin () const noexcept |
| Iterator to the beginning of the indices of non empty chains inside the mask. | |
| Bitboard::iterator | end () const noexcept |
| Iterator past-the-end of the indices of non empty chains inside the mask. | |
| void | set_sub (const Bitboard &new_subChains) |
| Changes the indices subset mask. | |
| void | set_bit_on (size_t index) |
| Adds an index to the mask. | |
| void | set_bit_off (size_t index) |
| Removes an index from the mask. | |
| void | complement () |
| Changes the mask to its complement. | |
Additional Inherited Members | |
| Public Types inherited from CGAL::OSM::Sparse_matrix< CoefficientRing, StorageFormat, OSM::Sparse_chain > | |
| typedef CoefficientRing | Coefficient_ring |
| Type of coefficient ring. | |
| using | Sparse_chain_type |
| Type of sparse chains used in the matrix. | |
| typedef Sparse_chain_type< CoefficientRing, StorageFormat > | Matrix_chain |
| Type of chains associated to the matrix. | |
| Public Attributes inherited from CGAL::OSM::Sparse_matrix< CoefficientRing, StorageFormat, OSM::Sparse_chain > | |
| int | Storage_format |
| Storage format of the matrix. | |
| CGAL::OSM::Sub_sparse_matrix< CoefficientRing, StorageFormat, SparseChainType >::Sub_sparse_matrix | ( | size_t | rowCount = 0, |
| size_t | columnCount = 0 ) |
Constructor with given rows/columns sizes and mask set to full.
Constructor with sizes, initializes an empty Sub_sparse_matrix of a given size along rows/columns. The constructor sets the mask to full.
| rowCount | The number of rows to preallocate (default 0). |
| columnCount | The number of columns to preallocate (default 0). |
| CGAL::OSM::Sub_sparse_matrix< CoefficientRing, StorageFormat, SparseChainType >::Sub_sparse_matrix | ( | size_t | rowCount, |
| size_t | columnCount, | ||
| const Bitboard & | subChain ) |
Constructor with given rows/columns sizes and a mask.
Create a new empty Sub_sparse_matrix of given size along rows/columns and a given mask.
| rowCount | The number of rows to preallocate. |
| columnCount | The number of columns to preallocate. |
| subChain | Bitboard describing the subset of indices considered as a mask. |
| void CGAL::OSM::Sub_sparse_matrix< CoefficientRing, StorageFormat, SparseChainType >::set_bit_off | ( | size_t | index | ) |
Removes an index from the mask.
Set the bit encoding a given index to 0 (ie. remove the index from the mask).
| index | Index to turn off in the mask. |
| void CGAL::OSM::Sub_sparse_matrix< CoefficientRing, StorageFormat, SparseChainType >::set_bit_on | ( | size_t | index | ) |
Adds an index to the mask.
Set the bit encoding a given index to 1 (ie. add the index in the mask).
| index | Index to turn on in the mask. |
| void CGAL::OSM::Sub_sparse_matrix< CoefficientRing, StorageFormat, SparseChainType >::set_sub | ( | const Bitboard & | new_subChains | ) |
Changes the indices subset mask.
Set a new mask encoding a new subset of indices along the major dimension.