LinkedBraidStructure_old.h

Go to the documentation of this file.
00001 // Copyright (C) 2005 Alexander Ushakov
00002 // Contents: Definition of class BraidNode
00003 //
00004 // Principal Authors: Alexander Ushakov
00005 //
00006 // Revision History:
00007 //
00008 
00009 #ifndef _LinkedBraidStructure_h_
00010 #define _LinkedBraidStructure_h_
00011 
00012 
00013 #include "list"
00014 #include "vector"
00015 using namespace std;
00016 
00017 
00018 //---------------------------------------------------------------------------//
00019 //------------------------------ BraidNode ----------------------------------//
00020 //---------------------------------------------------------------------------//
00021 
00023 
00029 struct BraidNode
00030 {
00031   
00032   // BraidNode( ) : left( 0 ), ahead( 0 ), right( 0 ),
00033   // back_left( 0 ), back( 0 ), back_right( 0 ) , marked( 0 ) { }
00034   
00036   BraidNode( bool m=false ) : left( 0 ), ahead( 0 ), right( 0 ),
00037                         back_left( 0 ), back( 0 ), back_right( 0 ) , marked( m ) { }
00038   
00040 
00046   BraidNode* left;
00047   
00049 
00053   BraidNode* ahead;
00054 
00056 
00062   BraidNode* right;
00063 
00065 
00071   BraidNode* back_left;
00072 
00074 
00078   BraidNode* back;
00079 
00081 
00087   BraidNode* back_right;
00088 
00089   // bool ahead_left_order;
00090   // bool ahead_right_order;
00091   // shows the order of links ahead (0 - center first, 1 - sides first)
00092   // bool back_left_order;
00093   // bool back_right_order;
00094   // shows the order of links back (0 - center first, 1 - sides first)
00095 
00096   // static void addNode( vector< BraidNode* >& frontNodes , int g );
00097   static bool isHandle( vector< BraidNode* >& backNodes , int g );
00098   static void removeHandle( vector< BraidNode* >& frontNodes , vector< BraidNode* >& backNodes , int g , list< int >& processedHandle );
00099   static void removeNodeTerminalClosure( vector< BraidNode* >& frontNodes , vector< BraidNode* >& backNodes , int g , BraidNode* node , list< int >& removedClosure );
00100   static void removeTerminalNode( vector< BraidNode* >& frontNodes , vector< BraidNode* >& backNodes , int g , BraidNode* node , list< int >& removedClosure );
00101 
00102   // static list< int > translateIntoWord( vector< BraidNode* >& frontNodes );
00103 
00105   bool type;
00106   
00108   mutable bool marked;
00109 };
00110 
00111 
00112 //---------------------------------------------------------------------------//
00113 //--------------------------- LinkedBraidStructure --------------------------//
00114 //---------------------------------------------------------------------------//
00115 
00116 
00117 class LinkedBraidStructure
00118 {
00120   //                                                     //
00121   //  Constructors                                       //
00122   //                                                     //
00124  public:
00125 
00126   LinkedBraidStructure( int N );
00127   ~LinkedBraidStructure( );
00128   
00129   
00131   //                                                     //
00132   //  Accessors:                                         //
00133   //                                                     //
00135 
00136  public:
00137   
00138   void push_back( int i );
00139   template< class ConstIntIterator >
00140     void push_back( ConstIntIterator B , ConstIntIterator E ) {
00141     for( ; B!=E ; ++B )
00142       push_back( *B );
00143   }
00144   
00145   void clear( );
00146   void push_front( int i );
00147 
00148   void transformToDehornoyForm( );
00149   list< int > getWord( ) const;
00150 
00152   //                                                     //
00153   //  Internal functions:                                //
00154   //                                                     //
00156 private:
00157 
00159   void processNode( list< int >& result , int index , const BraidNode* bn ) const;
00160 
00162   //                                                     //
00163   //  Data members                                       //
00164   //                                                     //
00166 private:
00167 
00168   int theRank;
00169   // specifies the number of strands (number of generators + 1)
00170   
00171   vector< BraidNode* > frontNodes;
00172   vector< BraidNode* > backNodes;
00173   
00174   // Auxiliary variable. Used in getWord to specify the type of the last mark.
00175   mutable bool theMark;
00176 };
00177 
00178 
00179 #endif
00180 
 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