regina::NGroupPresentation Class Reference
[Algebraic Structures]

Represents a finite presentation of a group. More...

#include <ngrouppresentation.h>

Inheritance diagram for regina::NGroupPresentation:

regina::ShareableObject regina::boost::noncopyable

List of all members.

Public Member Functions

 NGroupPresentation ()
 Creates a new presentation with no generators and no relations.
 NGroupPresentation (const NGroupPresentation &cloneMe)
 Creates a clone of the given group presentation.
virtual ~NGroupPresentation ()
 Destroys the group presentation.
unsigned long addGenerator (unsigned long numToAdd=1)
 Adds one or more generators to the group presentation.
void addRelation (NGroupExpression *rel)
 Adds the given relation to the group presentation.
unsigned long getNumberOfGenerators () const
 Returns the number of generators in this group presentation.
unsigned long getNumberOfRelations () const
 Returns the number of relations in this group presentation.
const NGroupExpressiongetRelation (unsigned long index) const
 Returns the relation at the given index in this group presentation.
bool intelligentSimplify ()
 Attempts to simplify the group presentation as intelligently as possible without further input.
std::string recogniseGroup () const
 Attempts to recognise the group corresponding to this presentation.
void writeXMLData (std::ostream &out) const
 Writes a chunk of XML containing this group presentation.
void writeToFile (NFile &out) const
 Writes this group presentation to the given old-style binary file.
virtual void writeTextShort (std::ostream &out) const
 Writes this object in short text format to the given output stream.
virtual void writeTextLong (std::ostream &out) const
 Writes this object in long text format to the given output stream.

Static Public Member Functions

static NGroupPresentationreadFromFile (NFile &in)
 Reads a group presentation from the given old-style binary file.

Protected Attributes

unsigned long nGenerators
 The number of generators.
std::vector< NGroupExpression * > relations
 The relations between the generators.


Detailed Description

Represents a finite presentation of a group.

A presentation consists of a number of generators and a set of relations between these generators that together define the group.

If there are g generators, they will be numbered 0, 1, ..., g-1.

Test:
Tested in the test suite, though not exhaustively.
Todo:
Optimise (long-term): The simplification routines really need work!

Constructor & Destructor Documentation

regina::NGroupPresentation::NGroupPresentation (  )  [inline]

Creates a new presentation with no generators and no relations.

regina::NGroupPresentation::NGroupPresentation ( const NGroupPresentation cloneMe  ) 

Creates a clone of the given group presentation.

Parameters:
cloneMe the presentation to clone.

regina::NGroupPresentation::~NGroupPresentation (  )  [inline, virtual]

Destroys the group presentation.

All relations that are stored will be deallocated.


Member Function Documentation

unsigned long regina::NGroupPresentation::addGenerator ( unsigned long  numToAdd = 1  )  [inline]

Adds one or more generators to the group presentation.

If the new presentation has g generators, the new generators will be numbered g-1, g-2 and so on.

Parameters:
numToAdd the number of generators to add.
Returns:
the number of generators in the new presentation.

void regina::NGroupPresentation::addRelation ( NGroupExpression rel  )  [inline]

Adds the given relation to the group presentation.

The relation must be of the form expression = 1.

This presentation will take ownership of the given expression, may change it and will be responsible for its deallocation.

Python:
Since this group presentation takes ownership of the given expression, the python object containing the given expression becomes a null object and should no longer be used.
Parameters:
rel the expression that the relation sets to 1; for instance, if the relation is g1^2 g2 = 1 then this parameter should be the expression g1^2 g2.

unsigned long regina::NGroupPresentation::getNumberOfGenerators (  )  const [inline]

Returns the number of generators in this group presentation.

Returns:
the number of generators.

unsigned long regina::NGroupPresentation::getNumberOfRelations (  )  const [inline]

Returns the number of relations in this group presentation.

Returns:
the number of relations.

const NGroupExpression & regina::NGroupPresentation::getRelation ( unsigned long  index  )  const [inline]

Returns the relation at the given index in this group presentation.

The relation will be of the form expresson = 1.

Parameters:
index the index of the desired relation; this must be between 0 and getNumberOfRelations()-1 inclusive.
Returns:
the expression that the requested relation sets to 1; for instance, if the relation is g1^2 g2 = 1 then this will be the expression g1^2 g2.

bool regina::NGroupPresentation::intelligentSimplify (  ) 

Attempts to simplify the group presentation as intelligently as possible without further input.

As with the NTriangulation routine of the same name, this routine is not as intelligent as it makes out to be. In fact, currently it does almost nothing.

Todo:
Feature (long-term): Make this simplification more effective.
Returns:
true if and only if the group presentation was changed.

std::string regina::NGroupPresentation::recogniseGroup (  )  const

Attempts to recognise the group corresponding to this presentation.

This routine is much more likely to be successful if you have already called intelligentSimplify().

Note that the presentation might be simplified a little during the execution of this routine, although not nearly as much as would be done by intelligentSimplify().

Todo:
Feature (long-term): Make this recognition more effective.
Returns:
a simple string representation of the group if it is recognised, or an empty string if the group is not recognised.

void regina::NGroupPresentation::writeXMLData ( std::ostream &  out  )  const

Writes a chunk of XML containing this group presentation.

Python:
Not present.
Parameters:
out the output stream to which the XML should be written.

void regina::NGroupPresentation::writeToFile ( NFile out  )  const

Writes this group presentation to the given old-style binary file.

Deprecated:
For the preferred way to write data to file, see writeXMLData() instead.
Precondition:
The given file is currently opened for writing.
Python:
Not present.
Parameters:
out the file to which to write.

static NGroupPresentation* regina::NGroupPresentation::readFromFile ( NFile in  )  [static]

Reads a group presentation from the given old-style binary file.

The presentation will be newly allocated, and responsibility for its destruction lies with the caller of this routine.

Deprecated:
For the preferred way of reading group presentations from file, see class NXMLGroupPresentationReader instead.
Precondition:
The given file is currently opened for reading.
Python:
Not present.
Parameters:
in the file from which to read.
Returns:
a newly allocated presentation read from the given file, or 0 if problems arose.

void regina::NGroupPresentation::writeTextShort ( std::ostream &  out  )  const [inline, virtual]

Writes this object in short text format to the given output stream.

The output should fit on a single line and no newline should be written.

Python:
The parameter out does not exist; standard output will be used.
Parameters:
out the output stream to which to write.

Implements regina::ShareableObject.

virtual void regina::NGroupPresentation::writeTextLong ( std::ostream &  out  )  const [virtual]

Writes this object in long text format to the given output stream.

The output should provided the user with all the information they could want. The output should end with a newline.

The default implementation of this routine merely calls writeTextShort() and adds a newline.

Python:
The parameter out does not exist; standard output will be used.
Parameters:
out the output stream to which to write.

Reimplemented from regina::ShareableObject.


Member Data Documentation

unsigned long regina::NGroupPresentation::nGenerators [protected]

The number of generators.

The relations between the generators.


The documentation for this class was generated from the following file:

Copyright © 1999-2008, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).