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

/magnus/back_end/Group/include/FreeGroup.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: FreeGroup.h,v 1.10 2000/02/09 23:58:07 bormotov Exp $
00003  */
00004 
00005 // Copyright (C) 1994 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: Definition of the FreeGroup class.
00009 //
00010 // Principal Authors: Stephane Collart, Roger Needham
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 // Usage: @rn move to manual discussion of IStreamPoll
00017 //
00018 // * I/O:
00019 //   The normal high-level i/o is performed by the operators
00020 //              ostr << G;
00021 //    istr >> G;
00022 //       The former returns an ostream&, the latter returns an intermediate
00023 //       type IStreamPoll, which is automatically converted depending on how
00024 //   you use it. It can become
00025 //   - an int, to do
00026 //           FreeGroup G[20]; int i = 0;
00027 //           while ( i < 20 && cin >> G[i]) i++;
00028 //   - a Chars, to poll an error message
00029 //           FreeGroup F;
00030 //           Chars errMesg = cin >> F;
00031 //   - an istream, to concatenate in the usual manner
00032 //           cin >> F >> G;
00033 //
00034 // Special Notes:
00035 //
00036 // * Tentatively, FreeGroup derives directly from FGGroup;
00037 //   in other words a free group is not treated as a special case of a
00038 //   FPGroup where the set of relators is empty, but as
00039 //   an instance of a FGGroup with a known representation
00040 //   for the elements, freely reduced words.
00041 //
00042 // Questions:
00043 //
00044 // * how much of the functions do we want to be (pseudo-) virtual?
00045 //
00046 
00047 #ifndef _FREE_GROUP_H_
00048 #define _FREE_GROUP_H_
00049 
00050 #include "FGGroup.h"
00051 #include "FreeGroupRep.h"
00052 #include "Map.h"
00053 #include "File.h"
00054 
00055 class Aut; // Doesn't exist yet
00056 
00057 class FreeGroup : public DerivedObjectOf<FGGroup,FreeGroupRep> {
00058   
00059 public:
00060   
00061   ///////////////////////////////////////////////////////
00062   //                                                   //
00063   //  Constructors                                     //
00064   //                                                   //
00065   ///////////////////////////////////////////////////////
00066   
00067   // Copy constructor provided by compiler
00068 
00069   FreeGroup( int rank = 0 ) :
00070     DerivedObjectOf<FGGroup,FreeGroupRep>( new FreeGroupRep(rank) ) { }
00071   // To construct a group of given rank.
00072   // Default constructor gives trivial group with rank 0.
00073   
00074   FreeGroup( const VectorOf<Chars>& gennames ) :
00075     DerivedObjectOf<FGGroup,FreeGroupRep>( new FreeGroupRep(gennames) ) { }
00076   // To construct a group with named generators.
00077   
00078   // Destructor provided by compiler.
00079   
00080   ///////////////////////////////////////////////////////
00081   //                                                   //
00082   //  Operators                                        //
00083   //                                                   //
00084   ///////////////////////////////////////////////////////
00085 
00086   // assignement operator provided by compiler
00087   
00088   ///////////////////////////////////////////////////////
00089   //                                                   //
00090   //  Accessors                                        //
00091   //                                                   //
00092   ///////////////////////////////////////////////////////
00093 
00094   static Type type( ) { return FreeGroupRep::type(); }
00095   // dominates FGGroup::type();
00096 
00097   // Inherited from FGGroup: @rn update
00098   //  Type actualType() const; // pseudo-virtual
00099   //  int numberOfGenerators( ) const
00100   //  Chars nameOfGenerator(int i) const
00101   //  VectorOf<Chars> namesOfGenerators( ) const
00102 
00103   ///////////////////////////////////////////////////////
00104   //                                                   //
00105   //  Group structure methods                          //
00106   //                                                   //
00107   ///////////////////////////////////////////////////////
00108 
00109   int rank( ) const { return numberOfGenerators(); }
00110   
00111   // members to manipulate homs :
00112   
00113   Aut randomAut( ) const; // @stc some thought has to be put into this and
00114                           // into manipulating distributions
00115 
00116   ///////////////////////////////////////////////////////
00117   //                                                   //
00118   //  Methods dealing with group elements              //
00119   //                                                   //
00120   ///////////////////////////////////////////////////////
00121 
00122   // Inherited from FGGroup: @rn update
00123   // Elt makeIdentity( ) const; // pseudo-virtual
00124   // Bool isSyntacticIdentity(const Elt& e) const; // pseudo-virtual
00125   // Trichotomy isTrivialElt( const Elt& e ) const; // pseudo-virtual
00126   // Trichotomy areEqual(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00127   // Elt firstElt( ) const; // pseudo-virtual
00128   // Elt nextElt(const Elt& e) const; // pseudo-virtual
00129   // Elt multiply(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00130   // Elt inverseOf(const Elt& e) const; // pseudo-virtual
00131   // Elt raiseToPower(const Elt& e, int n) const; // pseudo-virtual
00132   // Elt conjugateBy(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00133   // Elt commutator(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00134   // Elt eval( const Word& w ) const;
00135   // Trichotomy wordProblem( const Word& w ) const;
00136   // Trichotomy conjugacyProblem( const Word& u, const Word& v ) const;
00137 
00138   Trichotomy conjugacyProblem( const Word& u, const Word& v ,Word& c) const {
00139        return look()->conjugacyProblem(u,v,c);
00140   }
00141 
00142   Bool inCommutatorSG(const Word& w) const { 
00143     return look()->inCommutatorSG(w);
00144   }
00145   // Returns TRUE iff `w' is in the commutator subgroup.
00146 
00147   Bool isCommutator(const Word& w, Word& u1, Word& u2) const {
00148     return look()->isCommutator(w,u1,u2);
00149   }
00150   // Returns TRUE iff `w' is a commutator. If TRUE, `u1' and `u2'
00151   // are set to words such that w = [u1,u2].
00152 
00153   Chars productOfCommutators( const Word& w , File& file )
00154     {
00155       return change()->productOfCommutators(w,file);
00156     }
00157   // If the word is in derived subgroup this procedure rewrites the 
00158   // word as a product of commutators.
00159 
00160   Chars productOfSquares( const Word& w , File& file )
00161     {
00162       return change()->productOfSquares(w,file);
00163     }
00164   // If the word is in the subgroup generated by all squares this procedure 
00165   // rewrites it as a product of commutators.
00166 
00167   Word getN_thElement( int n ) const
00168   {
00169     return look()->getN_thElement(n);
00170   }
00171   // Get the n-th element of a free group.
00172 
00173   int numberOfElement( const Word& w ) const
00174   {
00175     return look()->numberOfElement(w);
00176   }
00177   // Computes the number of the word in the free group.
00178 
00179   VectorOf<Word> nielsenBasis(const VectorOf<Word>& V) const {
00180     return look()->nielsenBasis(V);
00181   }
00182   // Returns a nielsen basis for the subgroup generated by `V'.
00183 
00184   typedef FreeGroupRep::NielsenBasis NielsenBasis;
00185 
00186   NielsenBasis nielsenBasis(const VectorOf<Word>& V, bool writeToFile ) const {
00187     return NielsenBasis(V, namesOfGenerators(), writeToFile );
00188   }
00189   // Returns a nielsen basis for the subgroup generated by `V'
00190   // and decomposition of the nielsen basis in V.
00191 
00192   Bool isAutomorphism(const VectorOf<Word>& V) const {
00193     return look()->isAutomorphism(V);
00194   }
00195   // Returns TRUE iff generating vector `V' defines an
00196   // automorphism of this group. The length of `V' should be
00197   // equal to the rank of this group.
00198 
00199   Bool isInnerAutomorphism(const VectorOf<Word>& V) const {
00200     return look()->isInnerAutomorphism(V);
00201   }
00202   // Returns TRUE iff generating vector `V' defines an inner
00203   // automorphism of this group. The length of `V' should be
00204   // equal to the rank of this group and `V' should define an
00205   // automorphism.
00206 
00207   bool isIAAutomorphism(const VectorOf<Word>& V) const {
00208     return look()->isIAAutomorphism(V);
00209   }
00210   // Returns `true' iff generating vector `V' defines an
00211   // IA-automorphism of this group. The length of `V' should be
00212   // equal to the rank of this group and `V' should define an
00213   // automorphism.
00214 
00215   VectorOf<Word> inverseAutomorphism(const VectorOf<Word>& V) const {
00216     return look()->inverseAutomorphism(V);
00217   }
00218   // Returns a generating vector for the inverse automorphism.
00219   // `V' should define an automorphism of this group.
00220 
00221   Map inverseAutomorphism( const Map& M) const 
00222   {
00223     return Map( *this, *this, inverseAutomorphism( M.generatingImages() ) );
00224   }
00225   // Returns an inverse automorphism.
00226 
00227   
00228   ///////////////////////////////////////////////////////
00229   //                                                   //
00230   //  Methods dealing with subgroups                   //
00231   //                                                   //
00232   ///////////////////////////////////////////////////////
00233 
00234   // Inherited from FGGroup: @rn update
00235   //  Subgroup randomSubgroup( )
00236 
00237   ///////////////////////////////////////////////////////
00238   //                                                   //
00239   //  I/O                                              //
00240   //                                                   //
00241   ///////////////////////////////////////////////////////
00242 
00243   // Inherited from FGGroup: @rn update
00244   //  Word readWord(istream& istr, Chars& errMesg) const
00245   //  void printGenerators( ostream& ostr ) const
00246   //  void printWord( ostream& ostr, const Word& w ) const
00247  
00248   ///////////////////////////////////////////////////////
00249   //                                                   //
00250   //  Representation access methods                    //
00251   //                                                   //
00252   ///////////////////////////////////////////////////////
00253 
00254 /* 
00255 private:
00256  
00257   typedef FreeGroupRep ThisRep;
00258   typedef FGGroup Base;
00259  
00260   // Shadow representation accessors to get representations of the
00261   // right type in the members of this class:
00262  
00263   const ThisRep* look( ) const {
00264     return (const ThisRep*)GenericObject<FreeGroupRep>::look();
00265   }
00266   ThisRep* enhance( ) const {
00267          return (ThisRep*)GenericObject<FreeGroupRep>::enhance();
00268   }
00269   ThisRep* change( ) {
00270          return (ThisRep*)GenericObject<FreeGroupRep>::change();
00271   }
00272 */
00273  
00274 protected:
00275  
00276   // Special wrapping constructor to wrap new representations (returned
00277   // by eg. delegated methods) and for base initialisation by derived
00278   // classes:
00279  
00280   FreeGroup( FreeGroupRep* newrep ) :
00281     DerivedObjectOf<FGGroup,FreeGroupRep>(newrep)
00282   { }
00283 
00284 
00285   ///////////////////////////////////////////////////////
00286   //                                                   //
00287   //  Debugging stuff                                  //
00288   //                                                   //
00289   ///////////////////////////////////////////////////////
00290 
00291 private:
00292   
00293 #ifdef DEBUG
00294   //friend int main( );
00295   friend void debugPrint(ostream&, const FreeGroup& g);
00296 #endif
00297 
00298 };
00299 
00300 #endif

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