The ChainCon Software (Release 0.03)
|
An interface for the computation of the Smith Normal Form of a series of a few rectangular matrices with coefficients in a Euclidean Domain. More...
#include <snfchomp.h>
Public Types | |
typedef CoefT | CoefType |
The type of coefficients in the chain. More... | |
typedef tAlgCell< int_t, unsigned char, CoefT > | CellType |
The type of an abstract algebraic cell that is used to carry the numbers of columns or rows in the matrix. More... | |
typedef tChain< CellType, CoefT > | ChainType |
The type of the corresponding image chain. More... | |
Public Member Functions | |
tMatrixSNF () | |
The default constructor of a matrix. More... | |
~tMatrixSNF () | |
The destructor of a matrix. More... | |
void | setSize (int q, int_t numRows, int_t numColumns) |
Sets the number of rows and columns in a given sub-matrix. More... | |
void | add (int q, int_t row, int_t column, const CoefT &element) |
Adds an element to the matrix whose SNF will be computed. More... | |
int_t | getNumRows (int q) const |
Returns the number of rows of the matrix. More... | |
int_t | getNumCols (int q) const |
Returns the number of columns of the matrix. More... | |
void | computeSNF (int numMatr) |
Computes the almost Smith Normal Form of all the matrices whose number is provided (indexing stats from 0 and ends at the given mumber minus 1). More... | |
CoefT | getColCoef (int q, int_t n) const |
Returns the coefficient in the given column of the given matrix in the SNF. More... | |
int_t | getColCell (int q, int_t n) const |
Returns the cell number in the given column of the given matrix in the SNF, or -1 if the column is zero. More... | |
CoefT | getRowCoef (int q, int_t n) const |
Returns the coefficient in the given row of the given matrix in the SNF. More... | |
int_t | getRowCell (int q, int_t n) const |
Returns the cell number in the given row of the given matrix in the SNF, or -1 if the row is zero. More... | |
ChainType | getNewChain (int q, int_t n) const |
For a cell in the original basis, returns the corresponding combination of elements in the new basis (the column of the change-of-basis matrix in this direction). More... | |
ChainType | getNewChainRow (int q, int_t n) const |
For a cell in the original basis, returns the given row of the change-of-basis matrix towards the new basis. More... | |
ChainType | getOldChain (int q, int_t n) const |
For a cell in the new basis, returns a combination of the original cells that correspond to this cell (the column of the change-of-basis matrix in this direction). More... | |
ChainType | getOldChainRow (int q, int_t n) const |
For a cell in the new basis, returns the given row of the change-of-basis matrix towards the original basis. More... | |
Private Member Functions | |
tMatrixSNF (const tMatrixSNF< CoefT > &other) | |
Copy constructor is not allowed. More... | |
tMatrixSNF< CoefT > & | operator= (const tMatrixSNF< CoefT > &other) |
Assignment operator is not allowed. More... | |
Static Private Member Functions | |
static ChainType | abstractChain (const chomp::homology::chain< tEuclWrap< CoefT > > &ch) |
Coverts a column of a matrix to an abstract algebraic chain. More... | |
Private Attributes | |
chomp::homology::multitable< chomp::homology::mmatrix< tEuclWrap< CoefT > > > | matrices |
The matrices whose Smith Normal Form will be computed. More... | |
chomp::homology::multitable< chomp::homology::mmatrix< tEuclWrap< CoefT > > > | chgBasisA |
Change of basis matrices from the original one to the SNF one. More... | |
chomp::homology::multitable< chomp::homology::mmatrix< tEuclWrap< CoefT > > > | chgBasisG |
Change of basis matrices from the SNF one to the original one. More... | |
bool | computedSNF |
Remembers if the SNF has already been computed. More... | |
An interface for the computation of the Smith Normal Form of a series of a few rectangular matrices with coefficients in a Euclidean Domain.
A Euclidean Domain is a commutative ring in which division with remainder is well defined; for example, the ring of integers, the ring of polynomials in one variable, or some field (like the rationals or the integers modulo a prime number p). In fact, what is to be computed, are the changes of bases in the complex such that each matrix in the series is in the SNF. The columns and rows of each matrix in the set are indexed by integer numbers starting at 0. In addition to the SNF, the change-of-basis matrices A and G are also computed, such that A is a change of basis from the original one to the new one, and G is a change of basis from the new basis back to the original one. In other words, if {M_q} is the original series of matrices and {S_q} is a series of its SNF then M_q = G_{q-1} S_q A_q, and G_q A_q = A_q G_q = identity. Please, note that it is not possible to make all the boundary matrices in the SNF with the non-zero entries starting at the 'diagonal', because the boundary of a boundary must be zero. Therefore, what is computed here, is a 'simple form' of the boundary matrices in which every column and every row has at most one nonzero entry. Please, note that the division condition required in the SNF is not satisfied either. As a consequence, the collection of coefficients that define a homology group may not be the same for isomorphic groups.
Definition at line 86 of file snfchomp.h.
typedef tAlgCell<int_t,unsigned char,CoefT> tMatrixSNF< CoefT >::CellType |
The type of an abstract algebraic cell that is used to carry the numbers of columns or rows in the matrix.
Please note that only the identifier of this cell is used, not its dimension, nor its boundary.
Definition at line 96 of file snfchomp.h.
typedef tChain<CellType,CoefT> tMatrixSNF< CoefT >::ChainType |
The type of the corresponding image chain.
Definition at line 99 of file snfchomp.h.
typedef CoefT tMatrixSNF< CoefT >::CoefType |
The type of coefficients in the chain.
Definition at line 90 of file snfchomp.h.
|
inline |
The default constructor of a matrix.
Definition at line 195 of file snfchomp.h.
|
inline |
The destructor of a matrix.
Definition at line 201 of file snfchomp.h.
|
inlineprivate |
Copy constructor is not allowed.
Definition at line 207 of file snfchomp.h.
|
inlinestaticprivate |
Coverts a column of a matrix to an abstract algebraic chain.
Definition at line 357 of file snfchomp.h.
References tMatrixSNF< CoefT >::add().
Referenced by tMatrixSNF< CoefT >::getNewChain(), tMatrixSNF< CoefT >::getNewChainRow(), tMatrixSNF< CoefT >::getOldChain(), tMatrixSNF< CoefT >::getOldChainRow(), and tMatrixSNF< CoefT >::getRowCell().
|
inline |
Adds an element to the matrix whose SNF will be computed.
Definition at line 234 of file snfchomp.h.
References tMatrixSNF< CoefT >::matrices.
Referenced by tMatrixSNF< CoefT >::abstractChain(), and tMatrixSNF< CoefT >::computeSNF().
|
inline |
Computes the almost Smith Normal Form of all the matrices whose number is provided (indexing stats from 0 and ends at the given mumber minus 1).
After all the matrices have been defined, this procedure must be called once to compute the SNF and all the auxiliary data, including the change of basis matrices A and G. Then the results of the computations can be read with the other methods available in this class.
Definition at line 254 of file snfchomp.h.
References tMatrixSNF< CoefT >::add(), tMatrixSNF< CoefT >::chgBasisA, tMatrixSNF< CoefT >::chgBasisG, tMatrixSNF< CoefT >::computedSNF, identity(), and tMatrixSNF< CoefT >::matrices.
|
inline |
Returns the cell number in the given column of the given matrix in the SNF, or -1 if the column is zero.
Definition at line 323 of file snfchomp.h.
References tMatrixSNF< CoefT >::matrices.
|
inline |
Returns the coefficient in the given column of the given matrix in the SNF.
Definition at line 312 of file snfchomp.h.
References tMatrixSNF< CoefT >::matrices.
|
inline |
For a cell in the original basis, returns the corresponding combination of elements in the new basis (the column of the change-of-basis matrix in this direction).
Definition at line 371 of file snfchomp.h.
References tMatrixSNF< CoefT >::abstractChain(), and tMatrixSNF< CoefT >::chgBasisA.
|
inline |
For a cell in the original basis, returns the given row of the change-of-basis matrix towards the new basis.
Definition at line 378 of file snfchomp.h.
References tMatrixSNF< CoefT >::abstractChain(), and tMatrixSNF< CoefT >::chgBasisA.
|
inline |
Returns the number of columns of the matrix.
Definition at line 248 of file snfchomp.h.
References tMatrixSNF< CoefT >::matrices.
|
inline |
Returns the number of rows of the matrix.
Definition at line 242 of file snfchomp.h.
References tMatrixSNF< CoefT >::matrices.
|
inline |
For a cell in the new basis, returns a combination of the original cells that correspond to this cell (the column of the change-of-basis matrix in this direction).
Definition at line 385 of file snfchomp.h.
References tMatrixSNF< CoefT >::abstractChain(), and tMatrixSNF< CoefT >::chgBasisG.
|
inline |
For a cell in the new basis, returns the given row of the change-of-basis matrix towards the original basis.
Definition at line 392 of file snfchomp.h.
References tMatrixSNF< CoefT >::abstractChain(), and tMatrixSNF< CoefT >::chgBasisG.
|
inline |
Returns the cell number in the given row of the given matrix in the SNF, or -1 if the row is zero.
Definition at line 345 of file snfchomp.h.
References tMatrixSNF< CoefT >::abstractChain(), and tMatrixSNF< CoefT >::matrices.
|
inline |
Returns the coefficient in the given row of the given matrix in the SNF.
Definition at line 334 of file snfchomp.h.
References tMatrixSNF< CoefT >::matrices.
|
inlineprivate |
Assignment operator is not allowed.
Definition at line 215 of file snfchomp.h.
|
inline |
Sets the number of rows and columns in a given sub-matrix.
Definition at line 224 of file snfchomp.h.
References tMatrixSNF< CoefT >::matrices.
|
private |
Change of basis matrices from the original one to the SNF one.
Definition at line 177 of file snfchomp.h.
Referenced by tMatrixSNF< CoefT >::computeSNF(), tMatrixSNF< CoefT >::getNewChain(), and tMatrixSNF< CoefT >::getNewChainRow().
|
private |
Change of basis matrices from the SNF one to the original one.
Definition at line 181 of file snfchomp.h.
Referenced by tMatrixSNF< CoefT >::computeSNF(), tMatrixSNF< CoefT >::getOldChain(), and tMatrixSNF< CoefT >::getOldChainRow().
|
private |
Remembers if the SNF has already been computed.
Definition at line 188 of file snfchomp.h.
Referenced by tMatrixSNF< CoefT >::computeSNF().
|
private |
The matrices whose Smith Normal Form will be computed.
Definition at line 173 of file snfchomp.h.
Referenced by tMatrixSNF< CoefT >::add(), tMatrixSNF< CoefT >::computeSNF(), tMatrixSNF< CoefT >::getColCell(), tMatrixSNF< CoefT >::getColCoef(), tMatrixSNF< CoefT >::getNumCols(), tMatrixSNF< CoefT >::getNumRows(), tMatrixSNF< CoefT >::getRowCell(), tMatrixSNF< CoefT >::getRowCoef(), and tMatrixSNF< CoefT >::setSize().