LinkedBraidStructure_old.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
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
00020
00021
00023
00029 struct BraidNode
00030 {
00031
00032
00033
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
00090
00091
00092
00093
00094
00095
00096
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
00103
00105 bool type;
00106
00108 mutable bool marked;
00109 };
00110
00111
00112
00113
00114
00115
00116
00117 class LinkedBraidStructure
00118 {
00120
00121
00122
00124 public:
00125
00126 LinkedBraidStructure( int N );
00127 ~LinkedBraidStructure( );
00128
00129
00131
00132
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
00154
00156 private:
00157
00159 void processNode( list< int >& result , int index , const BraidNode* bn ) const;
00160
00162
00163
00164
00166 private:
00167
00168 int theRank;
00169
00170
00171 vector< BraidNode* > frontNodes;
00172 vector< BraidNode* > backNodes;
00173
00174
00175 mutable bool theMark;
00176 };
00177
00178
00179 #endif
00180