Regina Calculation Engine

Represents a finitely generated abelian group. More...
#include <algebra/nabeliangroup.h>
Public Member Functions  
NAbelianGroup ()  
Creates a new trivial group. More...  
NAbelianGroup (const NAbelianGroup &cloneMe)  
Creates a clone of the given group. More...  
NAbelianGroup (const NMatrixInt &M, const NMatrixInt &N)  
Creates an abelian group as the homology of a chain complex. More...  
NAbelianGroup (const NMatrixInt &M, const NMatrixInt &N, const NLargeInteger &p)  
Creates an abelian group as the homology of a chain complex, using modp coefficients. More...  
virtual  ~NAbelianGroup () 
Destroys the group. More...  
void  addRank (int extraRank=1) 
Increments the rank of the group by the given integer. More...  
void  addTorsionElement (const NLargeInteger °ree, unsigned mult=1) 
Adds the given torsion element to the group. More...  
void  addTorsionElement (unsigned long degree, unsigned mult=1) 
Adds the given torsion element to the group. More...  
void  addTorsionElements (const std::multiset< NLargeInteger > &torsion) 
Adds the given set of torsion elements to this group. More...  
void  addGroup (const NMatrixInt &presentation) 
Adds the abelian group defined by the given presentation to this group. More...  
void  addGroup (const NAbelianGroup &group) 
Adds the given abelian group to this group. More...  
unsigned  getRank () const 
Returns the rank of the group. More...  
unsigned  getTorsionRank (const NLargeInteger °ree) const 
Returns the rank in the group of the torsion term of given degree. More...  
unsigned  getTorsionRank (unsigned long degree) const 
Returns the rank in the group of the torsion term of given degree. More...  
unsigned long  getNumberOfInvariantFactors () const 
Returns the number of invariant factors that describe the torsion elements of this group. More...  
const NLargeInteger &  getInvariantFactor (unsigned long index) const 
Returns the given invariant factor describing the torsion elements of this group. More...  
bool  isTrivial () const 
Determines whether this is the trivial (zero) group. More...  
bool  isZ () const 
Determines whether this is the infinite cyclic group (Z). More...  
bool  isZn (unsigned long n) const 
Determines whether this is the nontrivial cyclic group on the given number of elements. More...  
bool  operator== (const NAbelianGroup &other) const 
Determines whether this and the given abelian group are isomorphic. More...  
bool  operator!= (const NAbelianGroup &other) const 
Determines whether this and the given abelian group are nonisomorphic. More...  
void  writeXMLData (std::ostream &out) const 
Writes a chunk of XML containing this abelian group. More...  
virtual void  writeTextShort (std::ostream &out) const 
The text representation will be of the form 3 Z + 4 Z_2 + Z_120 . More...  
Input and Output  
virtual void  writeTextLong (std::ostream &out) const 
Writes this object in long text format to the given output stream. More...  
std::string  str () const 
Returns the output from writeTextShort() as a string. More...  
std::string  toString () const 
A deprecated alias for str(), which returns the output from writeTextShort() as a string. More...  
std::string  detail () const 
Returns the output from writeTextLong() as a string. More...  
std::string  toStringLong () const 
A deprecated alias for detail(), which returns the output from writeTextLong() as a string. More...  
Protected Member Functions  
void  replaceTorsion (const NMatrixInt &matrix) 
Replaces the torsion elements of this group with those in the abelian group represented by the given Smith normal form presentation matrix. More...  
Protected Attributes  
unsigned  rank 
The rank of the group (the number of Z components). More...  
std::multiset< NLargeInteger >  invariantFactors 
The invariant factors d0,...,dn as described in the NAbelianGroup notes. More...  
Represents a finitely generated abelian group.
The torsion elements of the group are stored in terms of their invariant factors. For instance, Z_2+Z_3 will appear as Z_6, and Z_2+Z_2+Z_3 will appear as Z_2+Z_6.
In general the factors will appear as Z_d0+...+Z_dn, where the invariant factors di are all greater than 1 and satisfy d0d1...dn. Note that this representation is unique.

inline 
Creates a new trivial group.

inline 
Creates a clone of the given group.
cloneMe  the group to clone. 
regina::NAbelianGroup::NAbelianGroup  (  const NMatrixInt &  M, 
const NMatrixInt &  N  
) 
Creates an abelian group as the homology of a chain complex.
M  the `right' matrix in the chain complex; that is, the matrix that one takes the kernel of when computing homology. 
N  the `left' matrix in the chain complex; that is, the matrix that one takes the image of when computing homology. 
regina::NAbelianGroup::NAbelianGroup  (  const NMatrixInt &  M, 
const NMatrixInt &  N,  
const NLargeInteger &  p  
) 
Creates an abelian group as the homology of a chain complex, using modp coefficients.
M  the `right' matrix in the chain complex; that is, the matrix that one takes the kernel of when computing homology. 
N  the `left' matrix in the chain complex; that is, the matrix that one takes the image of when computing homology. 
p  the modulus, which may be any NLargeInteger. Zero is interpreted as a request for integer coefficents, which will give the same result as the NAbelianGroup(const NMatrixInt&, const NMatrixInt&) constructor. 

inlinevirtual 
Destroys the group.
void regina::NAbelianGroup::addGroup  (  const NMatrixInt &  presentation  ) 
Adds the abelian group defined by the given presentation to this group.
Note that this routine might be slow since calculating the new invariant factors is not trivial.
presentation  a presentation matrix for the group to be added to this group, where each column represents a generator and each row a relation. 
void regina::NAbelianGroup::addGroup  (  const NAbelianGroup &  group  ) 
Adds the given abelian group to this group.
Note that this routine might be slow since calculating the new invariant factors is not trivial.
group  the group to add to this one. 

inline 
Increments the rank of the group by the given integer.
This integer may be positive, negative or zero.
extraRank  the extra rank to add; this defaults to 1. 
void regina::NAbelianGroup::addTorsionElement  (  const NLargeInteger &  degree, 
unsigned  mult = 1 

) 
Adds the given torsion element to the group.
Note that this routine might be slow since calculating the new invariant factors is not trivial. If many different torsion elements are to be added, consider using addTorsionElements() instead so the invariant factors need only be calculated once.
In this routine we add a specified number of copies of Z_d, where d is some given degree.
degree  d, where we are adding copies of Z_d to the torsion. 
mult  the multiplicity m, where we are adding precisely m copies of Z_d; this defaults to 1. 

inline 
Adds the given torsion element to the group.
Note that this routine might be slow since calculating the new invariant factors is not trivial. If many different torsion elements are to be added, consider using addTorsionElements() instead so the invariant factors need only be calculated once.
In this routine we add a specified number of copies of Z_d, where d is some given degree.
degree  d, where we are adding copies of Z_d to the torsion. 
mult  the multiplicity m, where we are adding precisely m copies of Z_d; this defaults to 1. 
void regina::NAbelianGroup::addTorsionElements  (  const std::multiset< NLargeInteger > &  torsion  ) 
Adds the given set of torsion elements to this group.
Note that this routine might be slow since calculating the new invariant factors is not trivial.
The torsion elements to add are described by a list of integers k1,...,km, where we are adding Z_k1,...,Z_km. Unlike invariant factors, the ki are not required to divide each other.
torsion  a list containing the torsion elements to add, as described above. 

inherited 
Returns the output from writeTextLong() as a string.
const NLargeInteger& regina::NAbelianGroup::getInvariantFactor  (  unsigned long  index  )  const 
Returns the given invariant factor describing the torsion elements of this group.
See the NAbelianGroup class notes for further details.
If the invariant factors are d0d1...dn, this routine will return di where i is the value of parameter index.
index  the index of the invariant factor to return; this must be between 0 and getNumberOfInvariantFactors()1 inclusive. 

inline 
Returns the number of invariant factors that describe the torsion elements of this group.
See the NAbelianGroup class notes for further details.

inline 
Returns the rank of the group.
This is the number of included copies of Z.
unsigned regina::NAbelianGroup::getTorsionRank  (  const NLargeInteger &  degree  )  const 
Returns the rank in the group of the torsion term of given degree.
If the given degree is d, this routine will return the largest m for which mZ_d is a subgroup of this group.
For instance, if this group is Z_6+Z_12, the torsion term of degree 2 has rank 2 (one occurrence in Z_6 and one in Z_12), and the torsion term of degree 4 has rank 1 (one occurrence in Z_12).
degree  the degree of the torsion term to query. 

inline 
Returns the rank in the group of the torsion term of given degree.
If the given degree is d, this routine will return the largest m for which mZ_d is a subgroup of this group.
For instance, if this group is Z_6+Z_12, the torsion term of degree 2 has rank 2 (one occurrence in Z_6 and one in Z_12), and the torsion term of degree 4 has rank 1 (one occurrence in Z_12).
degree  the degree of the torsion term to query. 

inline 
Determines whether this is the trivial (zero) group.
true
if and only if this is the trivial group.

inline 
Determines whether this is the infinite cyclic group (Z).
true
if and only if this is the infinite cyclic group.

inline 
Determines whether this is the nontrivial cyclic group on the given number of elements.
As a special case, if n = 0 then this routine will test for the infinite cyclic group (i.e., it will behave the same as isZ()). If n = 1, then this routine will test for the trivial group (i.e., it will behave the same as isTrivial()).
n  the number of elements of the cyclic group in question. 
true
if and only if this is the cyclic group Z_n.

inline 
Determines whether this and the given abelian group are nonisomorphic.
other  the group with which this should be compared. 
true
if and only if the two groups are nonisomorphic.

inline 
Determines whether this and the given abelian group are isomorphic.
other  the group with which this should be compared. 
true
if and only if the two groups are isomorphic.

protected 
Replaces the torsion elements of this group with those in the abelian group represented by the given Smith normal form presentation matrix.
Any zero columns in the matrix will also be added to the rank as additional copies of Z. Note that preexisting torsion elements will be deleted, but preexisting rank will not.
matrix  a matrix containing the Smith normal form presentation matrix for the new torsion elements, where each column represents a generator and each row a relation. 

inherited 
Returns the output from writeTextShort() as a string.
__str__()
function.

inlineinherited 
A deprecated alias for str(), which returns the output from writeTextShort() as a string.

inlineinherited 
A deprecated alias for detail(), which returns the output from writeTextLong() as a string.

inlinevirtualinherited 
Writes this object in long text format to the given output stream.
The output should provide the user with all the information they could want. The output should be humanreadable, should not contain extremely long lines (so users can read the output in a terminal), and should end with a final newline.
The default implementation of this routine merely calls writeTextShort() and adds a newline.
out  the output stream to which to write. 
Reimplemented in regina::NSnapPeaTriangulation, regina::NGroupPresentation, regina::NHomMarkedAbelianGroup, regina::NNormalSurfaceList, regina::NTetrahedron, regina::NSatRegion, regina::NVertex, regina::NEdge, regina::Dim2Triangle, regina::NTriangle, regina::NLayeredSolidTorus, regina::NHomGroupPresentation, regina::NGenericIsomorphism< dim >, regina::NGenericIsomorphism< 2 >, regina::NGenericIsomorphism< 3 >, regina::NTriangulation, regina::NComponent, regina::NTxICore, regina::NTriSolidTorus, regina::NAngleStructureList, regina::Dim2Edge, regina::NBoundaryComponent, regina::NLayeredChain, regina::Dim2Vertex, regina::Dim2Component, regina::NScript, regina::NAugTriSolidTorus, regina::NSpiralSolidTorus, regina::NSurfaceFilterProperties, regina::NLayeredTorusBundle, regina::NManifold, regina::NPlugTriSolidTorus, regina::NMatrixInt, regina::NBlockedSFSTriple, regina::NPluggedTorusBundle, regina::Dim2Triangulation, regina::NSurfaceSubset, regina::NLayeredLensSpace, regina::NLayeredLoop, regina::NFileInfo, regina::NBlockedSFSLoop, regina::NSnappedBall, regina::NBlockedSFSPair, regina::Dim2BoundaryComponent, regina::NTrivialTri, regina::NL31Pillow, regina::NLayeredChainPair, regina::NText, regina::NSurfaceFilterCombination, and regina::NBlockedSFS.

virtual 
The text representation will be of the form 3 Z + 4 Z_2 + Z_120
.
The torsion elements will be written in terms of the invariant factors of the group, as described in the NAbelianGroup notes.
Implements regina::ShareableObject.
void regina::NAbelianGroup::writeXMLData  (  std::ostream &  out  )  const 
Writes a chunk of XML containing this abelian group.
out  the output stream to which the XML should be written. 

protected 
The invariant factors d0,...,dn as described in the NAbelianGroup notes.

protected 
The rank of the group (the number of Z components).