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

/magnus/back_end/Group/include/FGGroup.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: FGGroup.h,v 1.4 1996/11/15 22:13:00 alex 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 FGGroup class.
00009 //
00010 // Principal Authors: Stephane Collart, Roger Needham
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 // Special Notes:
00017 //
00018 // Questions:
00019 //
00020 // * methods which may enhance a group, such as wordProblem(), are const,
00021 //   to permit application to const objects;
00022 //
00023 // 07/96 Alexey M. implemented IPC tools
00024 
00025 #ifndef _FINITELY_GENERATED_GROUP_H_
00026 #define _FINITELY_GENERATED_GROUP_H_
00027 
00028 
00029 #include "DerivedObjectOf.h"
00030 #include "Group.h"
00031 #include "FGGroupRep.h"
00032 
00033 
00034 class Subgroup; // Doesn't exist yet.
00035 
00036 
00037 class FGGroup : public DerivedObjectOf<Group,FGGroupRep> {
00038   
00039 public:
00040   
00041   ///////////////////////////////////////////////////////
00042   //                                                   //
00043   //  Constructors                                     //
00044   //                                                   //
00045   ///////////////////////////////////////////////////////
00046 
00047   // No default constructor for pseudo-abstract class.
00048   // Copy constructor, operator=, and destructor supplied by compiler.
00049 
00050   FGGroup( const Group& g ) : DerivedObjectOf<Group,FGGroupRep>( g ) { }
00051   // cast constructor: to cast an arbitrary group as an FG group
00052   // NB. This rewraps the unchanged representation, hence is in general
00053   // only useful for casting a group known to be an actual FG group.
00054   
00055   ///////////////////////////////////////////////////////
00056   //                                                   //
00057   //  Accessors                                        //
00058   //                                                   //
00059   ///////////////////////////////////////////////////////
00060 
00061   static Type type( ) { return FGGroupRep::type(); }
00062   // dominates Group::type();
00063 
00064   // Inherited from Group:
00065   //  Type actualType() const; // pseudo-virtual
00066 
00067   int numberOfGenerators( ) const { return look()->theNumberOfGenerators; }
00068   
00069   Chars nameOfGenerator(int i) const;
00070   // Returns print name of (i + 1)th generator. Zero-based indexing.
00071   // No negative i's; does not return print names of formal inverses.
00072   // @rn Take a Generator instead?
00073 
00074   Chars nameOfGenerator(Generator g) const; //@rn
00075 
00076   VectorOf<Chars> namesOfGenerators( ) const {
00077          return look()->theNamesOfGenerators;
00078   }
00079   // Returns vector of print names of all generators, in the order of
00080   // their ordinals.
00081 
00082   ///////////////////////////////////////////////////////
00083   //                                                   //
00084   //  Group structure methods                          //
00085   //                                                   //
00086   ///////////////////////////////////////////////////////
00087 
00088   // Inherited from Group:
00089   // int order( ) const; // pseudo-virtual
00090   // Trichotomy isTrivial( ) const; // pseudo-virtual
00091   // Trichotomy isFinite( ) const; // pseudo-virtual
00092   // Trichotomy isInfinite( ) const; // pseudo-virtual
00093   // Trichotomy isAbelian( ) const; // pseudo-virtual
00094 
00095   ///////////////////////////////////////////////////////
00096   //                                                   //
00097   //  Methods which deal with group elements           //
00098   //                                                   //
00099   ///////////////////////////////////////////////////////
00100 
00101   // Inherited from Group:
00102   // Elt makeIdentity( ) const; // pseudo-virtual
00103   // Bool isSyntacticIdentity(const Elt& e) const; // pseudo-virtual
00104   // Trichotomy isTrivialElt( const Elt& e ) const; // pseudo-virtual
00105   // Trichotomy areEqual(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00106   // Elt firstElt( ) const; // pseudo-virtual
00107   // Elt nextElt(const Elt& e) const; // pseudo-virtual
00108   // Elt multiply(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00109   // Elt inverseOf(const Elt& e) const; // pseudo-virtual
00110   // Elt raiseToPower(const Elt& e, int n) const; // pseudo-virtual
00111   // Elt conjugateBy(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00112   // Elt commutator(const Elt& e1, const Elt& e2) const; // pseudo-virtual
00113   
00114   Elt eval( const Word& w ) const { return look()->eval(w); }
00115   // Takes a word and evaluates it as a formal word in the generators
00116   // of the group. Returns a (possibly canonic) representative of the
00117   // element. This method is pseudo-virtual.
00118 
00119   Trichotomy wordProblem( const Word& w ) const {
00120          return enhance()->wordProblem(w);
00121   }
00122   // Returns YES if w represents the identity, NO if not, and
00123   // DONTKNOW if no answer can be determined.
00124 
00125   Trichotomy conjugacyProblem( const Word& u, const Word& v ) const {
00126          return enhance()->conjugacyProblem(u, v);
00127   }
00128   // Returns YES if u and v represent conjugate elements, NO if not, and
00129   // DONTKNOW if no answer can be determined.
00130 
00131   ///////////////////////////////////////////////////////
00132   //                                                   //
00133   //  Methods which deal with sets of group elements   //
00134   //                                                   //
00135   ///////////////////////////////////////////////////////
00136 
00137   // Inherited from Group:
00138   // SetOf<Elt> setMultiply(const SetOf<Elt>& S1, const SetOf<Elt>& S2) const;
00139   // SetOf<Elt> setMultiply(const Elt& e, const SetOf<Elt>& S) const;
00140   // SetOf<Elt> setMultiply(const SetOf<Elt>& S, const Elt& e) const;
00141   // SetOf<Elt> conjugateBy(const SetOf<Elt>& S1, const SetOf<Elt>& S2) const;
00142   // SetOf<Elt> conjugateBy(const Elt& e, const SetOf<Elt>& S) const;
00143   // SetOf<Elt> conjugateBy(const SetOf<Elt>& S, const Elt& e) const;
00144   // void closeUnderInverses(SetOf<Elt>& S) const;
00145 
00146   void closeUnderCyclicPermutations(SetOf<Word>& S) const;
00147   // Alters S so that if w is in S, then any cyclic permutation of w is too.
00148 
00149   ///////////////////////////////////////////////////////
00150   //                                                   //
00151   //  I/O                                              //
00152   //                                                   //
00153   ///////////////////////////////////////////////////////
00154 
00155   Word readWord(istream& istr, Chars& errMesg) const;
00156   // Tries to parse and return a Word from istr. At present, the word
00157   // in istr must end in ',', so the parser knows when to stop.
00158   // If there is a parse error, a message is returned in errMesg,
00159   // and the empty Word is returned.
00160 
00161   SetOf<Word> readSetOfWords(istream& istr, Chars& errMesg) const;
00162   // Tries to parse and return a set of Words, delimited by '{', '}' and
00163   // comma-separated, from istr.
00164   // If there is a parse error, a message is returned in errMesg,
00165   // and the empty set is returned.
00166 
00167   VectorOf<Word> readVectorOfWords(istream& istr, Chars& errMesg) const;
00168   // Tries to parse and return a set of Words, delimited by '{', '}' and
00169   // comma-separated, from istr.
00170   // If there is a parse error, a message is returned in errMesg,
00171   // and the empty set is returned.
00172 
00173   void printGenerator( ostream& ostr, const Generator& g ) const {
00174          look()->printGenerator( ostr, ord(g) );
00175   }
00176   // Outputs the print name of g on ostr, followed by "^-1" if ord(g) < 0.
00177 
00178   void printGenerators( ostream& ostr ) const {
00179          look()->printGenerators( ostr );
00180   }
00181   // Calls printGenerator for each generator of this group, separating
00182   // them with commas.
00183 
00184   void printWord( ostream& ostr, const Word& w ) const {
00185          look()->printWord( ostr, w );
00186   }
00187   // Outputs w to ostr, in a form that can input by readWord.
00188 
00189   void printSetOfWords( ostream& ostr, const SetOf<Word>& S ) const {
00190          look()->printSetOfWords( ostr, S );
00191   }
00192   // Outputs S to ostr, in a form that can input by readWord.
00193 
00194   void printVectorOfWords( ostream& ostr, const VectorOf<Word>& V,
00195             char* leftBracket = "{", char* rightBracket = "}" ) const 
00196   {
00197     look()->printVectorOfWords( ostr, V, leftBracket, rightBracket );
00198   }
00199   // Outputs V to ostr, in a form that can input by readWord.
00200 
00201 
00202 
00203   ///////////////////////////////////////////////////////
00204   //                                                   //
00205   //  Methods which deal with subgroups                //
00206   //                                                   //
00207   ///////////////////////////////////////////////////////
00208 
00209   
00210   Subgroup randomSubgroup( ) const; // @stc this has to be set up with
00211                               // handles to manipulate distributions
00212 
00213 
00214  
00215   ///////////////////////////////////////////////////////
00216   //                                                   //
00217   //  Representation access methods                    //
00218   //                                                   //
00219   ///////////////////////////////////////////////////////
00220 
00221   /////////////////////////////////////////////////////////////////////////
00222   //                                                                     //
00223   // IPC tools:                                                          //
00224   //                                                                     //
00225   /////////////////////////////////////////////////////////////////////////
00226   // operators inhereted from Group  
00227 
00228  
00229 /* @rn inherited
00230 private:
00231  
00232   typedef FGGroupRep ThisRep;
00233   typedef Group Base;
00234  
00235   // Shadow representation accessors to get representations of the
00236   // right type in the members of this class:
00237  
00238   const FGGroupRep* look( ) const {
00239     return (const ThisRep*)DerivedObjectOf<Group,FGGroupRep>::look();
00240   }
00241   FGGroupRep* enhance( ) const {
00242          return (ThisRep*)DerivedObjectOf<Group,FGGroupRep>::enhance();
00243   }
00244   FGGroupRep* change( ) {
00245          return (ThisRep*)DerivedObjectOf<Group,FGGroupRep>::change();
00246   }
00247 */
00248  
00249 protected:
00250 
00251   // Special wrapping constructor to wrap new representations (returned
00252   // by eg. delegated methods) and for base initialisation by derived
00253   // classes:
00254  
00255   FGGroup( FGGroupRep* newrep ) : DerivedObjectOf<Group,FGGroupRep>(newrep) { }
00256  
00257   ///////////////////////////////////////////////////////
00258   //                                                   //
00259   //  Debugging stuff                                  //
00260   //                                                   //
00261   ///////////////////////////////////////////////////////
00262  
00263 #ifdef DEBUG
00264 
00265   // Inherited from Group:
00266   // bool consistent( ) const;
00267 
00268 #endif
00269 
00270 };
00271 
00272 #endif

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