Map Class Reference

Defines a representation of a map between two sets of words. More...

#include <Map.h>

List of all members.

Public Member Functions

 Map (int domain_gens, int range_gens)
 Default constructor.
 Map (int domain_gens, int range_gens, const vector< Word > &generatingImages)
 Constructor. Creates a map defined by the images of an alphabet.
 Map (const FiniteAlphabet &domain_alph, const FiniteAlphabet &range_alph)
 Constructor. Creates a trivial map.
 Map (const FiniteAlphabet &domain_alph, const FiniteAlphabet &range_alph, const vector< Word > &generatingImages)
 Constructor. Creates a map defined by the images of an alphabet.
bool operator== (const Map &m) const
 Comparison operator.
int domainSize () const
 Returns the size of the domain's alphabet.
const FiniteAlphabetdomainAlphabet () const
 Returns domain's alphabet.
int rangeSize () const
 Returns the size of the range's alphabet.
const FiniteAlphabetrangeAlphabet () const
 Returns range's alphabet.
const vector< Word > & generatingImages () const
 Returns the vector of images.
Word generatingImages (int i) const
 Return the image of the ith letter.
void setGeneratingImages (const vector< Word > gi)
 Sets or modifies generating images.
void setGeneratingImages (int i, const Word &e)
 Assigns to the i-th (0-based) generating image.
Word imageOf (const Word &w) const
 Compute the image of a word.
Map operator| (const Map &secondMap)
 Map composition operator.
void printOn (ostream &ostr) const
 Stream output.
void readFrom (istream &in)
 Stream input.

Private Member Functions

char readChar (istream &in) const

Private Attributes

int theDomain
int theRange
vector< WordtheGeneratingImages
FiniteAlphabet theDomainAlphabet
FiniteAlphabet theRangeAlphabet

Friends

Map composition (const Map &firstMap, const Map &secondMap)
 Map-theoretic composition.
ostream & operator<< (ostream &out, const Map &m)
 Stream output operator.
istream & operator>> (istream &in, Map &m)
 Stream input operator.

Detailed Description

Defines a representation of a map between two sets of words.

Both the domain and the range of a map are defined by finite alphabets.

Definition at line 22 of file Map.h.


Constructor & Destructor Documentation

Map::Map ( int  domain_gens,
int  range_gens 
) [inline]

Default constructor.

Constructor. Creates a trivial map.

If no images of letters of the domain are specified the map, by default, becomes the trivial map, i.e. the map mapping everything to the identity.

Parameters:
domain_gens - the size of the domain's alphabet
range_gens - the size of the range's alphabet

Definition at line 45 of file Map.h.

Map::Map ( int  domain_gens,
int  range_gens,
const vector< Word > &  generatingImages 
) [inline]

Constructor. Creates a map defined by the images of an alphabet.

Constructs a map, given a domain and range group, and images for the generators of the domain

Parameters:
domain_gens - the size of the domain's alphabet
range_gens - the size of the range's alphabet
generatingImages - vector of images of letters of the domain.

Definition at line 60 of file Map.h.

References msgs::error().

Map::Map ( const FiniteAlphabet domain_alph,
const FiniteAlphabet range_alph 
) [inline]

Constructor. Creates a trivial map.

If no images of letters of the domain are specified the map, by default, becomes the trivial map, i.e. the map mapping everything to the identity.

Parameters:
domain_alph - alphabet of the domain
range_alph - alphabet of the range

Definition at line 80 of file Map.h.

Map::Map ( const FiniteAlphabet domain_alph,
const FiniteAlphabet range_alph,
const vector< Word > &  generatingImages 
) [inline]

Constructor. Creates a map defined by the images of an alphabet.

Constructs a map, given a domain and range group, and images for the generators of the domain

Parameters:
domain_alph - alphabet of the domain
range_alph - alphabet of the range
generatingImages - vector of images of letters of the domain.

Definition at line 95 of file Map.h.

References msgs::error(), and theDomain.


Member Function Documentation

const FiniteAlphabet& Map::domainAlphabet (  )  const [inline]

Returns domain's alphabet.

Definition at line 136 of file Map.h.

References theDomainAlphabet.

int Map::domainSize (  )  const [inline]

Returns the size of the domain's alphabet.

Definition at line 133 of file Map.h.

References theDomain.

Word Map::generatingImages ( int  i  )  const [inline]

Return the image of the ith letter.

Definition at line 149 of file Map.h.

References msgs::error(), theDomain, and theGeneratingImages.

const vector<Word>& Map::generatingImages (  )  const [inline]

Returns the vector of images.

Definition at line 146 of file Map.h.

References theGeneratingImages.

Referenced by __gnu_cxx::map_hash::operator()().

Word Map::imageOf ( const Word w  )  const

Compute the image of a word.

Takes a formal word in the generators of domain and evaluates its `image' in range. The image is computed as follows. Let input word $ w = x_1 x_2 \ldots x_n,$ where $x_i \in $ Domain and $image(x) \in $ Range be the image of the letter x, then image of w - $image(w) = image(x_1) image(x_2) \ldots image(x_n)$

Parameters:
w - a word in the domain
Returns:
an image of w.
bool Map::operator== ( const Map m  )  const [inline]

Comparison operator.

Two maps are equal if the sizes of domains and ranges coincide respectively and images are defined by the same words.

Definition at line 121 of file Map.h.

References theDomain, theGeneratingImages, and theRange.

Map Map::operator| ( const Map secondMap  )  [inline]

Map composition operator.

See composition( ... ) for details.

Definition at line 218 of file Map.h.

References composition.

void Map::printOn ( ostream &  ostr  )  const

Stream output.

const FiniteAlphabet& Map::rangeAlphabet (  )  const [inline]

Returns range's alphabet.

Definition at line 142 of file Map.h.

References theRangeAlphabet.

int Map::rangeSize (  )  const [inline]

Returns the size of the range's alphabet.

Definition at line 139 of file Map.h.

References theRange.

char Map::readChar ( istream &  in  )  const [private]
void Map::readFrom ( istream &  in  ) 

Stream input.

void Map::setGeneratingImages ( int  i,
const Word e 
) [inline]

Assigns to the i-th (0-based) generating image.

Parameters:
i - the index of a letter
e - the new image

Definition at line 170 of file Map.h.

References msgs::error(), theDomain, and theGeneratingImages.

void Map::setGeneratingImages ( const vector< Word gi  )  [inline]

Sets or modifies generating images.

Definition at line 157 of file Map.h.

References msgs::error(), theDomain, and theGeneratingImages.


Friends And Related Function Documentation

Map composition ( const Map firstMap,
const Map secondMap 
) [friend]

Map-theoretic composition.

Returns the composition of two maps

Parameters:
firstMap - the first map
secondMap - the second map
Returns:
return the map constructed as a composition secondMap(firstMap)

Referenced by operator|().

ostream& operator<< ( ostream &  out,
const Map m 
) [friend]

Stream output operator.

Definition at line 233 of file Map.h.

istream& operator>> ( istream &  in,
Map m 
) [friend]

Stream input operator.

Definition at line 239 of file Map.h.


Member Data Documentation

int Map::theDomain [private]

Definition at line 254 of file Map.h.

Referenced by domainSize(), generatingImages(), Map(), operator==(), and setGeneratingImages().

Definition at line 258 of file Map.h.

Referenced by domainAlphabet().

vector<Word> Map::theGeneratingImages [private]

Definition at line 256 of file Map.h.

Referenced by generatingImages(), operator==(), and setGeneratingImages().

int Map::theRange [private]

Definition at line 255 of file Map.h.

Referenced by operator==(), and rangeSize().

Definition at line 259 of file Map.h.

Referenced by rangeAlphabet().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Mon Sep 26 18:43:48 2011 for CRyptography And Groups (CRAG) by  doxygen 1.6.1