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

/magnus/back_end/Group/include/AbelianGroup.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: AbelianGroup.h,v 1.10 2000/02/09 06:09:52 alex Exp $
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 AbelianGroup class
00009 //
00010 // Principal Author: Dmitry Bormotov, Alexei Myasnikov
00011 //
00012 // Status: in progress
00013 //
00014 // Usage:
00015 //
00016 //   The class AbelianGroup incapsulates all abelian algoritithms in Magnus.
00017 //   The function computeCyclicDecomposition() is suppose to be called before
00018 //   you can start computing anything else. We denote the free generators
00019 //   of the cyclic decomposition by f1,f2,...,  and the generators of the
00020 //   torsion part by t1,t2,... . Those generators are often called
00021 //   "the new generators" to distinct them from "the old generators", i.e.
00022 //   generators of the original group.
00023 //
00024 //
00025 // Special Notes:
00026 //
00027 // Revision History:
00028 //
00029 
00030 
00031 #ifndef _ABELIAN_GROUP_H_
00032 #define _ABELIAN_GROUP_H_
00033 
00034 #include "FPGroup.h"
00035 #include "AbelianGroupRep.h"
00036 
00037 // ----------------------------- AbelianGroup ------------------------------ //
00038 
00039 class AbelianSGPresentation;
00040 
00041 class AbelianGroup : public ObjectOf<AbelianGroupRep>
00042 {
00043 
00044 public:
00045 
00046   /////////////////////////////////////////////////////////////////////////
00047   //                                                                     //
00048   //  Constructors:                                                      //
00049   //                                                                     //
00050   /////////////////////////////////////////////////////////////////////////
00051 
00052   AbelianGroup( const FPGroup& G, bool makeFile = false )
00053     : ObjectOf<AbelianGroupRep>( new AbelianGroupRep(G, makeFile) )
00054   { }
00055   // Constructs an abelian group with presentation G.
00056   // If bMakeFile is true, expression of new generators in terms
00057   // of old ones will be written in a file after the computation
00058   // is finished.
00059   
00060   // No default constructor, but it can be easily arranged by
00061   // combining default FPGroup constructor and previsious one.
00062 
00063   // Copy constructor and operator = provided by compiler
00064   
00065   
00066   /////////////////////////////////////////////////////////////////////////
00067   //                                                                     //
00068   //  Accessors:                                                         //
00069   //                                                                     //
00070   /////////////////////////////////////////////////////////////////////////
00071  
00072   void computeCyclicDecomposition( ) {
00073     change()->computeCyclicDecomposition();
00074   }
00075   // *** Time consuming algorithm ! ***
00076   // Computes cyclic decomposition of the abelian group.
00077 
00078   void findPrimaryBasis() {
00079     change()->findPrimaryBasis();
00080   }
00081   // *** Time consuming algorithm ! ***
00082   // Computes primary decomposition of the abelian group.  
00083 
00084   bool haveCyclicDecomposition( ) const {
00085     return look()->haveCyclicDecomposition();
00086   }
00087   // True if the cyclic decomposition has been computed.
00088 
00089   bool havePrimaryDecomposition( ) const {
00090     return look()->havePrimaryDecomposition();
00091   }
00092   // True if the primary decomposition has been computed.
00093   
00094   Chars getFileName( ) const {
00095     return look()->getFileName();
00096   }
00097   // Returns name of the file containing new generators.
00098   // Calls error() if no file has been created.
00099 
00100   Chars getFileNameOfPDGens( ) const{
00101     return look()->getFileNameOfPDGens();
00102   }
00103   // Returns name of the file containing generators for prime decomposition.
00104   // Calls error() if no file has been created.
00105 
00106   const FPGroup getFPGroup( ) const {
00107     return look()->getFPGroup();
00108   }
00109   // Returns the original group presentation.
00110 
00111 
00112   SetOf<Word> getAllRelators( ) const {
00113     return look()->getAllRelators();
00114   }
00115   // Returns all relators of the original group plus all commutators.
00116 
00117 
00118   AbelianWord oldInAbelianForm( const Word& w ) const {
00119     return look()->oldInAbelianForm( w );
00120   }
00121   // Computes the abelian form of a word written in terms of 
00122   // the old generators.
00123   
00124 
00125   /////////////////////////////////////////////////////////////////////////
00126   //  
00127   //  The rest of the public functions in the class can be used only if
00128   //  the cyclic decomposition is computed.
00129   //
00130   //
00131   
00132   int rankOfFreeAbelianFactor( ) const {
00133     return look()->rankOfFreeAbelianFactor();
00134   }
00135   // Returns rank of the free part.
00136 
00137   
00138   VectorOf<Integer> invariants( ) const {
00139     return look()->invariants();
00140   }
00141   // Return the invariants m_i such that m_i | m_{i+1}. All m_i > 1.
00142 
00143   
00144   VectorOf<AbelianWord> oldToNewGens() const {
00145     return look()->oldToNewGens();
00146   }
00147   // Returns images of the old generators in terms of the
00148   // new set of generators.
00149   
00150   VectorOf<AbelianWord> newToOldGens() const {
00151     return look()->newToOldGens();
00152   }
00153   // Returns images of the new generators in terms of the
00154   // new set of generators.
00155   
00156   AbelianGroup getCanonicalSmithPresentation( ) const {
00157     return ( new AbelianGroupRep( look()->getCanonicalSmithPresentation() ) );
00158   }
00159   // Returns the cyclic decomposition as an object of the class AbelianGroup.
00160   // In that object the new generators and the old generators are the same;
00161   // the cyclic decomposition, invariants, the rank of free part and
00162   // transformation vectors are already computed.
00163 
00164 
00165   /////////////////////////////////////////////////////////////////////////
00166   //                                                                     //
00167   //  Methods and operators which deal with the group:                   //
00168   //                                                                     //
00169   /////////////////////////////////////////////////////////////////////////
00170   
00171   Integer order() const {
00172     return look()->order();
00173   }
00174   // Returns order of the group, 0 means infinity.
00175 
00176 
00177   bool isTrivial() const {
00178     return look()->isTrivial();
00179   }
00180   // Returns true if the group is trivial.
00181 
00182 
00183   bool isFinite() const { return ( order() != 0 ); } 
00184   // Returns true if the group is finite.
00185 
00186   
00187   bool isInfinite() const { return !isFinite(); }
00188   // Returns true if the group is infinite.
00189 
00190   
00191   bool isFree() const {
00192     return look()->isFree();
00193   }
00194   // Returns true if the group is free.
00195 
00196   
00197   bool isomorphicTo( const AbelianGroup& G) const {
00198     return look()->isomorphicTo( *G.look() );
00199   }
00200   // Returns true if the group is isomorphic to G.
00201 
00202 
00203   AbelianGroup computeIntegralHomology( int n ) const{
00204     return ( new AbelianGroupRep( look()->computeIntegralHomology( n ) ) );
00205   }
00206   // Returns the H_n group of this one.
00207 
00208   /////////////////////////////////////////////////////////////////////////
00209   //                                                                     //
00210   //  Methods and operators which deal with subgroups:                   //
00211   //                                                                     //
00212   /////////////////////////////////////////////////////////////////////////
00213 
00214   Integer orderOfTheTorsionSubgroup( ) const {
00215     return look()->orderOfTheTorsionSubgroup();
00216   }
00217   // Returns order of the torsion subgroup.
00218 
00219   AbelianSGPresentation makeSubgroupPresentation(const VectorOf<Word>& vG) const;
00220 
00221   // Makes presentation of subgroup 
00222 
00223   VectorOf<Word> findSubgroupIsolator(const VectorOf<Word>& vG) const{
00224       return look()->findSubgroupIsolator(vG);
00225   }
00226   // *** Time consuming algorithm ! ***
00227   // Returns the generators of Isolator of given subgroup
00228 
00229   VectorOf<Word> findVirtFreeComplementOfSG(const VectorOf<Word>& vG) const{
00230       return look()->findVirtFreeComplementOfSG(vG);
00231   }
00232   // *** Time consuming algorithm ! ***
00233   // returns generators of virtual free complement, of a given subgroup
00234 
00235   VectorOf<Word> joinSubgroups(const VectorOf<Word>& vG1,const VectorOf<Word>& vG2) const{
00236       return look()->joinSubgroups(vG1,vG2);
00237   }
00238   // *** Time consuming algorithm ! ***
00239   // Returns the generators of join subgroup of given groups
00240   
00241   VectorOf<Word> findSubgIntersection( const VectorOf<Word>& vG1 ,
00242                                        const VectorOf<Word>& vG2 , 
00243                                        File& file ) const
00244   {
00245     return look()->findSubgIntersection(vG1,vG2,file);
00246   }
00247   // Returns the generators for intersection of given subgroups  
00248   
00249   bool isPureCyclSubgroup(const Word& w) const{
00250      return look()->isPureCyclSubgroup(w);
00251   }
00252   // True if given cyclic subgroup is pure
00253  
00254   /////////////////////////////////////////////////////////////////////////
00255   //                                                                     //
00256   //  Methods which deal with group elements:                            //
00257   //                                                                     //
00258   /////////////////////////////////////////////////////////////////////////
00259 
00260   bool areEqual(const Word& u, const Word& v) const {
00261     return look()->areEqual(u,v);
00262   }
00263   // Returns true if u and v are equal.
00264   
00265 
00266   bool isTrivial( const Word& w ) const {
00267     return look()->isTrivial(w);
00268   }
00269   // Word problem.
00270 
00271   
00272   Integer orderOfElt( const Word& w ) const {
00273     return look()->orderOfElt(w);
00274   }
00275   // Returns the order of an element, 0 means infinity.
00276 
00277 
00278   AbelianWord newToOldGens( const AbelianWord& w ) const {
00279     return look()->newToOldGens(w);
00280   }
00281   // Converts an element from the new generators to the old ones.
00282 
00283   AbelianWord oldToNewGens( const AbelianWord& w ) const {
00284     return look()->oldToNewGens(w);
00285   }
00286   // Converts an element from the old generators to the new ones.
00287 
00288   AbelianWord findEltPrimeForm(const Word& w) const{
00289     return look()->findEltPrimeForm(w);
00290   }
00291   // Converts an element from the old generators to the prime form ones.
00292 
00293 
00294   AbelianWord pBlockOfElt( const AbelianWord& w,Integer p )const{
00295     return look()->pBlockOfElt(w,p);
00296   }
00297   // Returns a p-block of an element. 
00298   
00299   AbelianWord pBlockOfElt( const Word& w,Integer p )const{
00300     return look()->pBlockOfElt( findEltPrimeForm(w) , p );
00301   }
00302   // Returns a p-block of an element. 
00303   
00304       
00305   Integer pHeightOfElt(const Word& w, const Integer& p, Integer orderofElt = -1) const{
00306     return look()->pHeightOfElt(w,p, orderofElt);
00307   }
00308   // *** Time consuming algorithm ! ***
00309   // Returns a p-height of a given alement. The orderofElt - is an order of
00310  
00311   Integer powerOfEltInSubgroup(const Word& w,const VectorOf<Word>& sGroup) const{
00312       return look()->powerOfEltInSubgroup(w,sGroup);
00313   }
00314   // Returns the power of element in subgroup
00315 
00316   bool isEltProperPower(const Word& w) const{
00317       return look()->isEltProperPower(w);
00318   }
00319   // *** Time consuming algorithm ! ***
00320   // True if element is proper power
00321 
00322   void abelianMaximalRoot(const Word& w, Word& maxRoot, Integer& maxExp) const{
00323        look()->abelianMaximalRoot(w, maxRoot, maxExp);
00324   }
00325   // *** Time consuming algorithm ! ***
00326   // Compute the maximal root of an element. Put maximal root in  maxRoot and
00327   // maximal exponent in maxExp. If maxExp is 0, than there is no maximal root fpr
00328   // this element
00329 
00330   AbelianWord primeFormInOldGens(const AbelianWord& w) const{
00331       return look()->primeFormInOldGens(w);
00332   }
00333   // Converts an element in prime form  to the old generators.
00334  
00335   int isPowerOfSecond(const Word& word1, const Word& word2) const{
00336       return look()->isPowerOfSecond(word1,word2);
00337   }
00338   // *** Time consuming algorithm ! ***
00339   // If word1 is a power of word2, returns the power, if not returns 0
00340   /////////////////////////////////////////////////////////////////////////
00341   //                                                                     //
00342   //  Methods which deal with morphisms:                                 //
00343   //                                                                     //
00344   /////////////////////////////////////////////////////////////////////////
00345 
00346   Bool isEpimorphism(const VectorOf<Word>& V) const{
00347       return look()->isEpimorphism(V);
00348   }
00349   // *** Time consuming algorithm ! ***
00350   // Returns TRUE iff generating vector `V' defines an 
00351   // epimorphism of this group. The length of `V' should be
00352   // equal to the number of generators of this group. 
00353 
00354   int orderOfAuto(const VectorOf<Word>& V) const{
00355       return look()->orderOfAuto(V);
00356   }
00357   // *** Time consuming algorithm ! ***
00358   // Returns the order of Automorphism defined by V. 
00359   // Does not make check is it automorphism or not!!!
00360   // Returns -1 if infinite (temporary, if order > 1000)
00361 
00362   VectorOf<Word> inverseAuto(const VectorOf<Word>& V) const{
00363     return look()->inverseAuto(V);
00364   }
00365   // *** Time consuming algorithm ! ***
00366   // Returns the inverse  of automorphism, defined by V. 
00367   // Does not make check is it automorphism or not!!!
00368 
00369   VectorOf<Word> fixedPointsOfAuto( const VectorOf<Word>& v ) const{
00370     return look()->fixedPointsOfAuto( v );
00371   }
00372   // Returns the generating set for the subgroup of fixed points of the 
00373   // automorphism defined by v.
00374   // Does not make check is it automorphism or not!!!
00375   
00376   /////////////////////////////////////////////////////////////////////////
00377   //                                                                     //
00378   // I/O:                                                                //
00379   //                                                                     //
00380   /////////////////////////////////////////////////////////////////////////
00381 
00382   friend ostream& operator << ( ostream& ostr, const AbelianGroup& G )
00383   {
00384     G.look()->printOn(ostr);
00385     return ostr;
00386   }
00387   // Print the cyclic decomposition in the form, like Z^5 x Z_2 x Z_4^2 ...
00388 
00389   
00390   void printWordInNewGens( ostream& ostr, const AbelianWord& w) const {
00391     look()->printWordInNewGens(ostr, w);
00392   }
00393   // Print a word in the new generators in additive notation.
00394 
00395   void printInPrimaryForm(ostream& ostr, const AbelianWord& aw) const{
00396       look()->printInPrimaryForm(ostr,aw);
00397   }
00398   // Print a word in primary form: f1 + 2 p2 ... (aw must be in prime form)
00399 
00400   void printPrimaryDec( ostream& ostr) const{
00401       look()->printPrimaryDec(ostr);
00402   }
00403   // Print the prymary decomposition in the form, like Z^5 x Z_2 x Z_4 x Z_3 ...
00404 
00405   /////////////////////////////////////////////////////////////////////////
00406   //                                                                     //
00407   // IPC tools:                                                          //
00408   //                                                                     //
00409   /////////////////////////////////////////////////////////////////////////
00410 
00411   friend ostream& operator < ( ostream& ostr, const AbelianGroup& G )
00412   {
00413     G.look()->write(ostr);
00414     return ostr;
00415   }
00416   
00417   friend istream& operator > ( istream& istr, AbelianGroup& G )
00418   {
00419     G.change()->read(istr);
00420     return istr;
00421   }
00422 
00423 
00424 protected:
00425 
00426   /////////////////////////////////////////////////////////////////////////
00427   //                                                                     //
00428   // Protected functions:                                                //
00429   //                                                                     //
00430   /////////////////////////////////////////////////////////////////////////
00431   friend AbelianSGPresentationRep AbelianGroupRep::
00432                        makeSubgroupPresentation(const VectorOf<Word>& vG)const;
00433   friend AbelianSGPresentationRep AbelianGroupRep::buildTorsionFreePresentation
00434             ( Matrix<Integer>& gensTransformation, const VectorOf<Word>& vG)const;
00435   AbelianGroup( AbelianGroupRep* newrep ) 
00436     : ObjectOf<AbelianGroupRep>(newrep) { }
00437   // Special wrapping constructor to wrap new representations
00438 
00439 };
00440 
00441 #endif

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