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

/magnus/back_end/Genetic/include/WhiteheadOrbit.h

Go to the documentation of this file.
00001 
00002 #ifndef _WHITEHEAD_ORBIT_
00003 #define _WHITEHEAD_ORBIT_
00004 
00005 
00006 #include "Chars.h"
00007 #include "NormalRandomWord.h"
00008 #include "Map.h"
00009 #include "FreeGroup.h"
00010 #include "Word.h"
00011 #include "Vector.h"
00012 //#include "Matrix.h"
00013 //#include "Polynomial.h"
00014 
00015 
00016 const int maxNum = 100;
00017 
00018 // ----------------------- PairOfWords ------------------------------//
00019 
00020 struct PairOfWords{
00021 public:
00022   PairOfWords(): length(0), h(0)  { }
00023   PairOfWords(Word v1, Word v2) : 
00024     w1(v1),
00025     w2(v2), 
00026     length(v1.length()+v2.length()), 
00027     h(v1.hash()+v2.hash()) { }
00028 
00029   PairOfWords(const FPGroup& G);
00030   
00031   PairOfWords( const PairOfWords& p) : w1(p.w1), w2(p.w2), length(p.length), h(p.h) { }
00032 
00033   bool operator == ( const PairOfWords& p) const {
00034     return compare(p);
00035   }
00036 
00037   PairOfWords& operator = (const PairOfWords& p);
00038   
00039 
00040   int hash()const { return h;}
00041   
00042   int getLength() const { return length; }
00043   
00044   friend ostream& operator << ( ostream& ostr, const PairOfWords& T )
00045     {
00046       T.printAsPresentation( ostr );
00047       return ostr;
00048     }
00049   
00050   friend ostream& operator < ( ostream& ostr, const PairOfWords& T )
00051     {
00052       error("Operator ostr < BTree not emplemeted yet");
00053     }
00054   friend istream& operator > ( istream& ostr, const PairOfWords& T )
00055     {
00056       error("Operator istr > BTree not emplemeted yet");
00057     }
00058   
00059 
00060   void printAsPresentation( ostream& o)const;
00061 
00062   bool compare(  const PairOfWords& p) const;
00063   
00064   Word w1;
00065   Word w2;
00066   
00067   int length;
00068   int h;
00069 };
00070 
00071 // ----------------------- WhiteheadGraph ------------------------------//
00072 class WhiteheadGraph
00073 {
00074 public:
00075 
00076   WhiteheadGraph( FreeGroup F, Word w );
00077 
00078   WhiteheadGraph( FreeGroup F, PairOfWords p );
00079 
00080   void reset( Word w );
00081   
00082   const PairOfWords& getMinimalPair() const { return minimalPair; }
00083 
00084   bool compute(int* flags = NULL, int curOrbit = 0 );
00085 
00086   void computeMinimalOrbit();
00087     
00088   int nOfSameLength() const;
00089 
00090   int nTotal() const;
00091 
00092   const SetOf<PairOfWords>&  getMinimalOrbit()const;
00093    
00094 private:
00095   void initialize();
00096 
00097   Word apply( const Word& u, int trNum );
00098 
00099   FreeGroup theGroup;
00100   PairOfWords thePair;
00101 
00102   int numberOfGens;
00103   int numberOfTrans;
00104   VectorOf<Word> transferImage;
00105   VectorOf<Word> transformations;
00106 
00107   SetOf<PairOfWords> all;
00108   SetOf<PairOfWords> I;
00109   SetOf<PairOfWords> Ip;
00110   int nOfTotal;
00111   PairOfWords minimalPair;
00112   SetOf<PairOfWords> minimalOrbit;
00113 
00114 };
00115 
00116 
00117 #endif

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