本文整理汇总了C++中PolyWord::firstLetter方法的典型用法代码示例。如果您正苦于以下问题:C++ PolyWord::firstLetter方法的具体用法?C++ PolyWord::firstLetter怎么用?C++ PolyWord::firstLetter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolyWord
的用法示例。
在下文中一共展示了PolyWord::firstLetter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mapToQuotient
AbelianGroup MalcevSet::mapToQuotient(int k) const {
if( ! isBasis )
error("MalcevSet::mapToQuotient: the set must be full");
// The generators of the quotient are basic commutators of weight k.
const BasicCommutators& bc = theCollector.commutators();
int numGen = bc.numberOfWeight(k);
int firstGen = bc.theFirstOfWeight(k) - 1;
// The relators are Malcev basis words of weight k
SetOf<Word> relsForAbelian;
QuickAssociationsIterator< Generator, PolyWord > iter(theSet);
for( ; ! iter.done(); iter.next() ) {
// take a word from Malcev basis
PolyWord pw = iter.value();
Letter first = pw.firstLetter();
if( ord(first.gen) != firstGen ) continue;
//Ok, this is a word from the quotient. Abelianize it.
ConstPolyWordIterator iter( pw );
Word w;
for(iter.startFromLeft(); ! iter.done(); iter.stepRight() ) {
Letter s = iter.thisLetter();
int newgen = ord(s.gen) - firstGen;
if( newgen > numGen ) break;
s.gen = Generator( newgen );
w *= Word(s);
}
relsForAbelian.adjoinElement(w);
}
// make the abelian quotient
AbelianGroup abel( FPGroup(numGen, relsForAbelian) );
abel.computeCyclicDecomposition();
return abel;
}