本文整理汇总了C++中Permutation::geodesic方法的典型用法代码示例。如果您正苦于以下问题:C++ Permutation::geodesic方法的具体用法?C++ Permutation::geodesic怎么用?C++ Permutation::geodesic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permutation
的用法示例。
在下文中一共展示了Permutation::geodesic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getShortWord
Word ThRightNormalForm::getShortWord( ) const
{
Word result;
Permutation omega = Permutation::getHalfTwistPermutation( getRank( ) );
int power = getPower( );
if( power<0 ) {
const list< Permutation >& decomp = getDecomposition( );
list<Permutation>:: const_iterator it = decomp.begin( );
for( int j=0 ; it!=decomp.end( ) ; ++it, ++j ) {
int n = j - decomp.size( ) - power;
if( n<0 ) {
vector< int > gd = (*it).geodesic();
for( size_t t=0 ; t<gd.size() ; ++t )
result.push_back( gd[t]+1 );
} else {
Permutation p = ( n%2 == 1 ? (*it).inverse() * omega : omega * (*it).inverse() );
vector<int> gd = p.geodesic();
for( int t=gd.size( )-1 ; t>=0 ; --t )
result.push_back( -gd[t]-1 );
}
}
Word omega_w = Word(omega.geodesicWord( ));
omega_w = -omega_w;
for( int j=decomp.size( ) ; j<-power ; ++j )
result = omega_w*result;
} else
result = getWord( );
return result;
}
示例2: getWord
Word ThRightNormalForm::getWord( ) const
{
Word result;
vector< int > decomposition;
vector< int > geodesic;
list<Permutation>::const_iterator it = theDecomposition.begin( );
for( ; it!=theDecomposition.end( ) ; ++it ) {
geodesic = (*it).geodesic( );
for( size_t j=0 ; j<geodesic.size( ) ; ++j )
result.push_back( geodesic[j]+1 );
}
if( theOmegaPower==0 )
return result;
Word omegaWord;
const Permutation omega = Permutation::getHalfTwistPermutation( theRank );
geodesic = omega.geodesic( );
for( size_t i=0 ; i<geodesic.size( ) ; ++i )
omegaWord.push_back( geodesic[i]+1 );
if( theOmegaPower<0 )
omegaWord = -omegaWord;
for( int i=0 ; i<abs(theOmegaPower) ; ++i )
result *= omegaWord;
return result;
}