The Original CHomP Software
|
This is an implementation of a chain complex over an arbitrary ring. More...
#include <chains.h>
Public Member Functions | |
chaincomplex (int d, int trace_generators=0, int trace_bases=0) | |
The default constructor. More... | |
~chaincomplex () | |
The destructor. More... | |
void | def_gen (int q, int_t n) |
Defines the number of generators in the given dimension. More... | |
void | add (int q, int_t m, int_t n, const euclidom &e) |
Adds a coefficient to the structure: D_q [m, n] += e. More... | |
euclidom | get (int q, int_t row, int_t col) const |
Returns an element from the boundary matrix for the given dimension. More... | |
const mmatrix< euclidom > & | getboundary (int i) const |
Returns a reference to the given boundary matrix. More... | |
int_t | getnumgen (int i) const |
Returns the number of generators at the given level. More... | |
int | dim () const |
Returns the dimension of the chain complex. More... | |
const chain< euclidom > & | gethomgen (int q, int_t i) const |
Returns the given homology generator at level q. More... | |
const mmatrix< euclidom > & | gethomgen (int q) const |
Returns the homology generators matrix at level q. More... | |
const mmatrix< euclidom > & | getchgbasis (int q) const |
Returns the base change matrix at level q. More... | |
void | simple_form (int which, bool quiet) |
Reduces of the given boundary matrix in the chain complex for the purpose of homology computation. More... | |
void | simple_form (const int *level, bool quiet) |
Runs the reduction of all the boundary matrices in the chain complex. More... | |
int | simple_homology (chain< euclidom > &result, int which) const |
Computes the given level of homology of the chain complex, provided it has been transformed into the simple form previously. More... | |
int | simple_homology (chain< euclidom > *&result, const int *level=NULL) const |
Computes the homology of the chain complex, provided it has been transformed into the simple form previously. More... | |
void | take_homology (const chain< euclidom > *hom_chain) |
Creates a chain complex containing exactly one generator for each homology generator. More... | |
outputstream & | show_homology (outputstream &out, const chain< euclidom > *hom, const int *level=NULL) const |
Writes the homology module of the chain complex to an output stream. More... | |
std::ostream & | show_homology (std::ostream &out, const chain< euclidom > *hom, const int *level=NULL) const |
Writes the homology module of the chain complex to an output stream. More... | |
outputstream & | show_generators (outputstream &out, const chain< euclidom > &list, int q) const |
Writes the homology generators of the homology module to an output stream. More... | |
std::ostream & | show_generators (std::ostream &out, const chain< euclidom > &list, int q) const |
Writes the homology generators of the homology module to an output stream. More... | |
outputstream & | compute_and_show_homology (outputstream &out, chain< euclidom > *&hom, const int *level=NULL) |
Computes the homology and shows the result. More... | |
std::ostream & | compute_and_show_homology (std::ostream &out, chain< euclidom > *&hom, const int *level=NULL) |
Computes the homology and shows the result. More... | |
Private Member Functions | |
chaincomplex (const chaincomplex< euclidom > &m) | |
The copy constructor is not implemented. More... | |
chaincomplex< euclidom > & | operator= (const chaincomplex< euclidom > &s) |
The assignment operator is not implemented. More... | |
Private Attributes | |
int | len |
The length of the chain complex (i.e., its dimension + 1). More... | |
mmatrix< euclidom > * | boundary |
The matrices of the boundary homomorphism. More... | |
mmatrix< euclidom > * | generators |
Matrices which store actual combinations of generators. More... | |
mmatrix< euclidom > * | chgbases |
Matrices which store the change of basis to obtain the SNF. More... | |
int * | generators_initialized |
Have the generator tracing matrices been initialized to the identity (of suitable size each)? More... | |
int * | chgbases_initialized |
Have the base change tracing matrices been initialized to the identity (of suitable size each)? More... | |
int_t * | numgen |
The numbers of generators in each dimension, or -1's if not defined yet. More... | |
Friends | |
class | chainmap< euclidom > |
The class "chainmap" is a friend class which has access to the internal data of the chain complex class. More... | |
This is an implementation of a chain complex over an arbitrary ring.
The dimension of the chain complex must be known apriori. If there are elements not used in boundaries, use "def_gen" to set the true number of generators at each level.
|
inline |
The default constructor.
The dimension must be defined apriori and cannot be modified later. If requested, additional matrices are created to trace homology generators, and/or to determine the change of bases while computing the SNF.
Definition at line 2820 of file chains.h.
|
inline |
|
inlineprivate |
|
inline |
Adds a coefficient to the structure: D_q [m, n] += e.
In other words, boundary of element n += e * element m.
|
inline |
Computes the homology and shows the result.
Definition at line 3189 of file chains.h.
References chomp::homology::show_homology().
|
inline |
Computes the homology and shows the result.
Definition at line 3199 of file chains.h.
|
inline |
Defines the number of generators in the given dimension.
This number is automatically increased while boundary formulas are added. However, it must be used if some generators do not appear in the boundaries or have zero boundaries.
Definition at line 2901 of file chains.h.
|
inline |
|
inline |
Returns an element from the boundary matrix for the given dimension.
Definition at line 2936 of file chains.h.
|
inline |
|
inline |
|
inline |
|
inline |
Returns the given homology generator at level q.
Note: 'i' must be the number of chain generator.
Definition at line 2974 of file chains.h.
|
inline |
Returns the number of generators at the given level.
|
inlineprivate |
|
inline |
Writes the homology generators of the homology module to an output stream.
Each generator as a combination of the original ones is shown on a separate line.
Definition at line 3169 of file chains.h.
|
inline |
Writes the homology generators of the homology module to an output stream.
Each generator as a combination of the original ones is shown on a separate line.
Definition at line 3180 of file chains.h.
|
inline |
Writes the homology module of the chain complex to an output stream.
If a table of levels is given, shows only these levels for which the table's entry is nonzero.
Definition at line 3139 of file chains.h.
References chomp::homology::show_homology().
|
inline |
Writes the homology module of the chain complex to an output stream.
If a table of levels is given, shows only these levels for which the table's entry is nonzero.
Definition at line 3160 of file chains.h.
References chomp::homology::show_homology().
|
inline |
Runs the reduction of all the boundary matrices in the chain complex.
If the array of levels is given, computes only simple forms necessary for homology levels for which the entries in the array are nonzero.
Definition at line 3067 of file chains.h.
|
inline |
Reduces of the given boundary matrix in the chain complex for the purpose of homology computation.
Definition at line 3007 of file chains.h.
References chomp::homology::sout.
|
inline |
Computes the given level of homology of the chain complex, provided it has been transformed into the simple form previously.
Encodes this homology group as a chain which is a combination generator numbers together with their torsion coefficients (or with 1's if none).
Definition at line 3079 of file chains.h.
|
inline |
Computes the homology of the chain complex, provided it has been transformed into the simple form previously.
Encodes the homology as a table of chains (one chain for each dimension) which are combinations of generator numbers together with their torsion coefficients (or with 1's if none). Returns the dimension of the chain complex. If a table of levels is given, computes only these levels of homology for which the table's entry is nonzero.
Definition at line 3104 of file chains.h.
|
inline |
Creates a chain complex containing exactly one generator for each homology generator.
This function is used for extracting the map induced in homology by a chain map.
Definition at line 3128 of file chains.h.
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |