An algebraic structure that represents a finitely generated Abelian group with gradation. More...
#include <algstruct.h>
Public Member Functions | |
| algstruct () | |
| The default constructor. | |
| ~algstruct () | |
| The destructor. | |
| int | countLevels () const |
| Returns the number of levels of gradation stored in the structure. | |
| void | setBetti (int level, int number) |
| Sets a specific Betti number. | |
| void | addBetti (int level, int howmuch) |
| Increases a specific Betti number. | |
| int | getBetti (int level) const |
| Returns a specific Betti number. | |
| void | addTorsion (int level, euclidom coef) |
| Adds a torsion coefficient. | |
| const euclidom & | getTorsion (int level, int n) const |
| Returns a torsion coefficient. | |
| int | countTorsion (int level) const |
| Says how many torsion coefficients exist at the given level. | |
| std::ostream & | describe (std::ostream &out) const |
| Describes the homology group in a human-readable way. | |
| std::ostream & | showBetti (std::ostream &out) const |
| Shows the Betti numbers as a space-sperated sequence. | |
Private Attributes | |
| std::vector< int > | betti |
| The Betti numbers. | |
| std::vector< std::vector < euclidom > > | torsion |
| The torsion coefficients. | |
An algebraic structure that represents a finitely generated Abelian group with gradation.
Definition at line 68 of file algstruct.h.
| chomp::homengin::algstruct< euclidom >::algstruct | ( | ) | [inline] |
The default constructor.
Definition at line 116 of file algstruct.h.
{
return;
} /* algstruct::algstruct */
| chomp::homengin::algstruct< euclidom >::~algstruct | ( | ) | [inline] |
| void chomp::homengin::algstruct< euclidom >::addBetti | ( | int | level, | |
| int | howmuch | |||
| ) | [inline] |
Increases a specific Betti number.
Definition at line 154 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::betti, and chomp::homengin::algstruct< euclidom >::setBetti().
| void chomp::homengin::algstruct< euclidom >::addTorsion | ( | int | level, | |
| euclidom | coef | |||
| ) | [inline] |
Adds a torsion coefficient.
Definition at line 177 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::torsion.
| int chomp::homengin::algstruct< euclidom >::countLevels | ( | ) | const [inline] |
Returns the number of levels of gradation stored in the structure.
Definition at line 130 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::betti, and chomp::homengin::algstruct< euclidom >::torsion.
| int chomp::homengin::algstruct< euclidom >::countTorsion | ( | int | level | ) | const [inline] |
Says how many torsion coefficients exist at the given level.
Definition at line 204 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::torsion.
| std::ostream & chomp::homengin::algstruct< euclidom >::describe | ( | std::ostream & | out | ) | const |
Describes the homology group in a human-readable way.
Definition at line 229 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::betti, and chomp::homengin::algstruct< euclidom >::torsion.
{
int nBetti = betti. size ();
int nTorsion = torsion. size ();
for (int i = 0; (i < nBetti) || (i < nTorsion); ++ i)
{
if (i)
out << ", ";
else
out << '(';
bool zero = true;
if ((i < nBetti) && (betti [i] > 0))
{
zero = false;
out << ringsymbol<euclidom> ();
if (betti [i] > 1)
out << '^' << betti [i];
if ((i < nTorsion) && (torsion [i]. size ()))
out << " + ";
}
if (i < nTorsion)
{
std::vector<euclidom> tor = torsion [i];
for (unsigned j = 0; j < tor. size (); ++ j)
{
zero = false;
if (j)
out << " + ";
out << ringsymbol<euclidom> () <<
'_' << tor [j];
}
}
if (zero)
out << 0;
}
if (nBetti || nTorsion)
out << ')';
else
out << '0';
return out;
} /* algstruct::describe */
| int chomp::homengin::algstruct< euclidom >::getBetti | ( | int | level | ) | const [inline] |
Returns a specific Betti number.
Definition at line 166 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::betti.
| const euclidom & chomp::homengin::algstruct< euclidom >::getTorsion | ( | int | level, | |
| int | n | |||
| ) | const [inline] |
Returns a torsion coefficient.
Definition at line 189 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::torsion.
| void chomp::homengin::algstruct< euclidom >::setBetti | ( | int | level, | |
| int | number | |||
| ) | [inline] |
Sets a specific Betti number.
Definition at line 138 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::betti.
Referenced by chomp::homengin::algstruct< euclidom >::addBetti().
| std::ostream & chomp::homengin::algstruct< euclidom >::showBetti | ( | std::ostream & | out | ) | const |
Shows the Betti numbers as a space-sperated sequence.
Definition at line 272 of file algstruct.h.
References chomp::homengin::algstruct< euclidom >::betti.
std::vector<int> chomp::homengin::algstruct< euclidom >::betti [private] |
The Betti numbers.
Definition at line 107 of file algstruct.h.
Referenced by chomp::homengin::algstruct< euclidom >::addBetti(), chomp::homengin::algstruct< euclidom >::countLevels(), chomp::homengin::algstruct< euclidom >::describe(), chomp::homengin::algstruct< euclidom >::getBetti(), chomp::homengin::algstruct< euclidom >::setBetti(), and chomp::homengin::algstruct< euclidom >::showBetti().
std::vector<std::vector<euclidom> > chomp::homengin::algstruct< euclidom >::torsion [private] |
The torsion coefficients.
Definition at line 110 of file algstruct.h.
Referenced by chomp::homengin::algstruct< euclidom >::addTorsion(), chomp::homengin::algstruct< euclidom >::countLevels(), chomp::homengin::algstruct< euclidom >::countTorsion(), chomp::homengin::algstruct< euclidom >::describe(), and chomp::homengin::algstruct< euclidom >::getTorsion().
1.7.1