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

/magnus/back_end/AProducts/include/SuperGen.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: SuperGen.h,v 1.1 1996/11/21 15:03:14 pechkin Exp $
00003  */
00004 
00005 // Copyright (C) 1995 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents:    Definition of class SuperGen.
00009 //
00010 // Principal Author: Dmitry Pechkin
00011 //
00012 // Status: under trial.
00013 //
00014 // Revision History:
00015 //
00016 // TO DO:
00017 //
00018 //  96/09/23 @dp why Generator.h doesn't include <iostream.h> and "global.h"?!
00019 //
00020 
00021 #ifndef __SUPERGEN_H__
00022 #define __SUPERGEN_H__
00023 
00024 #include <iostream.h>
00025 #include "global.h"
00026 #include "Generator.h"
00027 //#include "Vector.h"
00028 //#include "Word.h"
00029 
00030 
00031 
00032 //////////////////////////////////////////////////////////////////////
00033 //
00034 //                        Class SuperGen
00035 //
00036 //////////////////////////////////////////////////////////////////////
00037 
00038 class SuperGen {
00039 public:
00040 
00041   SuperGen() : gen(1), exp(0) { }
00042 
00043   SuperGen( const Generator& g, int exponent = 1 ) : gen(g), exp(exponent) {
00044     // Need correct if the generator was given in negative form.
00045     if( ord(g) < 0 ) {
00046       gen = inv(g);
00047       exp = -exponent;
00048     }
00049   }      
00050 
00051   Generator generator() const { return gen; }
00052 
00053   int exponent() const { return exp; }
00054 
00055   bool operator == ( const SuperGen& g ) const 
00056   {
00057     if( &g == this || gen == g.gen && exp == g.exp )
00058       return true;
00059     return false;
00060   }
00061 
00062 private:
00063   Generator gen;
00064   int exp;
00065 };
00066 
00067 void operator < ( ostream& ostr, const SuperGen& g );
00068 void operator > ( istream& istr, SuperGen& g );
00069 ostream& operator << ( ostream& ostr, const SuperGen& g );
00070 istream& operator >> ( istream& istr, SuperGen& g );
00071 
00072 #endif

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