BKLRightNormalForm.h

Go to the documentation of this file.
00001 // Copyright (C) 2005 Alexander Ushakov
00002 // Contents: Definition of class BKLRightNormalForm
00003 //
00004 // Principal Authors: Alexander Ushakov
00005 //
00006 // Revision History:
00007 //
00008 
00009 #ifndef _BKLRightNormalForm_h_
00010 #define _BKLRightNormalForm_h_
00011 
00012 #include "tuples.h"
00013 #include "Permutation.h"
00014 
00015 #include "vector"
00016 #include "list"
00017 using namespace std ;
00018 
00019 class BraidGroup;
00020 class Word;
00021 
00022 
00023 #define ERROR_EXISTS
00024 
00025 //---------------------------------------------------------------------------//
00026 //--------------------------- BKLRightNormalForm ----------------------------//
00027 //---------------------------------------------------------------------------//
00028 
00029 
00031 
00037 class BKLRightNormalForm
00038 {
00039  public:
00040   
00042 
00047   typedef triple< int , int , list< Permutation > > NF;
00048   
00050   //                                                     //
00051   //  Constructors:                                      //
00052   //                                                     //
00054 
00055  public:
00056   
00058   BKLRightNormalForm( ) : theRank( 0 ) { 
00059 #ifdef ERROR_EXISTS
00060     exit(1);
00061 #endif
00062   }
00063     
00064     
00066   BKLRightNormalForm( const BKLRightNormalForm& bkl ) : 
00067     theOmegaPower( bkl.theOmegaPower ) ,
00068     theDecomposition( bkl.theDecomposition ) { 
00069 #ifdef ERROR_EXISTS
00070     exit(1);
00071 #endif
00072 }
00073 
00074     
00076   BKLRightNormalForm( int rank , int power , const list< Permutation >& decomp ) : 
00077     theRank( rank ) ,
00078     theOmegaPower( power ) ,
00079     theDecomposition( decomp ) { 
00080 #ifdef ERROR_EXISTS
00081     exit(1);
00082 #endif
00083 }
00084   
00085     
00087   BKLRightNormalForm( const BraidGroup& G , const Word& w );
00088 
00089   
00091   //                                                     //
00092   //  Operatos:                                          //
00093   //                                                     //
00095 
00096  public:
00097 
00099   BKLRightNormalForm& operator = ( const BKLRightNormalForm& bkl ) {
00100     theRank = bkl.theRank;
00101     theOmegaPower = bkl.theOmegaPower;
00102     theDecomposition = bkl.theDecomposition;
00103   }
00104 
00106   BKLRightNormalForm& operator = ( const NF& bkl ) {
00107     theRank = bkl.first;
00108     theOmegaPower = bkl.second;
00109     theDecomposition = bkl.third;
00110   }
00111 
00113   BKLRightNormalForm operator- ( ) const { return inverse( ); }
00114   
00115   
00117   BKLRightNormalForm operator* ( const BKLRightNormalForm& bkl ) const { return multiply( bkl ); }
00118 
00119 
00120   bool operator ==( const BKLRightNormalForm& bkl ) const;
00121   bool operator !=( const BKLRightNormalForm& bkl ) const;
00122   bool operator < ( const BKLRightNormalForm& bkl ) const;
00123 
00124 
00126   //                                                     //
00127   //  Accessors:                                         //
00128   //                                                     //
00130 
00131  public:
00132   
00134   int getPower( ) const { return theOmegaPower; }
00135 
00136 
00138   const list< Permutation >& getDecomposition( ) const { return theDecomposition; }
00139   
00140 
00142   operator NF( ) const { return NF( theRank , theOmegaPower , theDecomposition ); }
00143 
00144 
00146   bool isTrivial( ) const { return theOmegaPower==0 && theDecomposition.size()==0; }
00147 
00148   
00150   static Permutation getTinyTwistPermutation( int theIndex ) {
00151     Permutation result( theIndex );
00152     for( int i=0 ; i<theIndex ; ++i )
00153       result[i] = (i+theIndex-1)%theIndex;
00154     return result;
00155   }
00156 
00157 
00159   Word getWord( ) const;
00160 
00161   
00163   static void adjustDecomposition( int rank ,
00164                                    int& power ,
00165                                    list<Permutation>& decomp );
00166   // this function transforms any (reasonable) decomposition
00167   // to a decomposition of a normal form 
00168 
00169 
00171   //                                                     //
00172   //  Modifiers:                                         //
00173   //                                                     //
00175 
00176  public:
00177   
00179   inline void setPower( int p ) { theOmegaPower = p; }
00180 
00182   inline void setDecomposition( const list< Permutation >& d ) { theDecomposition = d; }
00183   
00185   //                                                     //
00186   //  Internal functions:                                //
00187   //                                                     //
00189 
00190  private:
00191 
00193   enum   transformationResult { TWO_MULTIPLIERS , ONE_MULTIPLIER , NO_CHANGE };
00195   static transformationResult transform ( int theIndex , Permutation& p1 , Permutation& p2 );
00196 
00198   BKLRightNormalForm inverse( ) const;
00199   
00200   
00202   BKLRightNormalForm multiply( const BKLRightNormalForm& bkl ) const;
00203 
00204 
00206   //                                                     //
00207   //  Data members:                                      //
00208   //                                                     //
00210 
00211  private:
00212 
00213 
00215   int theRank;
00216   
00217   
00219   int theOmegaPower;
00220 
00221 
00223   list< Permutation > theDecomposition;
00224   
00225 };
00226 
00227 
00228 ostream& operator << ( ostream& os, const BKLRightNormalForm& rep );
00229 
00230 
00231 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Mon Sep 26 18:43:45 2011 for CRyptography And Groups (CRAG) by  doxygen 1.6.1