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

/magnus/back_end/KB/include/GenMultRep.h

Go to the documentation of this file.
00001 /*
00002   *   $Id: GenMultRep.h,v 1.3 1997/11/20 02:53:49 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 GenMultRep class.
00009 //
00010 // Principal Author: Sarah Rees
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 // * 11/97 Dmitry B. implemented IPC tools.
00017 //
00018 
00019 #ifndef _GenMultRep_H_
00020 #define _GenMultRep_H_
00021 
00022 #include "Word.h"
00023 #include "Set.h"
00024 #include "Vector.h"
00025 #include "DFSARep.h"
00026 
00027 class GenMultRep : public GroupDFSARep {
00028 public:
00029   //@rn Kludge!!?
00030   GenMultRep() : GroupDFSARep() {}
00031 
00032   GenMultRep(const VectorOf<Chars> & genNames) : 
00033     GroupDFSARep("",genNames),
00034     mults(1,YES) { 
00035      setNumStrings(2);
00036     }
00037 
00038   GenMultRep(const VectorOf<Chars> & genNames,const WordOrder & word_order) : 
00039     GroupDFSARep("",genNames,word_order),
00040     mults(1,YES) { 
00041      setNumStrings(2);
00042     }
00043 
00044 
00045   GenMultRep( const GenMultRep& GM ) :  // Copy constructor does deep copy.
00046     GroupDFSARep(GM), mults(GM.mults) { }
00047 
00048   GenMultRep & operator = ( const GenMultRep & GM )
00049   {
00050     GroupDFSARep& temp = *this;
00051     temp = (GroupDFSARep)GM;
00052     mults = GM.mults;
00053     return *this;  
00054   }
00055 
00056   FSARep *clone() const { return new GenMultRep(*this); }
00057 
00058   Bool operator == ( const DFSARep& ) const { return 0; } //@rn implement!
00059 
00060 //  Bool nextAcceptedWord(Word w, int*& history) const {}; //@rn bad arg
00061   void minimize() {};
00062   
00063   void readFrom(istream &str = cin);
00064 
00065 /*
00066   void printOn(ostream &str = cout) const ;
00067 */
00068   void printAccepting(ostream &str = cout) const ;
00069   void printStates(ostream &str = cout) const ;
00070 
00071  // Set/reset the number of states in the automaton to numOfStates 
00072    
00073   void setNumStates(int numOfStates);
00074 
00075 // i below is ord(g) where g is the generator associated with s,
00076 // except that i=0 where s is associated with the identity
00077   void setMultiplier(State s,int i) { setCategory(s,1); mults[s]=i; }
00078   int getMultiplier(State s) { return mults[s];}
00079 
00080 
00081   /////////////////////////////////////////////////////////////////////////
00082   //                                                                     //
00083   // IPC tools:                                                          //
00084   //                                                                     //
00085   /////////////////////////////////////////////////////////////////////////
00086     
00087   void write( ostream& ostr ) const
00088   {
00089     GroupDFSARep::write(ostr);
00090     ostr < mults;
00091   }
00092 
00093   void read( istream& istr )
00094   {
00095     GroupDFSARep::read(istr);
00096     istr > mults;
00097   }
00098     
00099 private:
00100 
00101   VectorOf<int> mults;
00102 };
00103 #endif

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