Word Map::imageOf( const Generator& g ) const { if (ord(g) < 0) return generatingImages(-ord(g) - 1).inverse(); else return generatingImages(ord(g) - 1); }
void Map::setDomain( const FGGroup& g ) { change()->theDomain = g; if (generatingImages().length() != g.numberOfGenerators()) setGeneratingImages( VectorOf<Word>( g.numberOfGenerators(), generatingImages() ) ); }
void Map::printOn(ostream& ostr) const { ostr << "{ "; int len = generatingImages().size(); for( int i = 0; i < len; ++i ) { if ( i > 0 ) ostr << ", "; theDomainAlphabet.printWord(ostr,Word( i+1)); ostr << " -> "; theRangeAlphabet.printWord(ostr, generatingImages(i)); } ostr << " }"; }
void Map::printOn(ostream& ostr) const { // Due to front end requirements, this can not use newlines, which // is a pain. //@db ostr << "{ "; int len = generatingImages().length(); for( int i = 0; i < len; ++i ) { if ( i > 0 ) ostr << ", "; domain().printGenerator(ostr, i + 1); ostr << " -> "; range().printWord(ostr, generatingImages(i)); } //@db ostr << " }"; }
Trichotomy Map::isTrivialMap( ) const { // @stc temporary hack; this is not even correct, since it does not // check whether the generators of the domain are trivial. int i = generatingImages().length(); Trichotomy answer = TRUE; while (answer != NO && i-- > 0) { // loop if answer != NO Trichotomy check = range().isTrivialElt(generatingImages(i)); if ( check == dontknow ) { answer = DONTKNOW; break; } else if ( check == no ) { answer = NO; break; } } return answer; }