CGAL 6.2 - Homological Discrete Vector Fields
Loading...
Searching...
No Matches
CGAL::OSM Namespace Reference

Classes

class  Bitboard
 The class Bitboard implements an accelerating structure, derived from the chess community. More...
 
class  Sparse_chain
 The class Sparse_chain implements the concept SparseChain, that is, sparse vectors (encoding homological chains) optimized for topological computations. More...
 
class  Sparse_matrix
 The class Sparse_matrix implements the concept SparseMatrix, that is, sparse matrices optimized for topological computations. More...
 
class  Sub_sparse_matrix
 The class Sub_sparse_matrix is a technical class implementing the concept SparseMatrix together with a system of masks to partially screen matrices (and restrict computations to a subset of indices along their major direction). More...
 

Typedefs

typedef int ZCoefficient
 The default type for signed integers.
 

Functions

template<typename _CT >
Sparse_matrix< _CT, COLUMNoperator* (const Sparse_chain< _CT, COLUMN > &column, const Sparse_chain< _CT, ROW > &row)
 
template<typename _CT >
Sparse_matrix< _CT, ROWoperator% (const Sparse_chain< _CT, COLUMN > &column, const Sparse_chain< _CT, ROW > &row)
 
template<typename CoefficientRing >
CoefficientRing operator* (const Sparse_chain< CoefficientRing, ROW > &row, const Sparse_chain< CoefficientRing, COLUMN > &column)
 
template<typename _CT >
bool operator== (const Sparse_chain< _CT, OSM::COLUMN > &chain, const Sparse_chain< _CT, OSM::COLUMN > &other)
 
template<typename _CT >
bool operator== (const Sparse_chain< _CT, OSM::ROW > &chain, const Sparse_chain< _CT, OSM::ROW > &other)
 
template<typename _CT >
bool operator== (const Sparse_chain< _CT, OSM::COLUMN > &chain, const Sparse_chain< _CT, OSM::ROW > &other)
 
template<typename _CT >
bool operator== (const Sparse_chain< _CT, OSM::ROW > &chain, const Sparse_chain< _CT, OSM::COLUMN > &other)
 
template<typename _CT , int _CTF>
Sparse_chain< _CT, _CTF > operator* (const Sparse_chain< _CT, _CTF > &chain, const _CT &lambda)
 
template<typename _CT , int _CTF>
Sparse_matrix< _CT, _CTF > operator* (const Sparse_matrix< _CT, _CTF > &matrix, const _CT &lambda)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMNoperator* (const Sparse_matrix< _CT, COLUMN > &first, const Sparse_matrix< _CT, COLUMN > &second)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMNoperator* (const Sparse_matrix< _CT, ROW > &first, const Sparse_matrix< _CT, COLUMN > &second)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMNoperator* (const Sparse_matrix< _CT, COLUMN > &first, const Sparse_matrix< _CT, ROW > &second)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMNoperator* (const Sparse_matrix< _CT, ROW > &first, const Sparse_matrix< _CT, ROW > &second)
 
template<typename _CT >
Sparse_chain< _CT, COLUMNoperator* (const Sparse_matrix< _CT, COLUMN > &first, const Sparse_chain< _CT, COLUMN > &second)
 
template<typename _CT >
Sparse_chain< _CT, COLUMNoperator* (const Sparse_matrix< _CT, ROW > &first, const Sparse_chain< _CT, COLUMN > &second)
 
template<typename _CT >
Sparse_chain< _CT, ROWoperator* (const Sparse_chain< _CT, ROW > &first, const Sparse_matrix< _CT, ROW > &second)
 
template<typename _CT >
Sparse_chain< _CT, ROWoperator* (const Sparse_chain< _CT, ROW > &first, const Sparse_matrix< _CT, COLUMN > &second)
 
template<typename _CT >
Sparse_matrix< _CT, ROWoperator% (const Sparse_matrix< _CT, COLUMN > &first, const Sparse_matrix< _CT, COLUMN > &second)
 
template<typename _CT >
Sparse_matrix< _CT, ROWoperator% (const Sparse_matrix< _CT, ROW > &first, const Sparse_matrix< _CT, COLUMN > &second)
 
template<typename _CT >
Sparse_matrix< _CT, ROWoperator% (const Sparse_matrix< _CT, COLUMN > &first, const Sparse_matrix< _CT, ROW > &second)
 
template<typename _CT >
Sparse_matrix< _CT, ROWoperator% (const Sparse_matrix< _CT, ROW > &first, const Sparse_matrix< _CT, ROW > &second)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMN > & operator+= (Sparse_matrix< _CT, COLUMN > &matrix, const Sparse_matrix< _CT, ROW > &other)
 
template<typename _CT >
Sparse_matrix< _CT, ROW > & operator+= (Sparse_matrix< _CT, ROW > &matrix, const Sparse_matrix< _CT, COLUMN > &other)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMN > & operator-= (Sparse_matrix< _CT, COLUMN > &matrix, const Sparse_matrix< _CT, ROW > &other)
 
template<typename _CT >
Sparse_matrix< _CT, ROW > & operator-= (Sparse_matrix< _CT, ROW > &matrix, const Sparse_matrix< _CT, COLUMN > &other)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMN > & operator*= (Sparse_matrix< _CT, COLUMN > &matrix, const Sparse_matrix< _CT, COLUMN > &other)
 
template<typename _CT >
Sparse_matrix< _CT, ROW > & operator*= (Sparse_matrix< _CT, ROW > &matrix, const Sparse_matrix< _CT, ROW > &other)
 
template<typename _CT >
Sparse_matrix< _CT, COLUMN > & operator*= (Sparse_matrix< _CT, COLUMN > &matrix, const Sparse_matrix< _CT, ROW > &other)
 
template<typename _CT >
Sparse_matrix< _CT, ROW > & operator*= (Sparse_matrix< _CT, ROW > &matrix, const Sparse_matrix< _CT, COLUMN > &other)
 
template<typename _CT >
Sparse_chain< _CT, COLUMNget_column (const Sparse_matrix< _CT, COLUMN > &matrix, size_t index)
 
template<typename _CT >
Sparse_chain< _CT, COLUMNget_column (const Sparse_matrix< _CT, ROW > &matrix, size_t index)
 
template<typename _CT >
Sparse_chain< _CT, ROWget_row (const Sparse_matrix< _CT, COLUMN > &matrix, size_t index)
 
template<typename _CT >
Sparse_chain< _CT, ROWget_row (const Sparse_matrix< _CT, ROW > &matrix, size_t index)
 
template<typename _CT >
const Sparse_chain< _CT, COLUMN > & cget_column (const Sparse_matrix< _CT, COLUMN > &matrix, size_t index)
 
template<typename _CT >
const Sparse_chain< _CT, ROW > & cget_row (const Sparse_matrix< _CT, ROW > &matrix, const size_t index)
 
template<typename _CT >
void set_column (Sparse_matrix< _CT, COLUMN > &matrix, size_t index, const Sparse_chain< _CT, COLUMN > &chain)
 
template<typename _CT >
void set_column (Sparse_matrix< _CT, ROW > &matrix, size_t index, const Sparse_chain< _CT, COLUMN > &chain)
 
template<typename _CT >
void set_row (Sparse_matrix< _CT, COLUMN > &matrix, size_t index, const Sparse_chain< _CT, ROW > &chain)
 
template<typename _CT >
void set_row (Sparse_matrix< _CT, ROW > &matrix, size_t index, const Sparse_chain< _CT, ROW > &chain)
 
template<typename _CT , int _CTF>
void set_coefficient (Sparse_matrix< _CT, _CTF > &matrix, size_t i, size_t j, const _CT d)
 
template<typename _CT , int _CTF>
_CT get_coefficient (const Sparse_matrix< _CT, _CTF > &matrix, size_t i, size_t j)
 
template<typename _CT , int _CTF>
Sparse_matrix< _CT, _CTF > & remove_column (Sparse_matrix< _CT, _CTF > &matrix, size_t index)
 
template<typename _CT , int _CTF>
Sparse_matrix< _CT, _CTF > & remove_row (Sparse_matrix< _CT, _CTF > &matrix, size_t index)
 
template<typename _CT , int _CTF>
Sparse_matrix< _CT, _CTF > & remove_coefficient (Sparse_matrix< _CT, _CTF > &matrix, size_t i, size_t j)
 
template<typename _CT >
std::ostream & write_matrix (const Sparse_matrix< _CT, OSM::COLUMN > &M, std::ostream &out)
 
template<typename _CT >
std::ostream & write_matrix (const Sparse_matrix< _CT, OSM::ROW > &M, std::ostream &out)
 
template<typename _CT >
void write_matrix (const Sparse_matrix< _CT, OSM::COLUMN > &M, std::string filename)
 
template<typename _CT >
void write_matrix (const Sparse_matrix< _CT, OSM::ROW > &M, std::string filename)
 
template<typename _CT >
std::istream & read_matrix (Sparse_matrix< _CT, OSM::COLUMN > &M, std::istream &in)
 
template<typename _CT >
std::istream & read_matrix (Sparse_matrix< _CT, OSM::ROW > &M, std::istream &in)
 
template<typename _CT >
void read_matrix (Sparse_matrix< _CT, OSM::COLUMN > &M, std::string filename)
 
template<typename _CT >
void read_matrix (Sparse_matrix< _CT, OSM::ROW > &M, std::string filename)
 
template<typename _CT >
bool operator== (const Sparse_matrix< _CT, OSM::COLUMN > &matrix, const Sparse_matrix< _CT, OSM::COLUMN > &other)
 
template<typename _CT >
bool operator== (const Sparse_matrix< _CT, OSM::ROW > &matrix, const Sparse_matrix< _CT, OSM::ROW > &other)
 
template<typename _CT >
bool operator== (const Sparse_matrix< _CT, OSM::ROW > &matrix, const Sparse_matrix< _CT, OSM::COLUMN > &other)
 
template<typename _CT >
bool operator== (const Sparse_matrix< _CT, OSM::COLUMN > &matrix, const Sparse_matrix< _CT, OSM::ROW > &other)
 

Variables

const int COLUMN = 0b01
 StorageFormat for column chain.
 
const int ROW = 0b10
 StorageFormat flag for row chain.
 
const size_t size_t_maxvalue = std::numeric_limits<size_t>::max()
 
const int tab64 [64]
 
const int index64 [64]
 

Function Documentation

◆ cget_column()

template<typename _CT >
const Sparse_chain< _CT, COLUMN > & CGAL::OSM::cget_column ( const Sparse_matrix< _CT, COLUMN > &  matrix,
size_t  index 
)
related

Constant time get.

Warning
The matrix will perform boundary check.
Parameters
matrixThe matrix considered.
indexThe column index.
Returns
A constant reference over the column stored at given index.
Examples
HDVF/matrix_chain.cpp.

◆ cget_row()

template<typename _CT >
const Sparse_chain< _CT, ROW > & CGAL::OSM::cget_row ( const Sparse_matrix< _CT, ROW > &  matrix,
const size_t  index 
)
related

Constant time get.

Warning
The matrix will perform boundary check.
Parameters
matrixThe matrix considered.
indexThe row index.
Returns
A const reference over the row stored at given index.

◆ get_coefficient()

template<typename _CT , int _CTF>
_CT CGAL::OSM::get_coefficient ( const Sparse_matrix< _CT, _CTF > &  matrix,
size_t  i,
size_t  j 
)
related

Returns the coefficient on row i and column j of the matrix.

Warning
The matrix will perform boundary check.
Parameters
matrixConstant reference on the matrix.
iThe row index.
jThe column index.
Returns
The value of the given coefficient.

◆ operator%()

template<typename _CT >
Sparse_matrix< _CT, ROW > CGAL::OSM::operator% ( const Sparse_chain< _CT, COLUMN > &  column,
const Sparse_chain< _CT, ROW > &  row 
)
related

Generate a row-based matrix from the matrix multiplication and return it.

Precondition
Chains must have the same CoefficientRing.
Warning
Will raise an error if chains do not have the same CoefficientRing.
Parameters
columnThe column chain.
rowThe row chain.
Returns
The result of the matrix multiplication, row-based.

◆ operator*()

template<typename _CT >
Sparse_matrix< _CT, COLUMN > CGAL::OSM::operator* ( const Sparse_chain< _CT, COLUMN > &  column,
const Sparse_chain< _CT, ROW > &  row 
)
related

Generate a column-based matrix from the matrix multiplication and return it.

Precondition
Chains must have the same CoefficientRing.
Warning
Will raise an error if chains do not have the same CoefficientRing.
Parameters
columnThe column chain.
rowThe row chain.
Returns
The result of the matrix multiplication, column-based.

◆ remove_coefficient()

template<typename _CT , int _CTF>
Sparse_matrix< _CT, _CTF > & CGAL::OSM::remove_coefficient ( Sparse_matrix< _CT, _CTF > &  matrix,
size_t  i,
size_t  j 
)
related

Removes coefficient at row i and column j.

Parameters
matrixReference on the matrix to modify.
iIndex of the row
jIndex of the column
Returns
The modified matrix representing the result.

◆ remove_column()

template<typename _CT , int _CTF>
Sparse_matrix< _CT, _CTF > & CGAL::OSM::remove_column ( Sparse_matrix< _CT, _CTF > &  matrix,
size_t  index 
)
related

Removes column of index index whatever the StorageFormat of the matrix. For column matrices, it just comes to the \= operator and for row matrices, it entails a traversal of the matrix.

Parameters
matrixReference on the matrix to modify.
indexThe index to remove.
Returns
The modified matrix representing the result.

◆ remove_row()

template<typename _CT , int _CTF>
Sparse_matrix< _CT, _CTF > & CGAL::OSM::remove_row ( Sparse_matrix< _CT, _CTF > &  matrix,
size_t  index 
)
related

Removes row of index index whatever the StorageFormat of the matrix. For row matrices, it just comes to the \= operator and for column matrices, it entails a traversal of the matrix.

Parameters
matrixReference on the matrix to modify.
indexThe index to remove.
Returns
The modified matrix representing the result.

◆ set_coefficient()

template<typename _CT , int _CTF>
void CGAL::OSM::set_coefficient ( Sparse_matrix< _CT, _CTF > &  matrix,
size_t  i,
size_t  j,
const _CT  d 
)
related

Assign the scalar d to the coefficient on row i and column j.

Warning
The matrix will perform boundary check.
Parameters
matrixReference on the matrix to modify.
iThe row index.
jThe column index.
dThe value.
Examples
HDVF/matrix_chain.cpp.

Variable Documentation

◆ index64

const int CGAL::OSM::index64[64]
Initial value:
= {
0, 47, 1, 56, 48, 27, 2, 60,
57, 49, 41, 37, 28, 16, 3, 61,
54, 58, 35, 52, 50, 42, 21, 44,
38, 32, 29, 23, 17, 11, 4, 62,
46, 55, 26, 59, 40, 36, 15, 53,
34, 51, 20, 43, 31, 22, 10, 45,
25, 39, 14, 33, 19, 30, 9, 24,
13, 18, 8, 12, 7, 6, 5, 63
}

◆ tab64

const int CGAL::OSM::tab64[64]
Initial value:
= {
63, 0, 58, 1, 59, 47, 53, 2,
60, 39, 48, 27, 54, 33, 42, 3,
61, 51, 37, 40, 49, 18, 28, 20,
55, 30, 34, 11, 43, 14, 22, 4,
62, 57, 46, 52, 38, 26, 32, 41,
50, 36, 17, 19, 29, 10, 13, 21,
56, 45, 25, 31, 35, 16, 9, 12,
44, 24, 15, 8, 23, 7, 6, 5
}