PolyWord MalcevSet::makeCommutator( PolyWord& pw1, PolyWord& pw2 ) { // commute words PolyWord comm = commutatorOfInverses(pw1, pw2); comm.freelyReduce(); return comm; }
void NilpotentGroupRep::mapToClass( PolyWord& pw, int theClass ) const { if( theClass >= nilpotencyClass() ) return; PolyWordIterator iter(pw); for( iter.startFromLeft(); ! iter.done(); ) { if( commutators().weightOf( ord( iter.thisLetter().gen ) ) > theClass ) iter.removeThisLetter(); else iter.stepRight(); } pw.freelyReduce(); }