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

/magnus/back_end/AProducts/include/Whitehead.h

Go to the documentation of this file.
00001 // Copyright (C) 1997 The New York Group Theory Cooperative
00002 // See magnus/doc/COPYRIGHT for the full notice.
00003 
00004 // Contents: Declaration of ElementaryWhiteheadAuto and 
00005 //           WhiteheadAuto classes.
00006 //           
00007 //
00008 // Principal Authors: Dmitry Pechkin
00009 //
00010 // Status: in progress
00011 //
00012 // Revision History:
00013 //
00014 // Special remarks:
00015 //
00016 
00017 
00018 #ifndef _WHITEHEAD_H_
00019 #define _WHITEHEAD_H_
00020 
00021 #include "Set.h"
00022 #include "List.h"
00023 #include "Word.h"
00024 #include "Automorphism.h"
00025 
00026 
00027 //////////////////////////////////////////////////////////////
00028 //                                                          //
00029 //   Class ElementaryWhiteheadAuto                          //
00030 //                                                          //
00031 //////////////////////////////////////////////////////////////
00032 
00033 
00034 typedef enum { WA_INVERSE, WA_PERMUTATION, WA_LEFT_MULT, WA_RIGHT_MULT } 
00035         WhiteheadAutoType;
00036 
00037 class ElementaryWhiteheadAuto 
00038 {
00039 public:
00040 
00041   // No default constructor.
00042 
00043   ElementaryWhiteheadAuto( const Generator& x );
00044   // Construct an elementary Whitehead automorphism:
00045   //   x -> x^-1 (WA_INVERSE)
00046   
00047   ElementaryWhiteheadAuto( const Generator& x, const Generator& y, 
00048                            const WhiteheadAutoType& wat );
00049   // Construct an elementary Whitehead automorphism:
00050   //  x <-> y     (WA_PERMUTATION), generators must have same order (+1/-1).
00051   //  x -> y * x  (WA_LEFT_MULT)
00052   //  x -> x * y  (WA_RIGHT_MULT)
00053 
00054   // Copy constructor, operator= and destructor supplied by compiler.
00055 
00056   Generator x( ) const;
00057   // Returns first generator of Whitehead auto.
00058 
00059   Generator y( ) const;
00060   // Returns second generator of Whitehead auto.
00061   // If the last one is inverse then the call of the method is prohibited.
00062 
00063   Word imageOf( const Word& w ) const;
00064   // Returns an image of the given word under the Whitehead automorphism.
00065 
00066   ElementaryWhiteheadAuto inverse( ) const;
00067   // Return the inverse of the automorphism.
00068  
00069   WhiteheadAutoType type( ) const { return theType; }
00070   // Returns a type of the Whitehead automorphism.
00071 
00072   void printOn( ostream& ostr ) const;
00073   // Prints the automorphism on stream with standard names of generators
00074   // (i.e. x1, x2, etc.)
00075   
00076   void printOn( ostream& ostr, const VectorOf<Chars>& names ) const;
00077   // Prints the automorphism on stream using given names of generators.
00078 
00079 private:
00080 
00081   void printGenerator( ostream& ostr, const Generator& g ) const;
00082 
00083   void printGenerator( ostream& ostr, const Generator& g,
00084                        const VectorOf<Chars>& names ) const;
00085 
00086   WhiteheadAutoType theType;
00087 
00088   Generator g1, g2;
00089 };
00090 
00091 inline Generator ElementaryWhiteheadAuto::x( ) const { return g1; }
00092 
00093 inline Generator ElementaryWhiteheadAuto::y( ) const
00094 {
00095 #if SAFETY > 0
00096   if( theType == WA_INVERSE ) 
00097     error("Retrieving second generator of an ElementaryWhiteheadAuto "
00098           "while the type of the auto is WA_INVERSE.");
00099 #endif
00100 
00101   return g2;
00102 }
00103 
00104 inline ostream& operator << ( ostream& ostr, const ElementaryWhiteheadAuto& aut )
00105 {
00106   aut.printOn( ostr );
00107   return ostr;
00108 }
00109 
00110 inline bool operator == ( const ElementaryWhiteheadAuto& u, 
00111                           const ElementaryWhiteheadAuto& w )
00112 {
00113   return ( u.type() == w.type() && u.x() == w.x() && u.y() == w.y() );
00114 }
00115 
00116 inline bool operator != ( const ElementaryWhiteheadAuto& u, 
00117                           const ElementaryWhiteheadAuto& w )
00118 {
00119   return !( u == w );
00120 }
00121 
00122 //////////////////////////////////////////////////////////////
00123 //                                                          //
00124 //   Class WhiteheadAuto                                    //
00125 //                                                          //
00126 //////////////////////////////////////////////////////////////
00127 
00128 class WhiteheadAuto 
00129 {
00130 public:
00131 
00132   WhiteheadAuto() {} // is treated as identity automorphism.
00133   WhiteheadAuto(const ElementaryWhiteheadAuto& a) : autoList(a) {}
00134   WhiteheadAuto(const ListOf<ElementaryWhiteheadAuto>& list) : autoList(list) {}
00135 
00136   // copy constructor, operator= and destructor supplied by compiler.
00137 
00138   // Accessors:
00139 
00140   ListOf<ElementaryWhiteheadAuto> getAutoList() const { return autoList; }
00141 
00142   // Methods:
00143 
00144   WhiteheadAuto inverse() const;
00145 
00146   Word imageOf(const Word& w) const;
00147   // Returns an image of the given word under the Whitehead automorphisms.
00148 
00149   Automorphism makeAutomorphism(const FGGroup& G) const;
00150   // Converts the given WhiteheadAuto into Automorphism acting on group G
00151 
00152   void printOn( ostream& ostr ) const;
00153 
00154 private:
00155 
00156   // data members
00157 
00158   ListOf<ElementaryWhiteheadAuto> autoList;
00159 };
00160 
00161 
00162 inline bool operator==(const WhiteheadAuto& u, const WhiteheadAuto& w) 
00163 {
00164   return ( u.getAutoList() == w.getAutoList() );
00165 }
00166 // the comparison is unsatisfactory because we don't reduce
00167 // inverse pairs. We didn't need this method...
00168 
00169 inline Word operator | (Word& w, ElementaryWhiteheadAuto& ewa) 
00170 {
00171   return ewa.imageOf(w);
00172 }
00173 
00174 inline Word operator | (const Word& w, const WhiteheadAuto& wa) 
00175 {
00176   return wa.imageOf(w);
00177 }
00178 
00179 inline WhiteheadAuto operator | (const WhiteheadAuto& wa1, const WhiteheadAuto& wa2)
00180 {       
00181   return WhiteheadAuto(concatenate(wa1.getAutoList(),wa2.getAutoList())); 
00182 }
00183 
00184 inline WhiteheadAuto& operator |= ( WhiteheadAuto& wa1, const WhiteheadAuto& wa2)
00185 {       
00186   wa1 = WhiteheadAuto(concatenate(wa1.getAutoList(),wa2.getAutoList())); 
00187   return wa1;
00188 }
00189 
00190 inline ostream& operator << ( ostream& ostr, const WhiteheadAuto& wa ) 
00191 {
00192   wa.printOn( ostr );
00193   return ostr;
00194 }
00195 
00196 
00197 WhiteheadAuto whiteheadDecomposition( const VectorOf<Word>& vec );
00198 
00199 #endif
00200 
00201 
00202 

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