00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _ThLeftNormalForm_h_
00011 #define _ThLeftNormalForm_h_
00012
00013 #include "tuples.h"
00014 #include "Permutation.h"
00015
00016 #include "vector"
00017 #include "list"
00018 using namespace std;
00019
00020
00021 class ThRightNormalForm;
00022 class BraidGroup;
00023 class Word;
00024
00025
00026
00027
00028
00029
00030
00032
00045 class ThLeftNormalForm
00046 {
00047
00049
00054 typedef triple< int , int , list< Permutation > > NF;
00055
00057
00058
00059
00061
00062 public:
00063
00064
00066
00070 ThLeftNormalForm( int rank=0 ) :
00071 theRank( rank ) ,
00072 theOmegaPower( 0 ) ,
00073 theDecomposition( ) { }
00074
00075
00076 ThLeftNormalForm( const ThLeftNormalForm& rep ) :
00077 theRank( rep.theRank ),
00078 theOmegaPower( rep.theOmegaPower ) ,
00079 theDecomposition( rep.theDecomposition ) { }
00080
00081
00083
00087 ThLeftNormalForm( int rank , int p , const list< Permutation >& d ) :
00088 theRank( rank ),
00089 theOmegaPower( p ) ,
00090 theDecomposition( d ) { }
00091
00092 ThLeftNormalForm( const NF& pr ) :
00093 theRank( pr.first ) ,
00094 theOmegaPower( pr.second ) ,
00095 theDecomposition( pr.third ) { }
00096
00098 ThLeftNormalForm( const BraidGroup& G , const Word& w );
00099
00100
00102 ThLeftNormalForm( const Permutation& p ) {
00103 theRank = p.size( );
00104 Permutation omega = Permutation::getHalfTwistPermutation( theRank );
00105 if( p.isTrivial( ) ) {
00106 theOmegaPower = 0;
00107 } else if( p==omega ) {
00108 theOmegaPower = 1;
00109 } else {
00110 theOmegaPower = 0;
00111 theDecomposition.push_back( p );
00112 }
00113 }
00114
00115
00117
00118
00119
00121 public:
00122
00123
00125 ThLeftNormalForm& operator = ( const ThLeftNormalForm& rep ) {
00126 theRank = rep.theRank;
00127 theOmegaPower = rep.theOmegaPower;
00128 theDecomposition = rep.theDecomposition;
00129 }
00130
00131
00133 ThLeftNormalForm& operator = ( const NF& pr ) {
00134 theRank = pr.first;
00135 theOmegaPower = pr.second;
00136 theDecomposition = pr.third;
00137 }
00138
00139
00141 bool operator==( const ThLeftNormalForm& rep ) const;
00142
00143
00145 bool operator != ( const ThLeftNormalForm& rep ) const {
00146 return
00147 theRank!=rep.theRank ||
00148 theOmegaPower!=rep.theOmegaPower ||
00149 theDecomposition!=rep.theDecomposition;
00150 }
00151
00152
00154 bool operator < ( const ThLeftNormalForm& rep ) const {
00155 if( theRank<rep.theRank )
00156 return true;
00157 if( theRank>rep.theRank )
00158 return false;
00159 if( theOmegaPower<rep.theOmegaPower )
00160 return true;
00161 if( theOmegaPower>rep.theOmegaPower )
00162 return false;
00163 return theDecomposition<rep.theDecomposition;
00164 }
00165
00166
00167
00168 ThLeftNormalForm operator - ( ) const { return inverse( ); }
00169
00170
00172 ThLeftNormalForm operator * ( const ThLeftNormalForm& pr ) const { return multiply( pr ); }
00173
00174
00176 ThLeftNormalForm& operator *= ( const ThLeftNormalForm& rep ) {
00177 *this = multiply( rep );
00178 return *this;
00179 }
00180
00181
00183 operator NF( ) const { return NF( theRank , theOmegaPower , theDecomposition ); }
00184
00186 operator ThRightNormalForm( ) const;
00187
00188
00189
00191
00192
00193
00195
00196 public:
00197
00199 inline int getRank ( ) const { return theRank; }
00201 inline int getPower( ) const { return theOmegaPower; }
00203 inline const list< Permutation >& getDecomposition( ) const { return theDecomposition; }
00204
00205
00207 bool isTrivial( ) const {
00208 return theOmegaPower==0 && theDecomposition.size( )==0;
00209 }
00210
00212
00217 ThLeftNormalForm increaseRank( int N ) const;
00218
00219
00220 ThLeftNormalForm inverse( ) const;
00221 ThLeftNormalForm multiply( const ThLeftNormalForm& rep ) const;
00222
00223
00225
00229 Word getWord( ) const;
00230
00231
00232 static void adjustDecomposition( int rank , int& power , list<Permutation>& decomp );
00233
00234 void adjust( ) { adjustDecomposition( theRank , theOmegaPower , theDecomposition ); }
00235
00236
00238
00239
00240
00242
00243 public:
00244
00246
00250 triple< ThLeftNormalForm , ThLeftNormalForm , int > findUSSRepresentative( ) const;
00251
00252
00254
00259 Permutation getTransport( const ThLeftNormalForm& B , const Permutation& u ) const;
00260
00262
00267 set< Permutation > getTransports( const Permutation& u , int period ) const;
00268
00269
00271
00276 Permutation getPullback( const Permutation& s ) const;
00277
00278
00280
00281
00282
00283
00284 Permutation getMainPullback( const Permutation& s , int period ) const;
00285
00286
00287
00289 int computePeriod( ) const;
00290
00291
00293
00299 pair< Permutation , bool > getSimpleUltraConjugator( int period , const Permutation& start ) const;
00300
00301
00303 set< pair< Permutation , bool > > getSimpleUltraConjugators( int period ) const;
00304
00305
00307
00310 pair< bool , ThLeftNormalForm > areConjugate_uss( const ThLeftNormalForm& nf , int time_sec_bound=999999 ) const;
00311
00312
00314
00315
00316
00318
00319 private:
00320
00322 pair< bool , ThLeftNormalForm >
00323 ussConstructionIteration( map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_new1 ,
00324 map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_checked1 ,
00325 const map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_new2 ,
00326 const map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_checked2 ) const;
00327
00328
00330 pair< bool , ThLeftNormalForm >
00331 ussAddTrajectory( const ThLeftNormalForm& new_elt , const ThLeftNormalForm& new_conjugator ,
00332 map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_new1 ,
00333 map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_checked1 ,
00334 const map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_new2 ,
00335 const map< ThLeftNormalForm , pair< ThLeftNormalForm , int > >& uss_checked2 ) const;
00336
00337
00339
00340
00341
00343
00344 public:
00345
00346 inline void setPower( int p )
00347 { theOmegaPower = p; }
00348 inline void setDecomposition( const list< Permutation >& d )
00349 { theDecomposition = d; }
00350
00352
00353
00354
00356 public:
00357
00359
00365 pair< ThLeftNormalForm , ThLeftNormalForm > cycle( ) const;
00366
00367
00368
00370
00376 pair< ThLeftNormalForm , ThLeftNormalForm > decycle( ) const;
00377
00378
00379
00380 pair< ThLeftNormalForm , ThLeftNormalForm > findSSSRepresentative( ) const;
00381
00382
00384
00388 Permutation getSimpleConjugator( const Permutation& start ) const;
00389
00390
00392
00398 set< Permutation > getSimpleConjugators( ) const;
00399
00400
00402
00407 Permutation getSimpleSummitConjugator( const Permutation& start ) const;
00408
00409
00411
00418 set< Permutation > getSimpleSummitConjugators( ) const;
00419
00420
00422
00429 pair< bool , ThLeftNormalForm > areConjugate( const ThLeftNormalForm& rep ) const;
00430
00431
00433
00434
00435
00437
00438 private:
00439
00440 enum transformationResult { TWO_MULTIPLIERS , ONE_MULTIPLIER , NO_CHANGE };
00441 static transformationResult transform ( int theIndex , Permutation& p1 , Permutation& p2 );
00442
00443 static void reverse( NF& pr );
00444
00446
00447
00448
00450
00451 private:
00452
00454 int theRank;
00455
00457 int theOmegaPower;
00458
00460 list< Permutation > theDecomposition;
00461
00462 };
00463
00464
00465 ostream& operator << ( ostream& os, const ThLeftNormalForm& rep );
00466
00467
00468 #endif