Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

/magnus/back_end/Group/include/MSCGConjugacyProblem.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: MSCGConjugacyProblem.h,v 1.3 2000/02/09 23:58:10 bormotov Exp $
00003  */
00004 
00005 // Copyright (C) 1995 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: Definition of MSCGConjugacyProblem class.
00009 //           This is a solving of conjugacy problem for metric 
00010 //           small cancellation groups with C'(1/6) condition.
00011 //           
00012 // Principal Authors: Dmitry Bormotov
00013 //
00014 // Status: in progress
00015 //
00016 // Revision History:
00017 //
00018 // Special Remarks:
00019 //
00020 //
00021 
00022 #ifndef _MSCG_CONJUGACY_PROBLEM_H_
00023 #define _MSCG_CONJUGACY_PROBLEM_H_
00024 
00025 #include "MSCGroup.h"
00026 
00027 
00028 // ------------------------ MSCGConjugacyProblem ---------------------------//
00029 
00030 
00031 class MSCGConjugacyProblem {
00032 
00033 
00034 public:
00035 
00036   
00037   /////////////////////////////////////////////////////////////////////////
00038   //                                                                     //
00039   // Constructors:                                                       //
00040   //                                                                     //
00041   /////////////////////////////////////////////////////////////////////////
00042 
00043   // No default constructor
00044 
00045   // Copy constructor provided by compiler (does logical deep copy).
00046 
00047   MSCGConjugacyProblem ( const MSCGroup& G, const Word& u, const Word& v ) : 
00048     MSCG ( G ), U( u.freelyReduce() ), V( v.freelyReduce() ), 
00049     areConjugate ( DONTKNOW ), theConjugator ( ), doneStatus ( false ),
00050     startStatus ( false ), UConjugator( ), VConjugator( ) { };
00051   // To construct a conjugacy problem class with given MSCGroup.
00052 
00053 
00054   /////////////////////////////////////////////////////////////////////////
00055   //                                                                     //
00056   // Activation members:                                                 //
00057   //                                                                     //
00058   /////////////////////////////////////////////////////////////////////////
00059 
00060   void startComputation( );
00061     // Start the computation.      
00062   // You shouldn't call this more than one time.
00063   
00064   bool continueComputation( );
00065   // Advance the computation of conjugacy problem.
00066   // You have to call startComputation() before.
00067   // This function returns true if the computation is done.
00068 
00069 
00070   /////////////////////////////////////////////////////////////////////////
00071   //                                                                     //
00072   // Status Queries:                                                     //
00073   //                                                                     //
00074   /////////////////////////////////////////////////////////////////////////
00075 
00076   bool done( ) const {
00077     return doneStatus;
00078   }
00079   // Is the conjugacy problem done ?
00080 
00081   /////////////////////////////////////////////////////////////////////////
00082   //                                                                     //
00083   // Accessors:                                                          //
00084   //                                                                     //
00085   /////////////////////////////////////////////////////////////////////////
00086 
00087   // You can call all these functions iff the computation is finished
00088   // ( when the done() functions returns true ).
00089 
00090   Trichotomy answer( ) const {
00091 
00092   #if SAFETY > 0
00093     if ( !doneStatus )
00094       error("tried to get answer of conjugate problem before solve it");
00095   #endif
00096     
00097     return areConjugate;
00098   }
00099   // Are the words conjugate ? 
00100 
00101   Word conjugator( ) const {
00102 
00103   #if SAFETY > 0
00104     if ( answer() != YES )
00105       if ( answer() == NO )
00106         error("tried to get conjugator when the words aren't conjugate");
00107       else 
00108         error("tried to get conjugator when result the conjugacy"
00109               " problem is unknown");
00110   #endif
00111     
00112     return theConjugator;
00113   }
00114 
00115  
00116 private:
00117 
00118 
00119   /////////////////////////////////////////////////////////////////////////
00120   //                                                                     //
00121   // Private Functions:                                                  //
00122   //                                                                     //
00123   /////////////////////////////////////////////////////////////////////////
00124 
00125   MSCGConjugacyProblem( const MSCGConjugacyProblem& );
00126   // It is hidden, not implemented.
00127 
00128   MSCGConjugacyProblem& operator = ( const MSCGConjugacyProblem& );
00129   // It is hidden, not implemented.
00130 
00131   void setCPResult( Trichotomy result );
00132   // Set result of conjugacy problem and reset status variables.
00133 
00134   void finishCP( Trichotomy result );
00135   // Finish conjugacy problem ( delete all objects and set result).
00136   
00137 
00138   /////////////////////////////////////////////////////////////////////////
00139   //                                                                     //
00140   // Data Members:                                                       //
00141   //                                                                     //
00142   /////////////////////////////////////////////////////////////////////////
00143 
00144   const MSCGroup& MSCG;    // The MSC group in which we solve a 
00145                            // conjugacy problem
00146   bool doneStatus;         // TRUE if the computation is finished
00147   bool startStatus;        // TRUE if the computation is started
00148   Trichotomy areConjugate; // the result of conjugacy problem
00149   Word theConjugator;      // the conjugator if the words are conjugate
00150   int maxLen;              // maximal length of relators which we 
00151                            // need use for generating pieces
00152   Word UConjugator;
00153   Word VConjugator;
00154 
00155   // This variables contain information for iterations of conjugacy problem
00156 
00157   enum stateType{CYCLE_BY_RELATORS, CYCLE_BY_PIECES, CYCLE_BY_RELATORS2};
00158 
00159   stateType state;         // In what kind of cycle we are now ?
00160   bool firstPart;          // TRUE if we are in first part of algorithm: 
00161                            //   for C'(1/8) condition 
00162   Word U;                  // fisrt argument for conjugacy problem
00163   Word V;                  // second argument for conjugacy problem
00164   int ULen;                // length of U
00165   int VLen;                // length of V
00166   SetOf<Word> cycV;        // the set of cyclic permutations of V
00167 
00168   SymmetricRelators *shortRelators;      
00169   // The set of short relators.
00170   // Only this relators would be able to shorten given word
00171 
00172   SymmetricRelatorsIterator *shortIter;  // symmetric iterators over the
00173   SymmetricRelatorsIterator *shortIter2; // set of relators
00174 
00175   Word relator;        // current relator 
00176   int relatorLen;      // its length
00177   int pieceLen;        // tne length of current piece of current relator
00178   
00179   Word relatorOne;     // the first current relator
00180   int relatorOneLen;   // its length
00181   int pieceOneLen;     // the length of fisrt piece of relatorOne
00182   Word pieceOne;       // the fisrt piece of relatorOne 
00183   Word relatorTwo;     // the second current relator
00184   int relatorTwoLen;   // its length
00185 
00186   
00187   /////////////////////////////////////////////////////////////////////////
00188   //                                                                     //
00189   // Debugging stuff:                                                    //
00190   //                                                                     //
00191   /////////////////////////////////////////////////////////////////////////
00192 
00193 #ifdef DEBUG
00194 
00195   friend int main(...);
00196 
00197 #endif
00198 
00199 };
00200 
00201 #endif

Generated at Tue Jun 19 09:49:36 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001