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

/magnus/back_end/Group/include/AbelianSGPresentation.h

Go to the documentation of this file.
00001 /*
00002  *   $Id:
00003  */
00004 
00005 // Copyright (C) 1996 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: Definition of the FPGroup class.
00009 //
00010 // Principal Authors: Alexey Myasnikov
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 //
00017 // Special Notes:
00018 //
00019 //
00020 
00021 #ifndef _ABELIAN_SG_PRESENTATION_H_
00022 #define _ABELIAN_SG_PRESENTATION_H_
00023 
00024 
00025 #include "AbelianGroup.h"
00026 #include "AbelianGroupRep.h"
00027 #include "Map.h"
00028 
00029 //--------------- AbelianSGPresentationRep -------------------------//
00030 
00031 struct AbelianSGPresentationRep : AbelianGroupRep {
00032 
00033 // Constructors:
00034 
00035   // Copy constructor and operator = provided by compiler.
00036   
00037   AbelianSGPresentationRep(const AbelianGroup& parent,const VectorOf<Word>& sgGens, 
00038                           const FPGroup& thePresentation, const DArray<Integer>& sgPGens,
00039                           bool makeF )
00040   : AbelianGroupRep(thePresentation,makeF),
00041     theParent( parent ),
00042     theSGGens( sgGens ),
00043     theSGPGens( sgPGens )
00044   { }
00045   // Make a rep. It accepts the following parameters:
00046   // parent - parent group of a subgroup, sgGens - generators od SG in terms of parent
00047   // thePresentation - the presentation for a subgroup as a group
00048   // sgPGens - generators of presentation epressed in generators of canonical 
00049   // decomposition of a parent group , makeF - true if you whant to make a files with 
00050   // generators, the same as for AbelianGroup 
00051 
00052   // Destructor provided by compiler.
00053 
00054 //
00055 // Representation methods:
00056 //
00057   
00058   AbelianSGPresentationRep* clone( ) const { return new AbelianSGPresentationRep(*this); }
00059 
00060 
00061 
00062     Word fromSGPGensToSGGens(const Word& w)const;
00063     // Makes the map from presentation generators to
00064     // generators of parent group
00065 
00066     bool fromSGGensToSGPGens(const Word& w,Word& wInNew)const;
00067    // Makes the map from  generators of parent group to
00068    // presentation generators, if word w is in the subgroup it
00069    // returns true, and put the reflection in wInNew.
00070    // If word w does not belong to the subgroup, it returns false.
00071 
00072   
00073   /////////////////////////////////////////////////////////////////////////
00074   //                                                                     //
00075   // IPC tools:                                                          //
00076   //                                                                     //
00077   /////////////////////////////////////////////////////////////////////////
00078     
00079   inline void write( ostream& ostr ) const
00080   {
00081     AbelianGroupRep::write(ostr);
00082     ostr < theParent;
00083     ostr < theSGGens;
00084     ostr < theSGPGens;
00085   }
00086 
00087   inline void read( istream& istr )
00088   {
00089     AbelianGroupRep::read(istr);
00090     istr > theParent;
00091     istr > theSGGens;
00092     istr > theSGPGens;
00093  }
00094 
00095 // Data members:
00096 private:
00097   VectorOf<Word>  theSGGens;
00098   // The generators of subgroup i terms of parent group
00099   DArray<Integer> theSGPGens;
00100   // Generators of presentation, given in generators of
00101   // canonical decomposition of parent group
00102   AbelianGroup    theParent;
00103   // Parent group
00104 
00105 // Private methods
00106 
00107   void makeFile( );
00108   // Creates the file containing the expression of the  generators
00109   // of canonical decomposition in terms of the old ones.
00110 
00111   void makeFileOfPDGens( );
00112   // Creates the file containing the expression of the  generators
00113   // of primary decomposition in terms of the old ones.
00114 
00115   bool powerOfNewGenInTorsionPart (const Integer& inv,const Integer& b,
00116                                    const Integer& a,Integer& x)const;
00117   //gives the power of new generator when expressing old generators
00118   //in generators of presentation, when solve this problem in torsion
00119   //part of new generators presentation. It return true if there is
00120   //exist this power, and put it in x.
00121   bool powerOfNewGenInFreePart (const Integer& b,const Integer& a,Integer& x)const;
00122   //gives the power of new generator when expressing old generators
00123   //in generators of presentation, when solve this problem in torsion
00124   //free part of new generators presentation. It return true if there is
00125   //exist this power, and put it in x.
00126 };
00127 
00128 //--------------- AbelianSGPresentation -------------------------//
00129 
00130 class AbelianSGPresentation : public DerivedObjectOf<AbelianGroup,AbelianSGPresentationRep> {
00131 
00132 public:
00133 
00134   ///////////////////////////////////////////////////////
00135   //                                                   //
00136   //  Constructors                                     //
00137   //                                                   //
00138   ///////////////////////////////////////////////////////
00139 
00140   // Copy constructor provided by compiler
00141 
00142 
00143   AbelianSGPresentation( ):
00144     DerivedObjectOf<AbelianGroup,AbelianSGPresentationRep>( new AbelianSGPresentationRep
00145                                   (AbelianGroup(FPGroup()),VectorOf<Word>(), FPGroup(),
00146                                    DArray<Integer>(),false) ) { }
00147 
00148   ///////////////////////////////////////////////////////
00149   //                                                   //
00150   //  I/O                                              //
00151   //                                                   //
00152   ///////////////////////////////////////////////////////
00153 
00154   // Inherited from AbelianGroup:
00155 
00156   Word fromSGPGensToSGGens(const Word& w)const{
00157       return look()->fromSGPGensToSGGens(w);
00158   }
00159    // Makes the map from presentation generators to
00160    // generators of parent group
00161 
00162   bool fromSGGensToSGPGens(const Word& w,Word& wInNew)const{
00163       return look()->fromSGGensToSGPGens(w,wInNew);
00164   }
00165    // Makes the map from  generators of parent group to
00166    // presentation generators, if word w is in the subgroup it
00167    // returns true, and put the reflection in wInNew.
00168    // If word w does not belong to the subgroup, it returns false.
00169 
00170   /////////////////////////////////////////////////////////////////////////
00171   //                                                                     //
00172   // IPC tools:                                                          //
00173   //                                                                     //
00174   /////////////////////////////////////////////////////////////////////////
00175   // Operators inhereted from AbelianGroup
00176  
00177  
00178   ///////////////////////////////////////////////////////
00179   //                                                   //
00180   //  Debugging stuff                                  //
00181   //                                                   //
00182   ///////////////////////////////////////////////////////
00183 protected:
00184 private:
00185   friend  AbelianSGPresentation AbelianGroup::makeSubgroupPresentation
00186                                                (const VectorOf<Word>& vG) const;
00187 
00188   //Constructor is private because it have sence only for AbelianGroup
00189   // It accepts the following parameters:
00190   // parent - parent group of a subgroup, sgGens - generators od SG in terms of parent
00191   // thePresentation - the presentation for a subgroup as a group
00192   // sgPGens - generators of presentation epressed in generators of canonical 
00193   // decomposition of a parent group , makeF - true if you whant to make a files with 
00194   // generators, the same as for AbelianGroup
00195   AbelianSGPresentation(const AbelianGroup& parent,const VectorOf<Word>& sgGens,
00196                           const FPGroup& thePresentation,const DArray<Integer>& sgPGens,
00197                           bool makeF = false):
00198   DerivedObjectOf<AbelianGroup,AbelianSGPresentationRep>( new AbelianSGPresentationRep
00199                                                   (parent,sgGens,thePresentation,sgPGens, 
00200                                                    makeF) ) { }
00201   // Special wrapping constructor to wrap new representations (returned
00202   // by eg. delegated methods) and for base initialisation by derived
00203   // classes:
00204  
00205   AbelianSGPresentation( AbelianSGPresentationRep* newrep ) : 
00206                                DerivedObjectOf<AbelianGroup,AbelianSGPresentationRep>(newrep) { } 
00207 
00208  
00209 #ifdef DEBUG
00210   friend int main(... );
00211 #endif
00212 
00213 };
00214 
00215 #endif
00216 

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