The ChainCon Software (Release 0.03)
|
A linear map. More...
#include <linmap.h>
Public Types | |
typedef CellDomT | CellDomType |
The type of cells in the domain of the linear map. More... | |
typedef CellImgT | CellImgType |
The type of cells in the images of the linear map. More... | |
typedef CoefT | CoefType |
The type of coefficients in the chain. More... | |
typedef tChain< CellDomT, CoefT > | ChainDomType |
The type of the corresponding domain chain. More... | |
typedef tChain< CellImgT, CoefT > | ChainImgType |
The type of the corresponding image chain. More... | |
typedef tTensor< CellDomT, CellDomT, CoefT > | TensorDomType |
The type of the corresponding domain chain. More... | |
typedef tTensor< CellImgT, CellImgT, CoefT > | TensorImgType |
The type of the corresponding image chain. More... | |
Public Member Functions | |
tLinMap () | |
The default constructor. More... | |
int_t | add (const CellDomT &c) |
Adds a cell to the domain of the map, with zero image, and returns its number. More... | |
void | add (const CellDomT &c, const CellImgT &d, const CoefT &coef) |
Adds a cell to the image of the given cell. More... | |
void | add (const CellDomT &c, const tChain< CellImgT, CoefT > &ch) |
Adds a chain to the image of the given cell. More... | |
tLinMap< CellDomT, CellImgT, CoefT > & | operator+= (const tLinMap< CellDomT, CellImgT, CoefT > &f) |
Adds another map to the given map. More... | |
tLinMap< CellDomT, CellImgT, CoefT > & | negate () |
Replaces all the coefficients in the map with their negation. More... | |
tLinMap< CellDomT, CellImgT, CoefT > & | operator*= (const CoefT &c) |
Multiplies all the coefficients in the map by the given number. More... | |
void | removenum (int_t n) |
Removes the given cell from the domain of the map. More... | |
void | remove (const CellDomT &c) |
Removes the given cell from the domain of the map. More... | |
const tChain< CellImgT, CoefT > & | operator() (int_t n) const |
Returns the image of the given cell. More... | |
tChain< CellImgT, CoefT > | operator() (const CellDomT &c) const |
Returns the image of the given cell. More... | |
tChain< CellImgT, CoefT > | operator() (const tChain< CellDomT, CoefT > &ch) const |
Computes the image of the given chain. More... | |
tTensor< CellImgT, CellImgT, CoefT > | operator() (const tTensor< CellDomT, CellDomT, CoefT > &ch) const |
Computes the image of the given tensor. More... | |
int_t | size () const |
Returns the number of elements in the domain of the map. More... | |
const CellDomT & | operator[] (int_t n) const |
Returns the n-th element of the domain of the map. More... | |
const chomp::homology::hashedset< CellDomT > & | getDomain () const |
Returns the domain of the map. More... | |
tChain< CellImgT, CoefT > & | getImage (int_t n) |
Returns the image of the given cell for editing. More... | |
tChain< CellImgT, CoefT > & | getImage (const CellDomT &c) |
Returns the image of the given cell for editing. More... | |
bool | operator== (const tLinMap< CellDomT, CellImgT, CoefT > &f) const |
Verifies if the two linear maps are the same. More... | |
void | swap (tLinMap< CellDomT, CellImgT, CoefT > &f) |
Swaps the data with another linear map. More... | |
Private Attributes | |
chomp::homology::hashedset< CellDomT > | domain |
The domain of the map. More... | |
chomp::homology::multitable< tChain< CellImgT, CoefT > > | images |
The chains in the images of each domain element. More... | |
A linear map.
This is in fact a finite set of cells mapped to a chain each. It corresponds to a linear map on the vector space generated by the cells over the coefficients field F_2 (a.k.a. Z_2).
typedef CellDomT tLinMap< CellDomT, CellImgT, CoefT >::CellDomType |
typedef CellImgT tLinMap< CellDomT, CellImgT, CoefT >::CellImgType |
typedef tChain<CellDomT,CoefT> tLinMap< CellDomT, CellImgT, CoefT >::ChainDomType |
typedef tChain<CellImgT,CoefT> tLinMap< CellDomT, CellImgT, CoefT >::ChainImgType |
typedef tTensor<CellDomT,CellDomT,CoefT> tLinMap< CellDomT, CellImgT, CoefT >::TensorDomType |
typedef tTensor<CellImgT,CellImgT,CoefT> tLinMap< CellDomT, CellImgT, CoefT >::TensorImgType |
|
inline |
Adds a cell to the domain of the map, with zero image, and returns its number.
Definition at line 170 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain.
Referenced by tLinMap< CellDomT, CellImgT, CoefT >::add(), addIdentity(), tLinMap< CellDomT, CellImgT, CoefT >::getImage(), tLinMap< CellDomT, CellImgT, CoefT >::operator()(), operator*(), and tLinMap< CellDomT, CellImgT, CoefT >::operator+=().
|
inline |
Adds a cell to the image of the given cell.
Definition at line 177 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::add(), tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Adds a chain to the image of the given cell.
Definition at line 191 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::add(), tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Returns the domain of the map.
Definition at line 357 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, and tLinMap< CellDomT, CellImgT, CoefT >::getImage().
|
inline |
Returns the image of the given cell for editing.
Definition at line 364 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::images.
Referenced by tLinMap< CellDomT, CellImgT, CoefT >::getDomain().
|
inline |
Returns the image of the given cell for editing.
Definition at line 371 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::add(), tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Replaces all the coefficients in the map with their negation.
Definition at line 235 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Returns the image of the given cell.
Definition at line 275 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::images.
|
inline |
Returns the image of the given cell.
Definition at line 282 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, and tLinMap< CellDomT, CellImgT, CoefT >::images.
|
inline |
Computes the image of the given chain.
Definition at line 293 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Computes the image of the given tensor.
Definition at line 318 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::add(), tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Multiplies all the coefficients in the map by the given number.
Definition at line 245 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Adds another map to the given map.
Definition at line 221 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::add(), tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, and tLinMap< CellDomT, CellImgT, CoefT >::size().
|
inline |
Verifies if the two linear maps are the same.
Definition at line 384 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, tLinMap< CellDomT, CellImgT, CoefT >::size(), and tLinMap< CellDomT, CellImgT, CoefT >::swap().
|
inline |
Returns the n-th element of the domain of the map.
Definition at line 350 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain.
|
inline |
Removes the given cell from the domain of the map.
Note that this may change the order of cells in the domain.
Definition at line 265 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, and tLinMap< CellDomT, CellImgT, CoefT >::removenum().
|
inline |
Removes the given cell from the domain of the map.
Note that this may change the order of cells in the domain.
Definition at line 254 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, tLinMap< CellDomT, CellImgT, CoefT >::images, tLinMap< CellDomT, CellImgT, CoefT >::size(), and tLinMap< CellDomT, CellImgT, CoefT >::swap().
Referenced by tLinMap< CellDomT, CellImgT, CoefT >::remove().
|
inline |
Returns the number of elements in the domain of the map.
Note that the images of some of the elements might be zero.
Definition at line 343 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain.
Referenced by tLinMap< CellDomT, CellImgT, CoefT >::add(), addIdentity(), tLinMap< CellDomT, CellImgT, CoefT >::getImage(), tLinMap< CellDomT, CellImgT, CoefT >::negate(), tLinMap< CellDomT, CellImgT, CoefT >::operator()(), operator*(), tLinMap< CellDomT, CellImgT, CoefT >::operator*=(), tLinMap< CellDomT, CellImgT, CoefT >::operator+=(), operator<<(), tLinMap< CellDomT, CellImgT, CoefT >::operator==(), and tLinMap< CellDomT, CellImgT, CoefT >::removenum().
|
inline |
Swaps the data with another linear map.
Definition at line 417 of file linmap.h.
References tLinMap< CellDomT, CellImgT, CoefT >::domain, and tLinMap< CellDomT, CellImgT, CoefT >::images.
Referenced by tLinMap< CellDomT, CellImgT, CoefT >::operator==(), and tLinMap< CellDomT, CellImgT, CoefT >::removenum().
|
private |
The domain of the map.
Definition at line 153 of file linmap.h.
Referenced by tLinMap< CellDomT, CellImgT, CoefT >::add(), tLinMap< CellDomT, CellImgT, CoefT >::getDomain(), tLinMap< CellDomT, CellImgT, CoefT >::getImage(), tLinMap< CellDomT, CellImgT, CoefT >::negate(), tLinMap< CellDomT, CellImgT, CoefT >::operator()(), tLinMap< CellDomT, CellImgT, CoefT >::operator*=(), tLinMap< CellDomT, CellImgT, CoefT >::operator+=(), tLinMap< CellDomT, CellImgT, CoefT >::operator==(), tLinMap< CellDomT, CellImgT, CoefT >::operator[](), tLinMap< CellDomT, CellImgT, CoefT >::remove(), tLinMap< CellDomT, CellImgT, CoefT >::removenum(), tLinMap< CellDomT, CellImgT, CoefT >::size(), and tLinMap< CellDomT, CellImgT, CoefT >::swap().
|
private |
The chains in the images of each domain element.
Definition at line 156 of file linmap.h.
Referenced by tLinMap< CellDomT, CellImgT, CoefT >::add(), tLinMap< CellDomT, CellImgT, CoefT >::getImage(), tLinMap< CellDomT, CellImgT, CoefT >::negate(), tLinMap< CellDomT, CellImgT, CoefT >::operator()(), tLinMap< CellDomT, CellImgT, CoefT >::operator*=(), tLinMap< CellDomT, CellImgT, CoefT >::operator+=(), tLinMap< CellDomT, CellImgT, CoefT >::operator==(), tLinMap< CellDomT, CellImgT, CoefT >::removenum(), and tLinMap< CellDomT, CellImgT, CoefT >::swap().