CoCoALib-0.9905 date: 23 May 2007


DistrMPolyInlPP.H

Go to the documentation of this file.
00001 #ifndef CoCoA_DistrMPolyInlPP_H
00002 #define CoCoA_DistrMPolyInlPP_H
00003 
00004 //   Copyright (c)  2005  John Abbott
00005 
00006 //   This file is part of the source of CoCoALib, the CoCoA Library.
00007 
00008 //   CoCoALib is free software; you can redistribute it and/or modify
00009 //   it under the terms of the GNU General Public License (version 2)
00010 //   as published by the Free Software Foundation.  A copy of the full
00011 //   licence may be found in the file COPYING in this directory.
00012 
00013 //   CoCoALib is distributed in the hope that it will be useful,
00014 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 //   GNU General Public License for more details.
00017 
00018 //   You should have received a copy of the GNU General Public License
00019 //   along with CoCoA; if not, write to the Free Software
00020 //   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 
00022 
00023 // Header file for the class DistrMPolyInlPP
00024 
00025 
00026 #include "CoCoA/assert.H"
00027 #include "CoCoA/SparsePolyRing.H"
00028 #include "CoCoA/OrdvArith.H"
00029 #include "CoCoA/MemPool.H"
00030 
00031 #include <cstddef>
00032 // using std::size_t;
00033 #include <iosfwd>
00034 // using std::ostream;
00035 #include <vector>
00036 // using std::vector;
00037 
00038 namespace CoCoA
00039 {
00040 
00041 /*-- class DistrMPolyInlPP ----------------------------------------*/
00042 /**
00043   \brief Implementation of polynomials for RingDistrMPolyInlPP
00044 
00045   \include DistrMPolyInlPP.txt
00046   */
00047 /*-----------------------------------------------------------------*/
00048 
00049   class DistrMPolyInlPP
00050   {
00051   private:
00052     // Struct used to represent the summand in a DistrMPolyInlPP.
00053     struct summand
00054     {
00055     public: // data members -- deliberately public (to avoid many friend declarations)
00056       summand* myNext;
00057       RingElemRawPtr myCoeff;
00058       OrdvArith::OrdvElem myOrdv[1]; // myOrdv ABSOLUTELY MUST BE THE LAST DATA MEMBER.
00059                                      // The compiler will allocate this at the end,
00060                                      // so I can address elements with index greater than
00061                                      // 1 with impunity if I know the space exists.
00062     };
00063     summand* NewSummand(const DistrMPolyInlPP& f);
00064     static void ourDeleteSummands(summand* ptr, const ring& R, MemPool& MemMgr);
00065 
00066     // This class behaves rather like you'd want std::auto_ptr<summand> to behave.
00067     class AutoPtrSummand
00068     {
00069     public:
00070       explicit AutoPtrSummand(const DistrMPolyInlPP& f);
00071 //???      AutoPtrSummand(const AutoPtrSummand& copy) throw();
00072       ~AutoPtrSummand() throw();
00073 //???      AutoPtrSummand& operator=(const AutoPtrSummand& rhs) throw();
00074       summand& operator*() const throw();
00075       summand* operator->() throw();
00076 //???      const summand* operator->() const throw();
00077       summand* get() const throw();
00078 //???      summand* const get() const throw();
00079       summand* release() throw();
00080 //???      void reset(summand* ptr = 0) throw();
00081       void renew();
00082     private: // data members
00083       summand* myPtr;
00084       MemPool& myMemMgr;
00085       const ring myR;
00086       OrdvArith::reference myOrdvArith;
00087     };
00088 
00089 
00090   private: // data members (of DistrMPolyInlPP)
00091     const ring myCoeffRing;
00092     const PPMonoid myPPM;
00093     OrdvArith::reference myOrdvArith;
00094     MemPool& mySummandMemory;
00095     summand** myEnd; // for the one-past-the-last iterator
00096     summand* mySummands;
00097 
00098     friend const ring& CoeffRing(const DistrMPolyInlPP& f);
00099     friend const PPMonoid& PPM(const DistrMPolyInlPP& f);
00100 //??????    RingElemRawPtr myDenom;  // used only if the coeff ring is a field of fractions.
00101 
00102   public:
00103     DistrMPolyInlPP(const ring&, const PPMonoid&, const OrdvArith::reference&, MemPool&);
00104     DistrMPolyInlPP(const DistrMPolyInlPP& copy);
00105     ~DistrMPolyInlPP();
00106     DistrMPolyInlPP& operator=(const DistrMPolyInlPP& rhs);
00107     DistrMPolyInlPP& operator=(long rhs);
00108     DistrMPolyInlPP& operator=(const ZZ& rhs);
00109 
00110     friend bool IsCompatible(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00111 //???    static void CheckCompatible(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g, const std::string& message);
00112     static std::size_t SummandSize(const ring&, const OrdvArith::reference& OA);
00113     static void ourSwap(DistrMPolyInlPP&, DistrMPolyInlPP&);
00114     summand* myCopySummand(const summand* original) const;
00115     // functions depending solely on the structure
00116     void myAssignZero();
00117 
00118     bool IsEqual(const summand* const lhs, const summand*const rhs) const;
00119     friend std::size_t NumTerms(const DistrMPolyInlPP& f);
00120     friend ConstRefRingElem LC(const DistrMPolyInlPP& f);
00121     friend RingElemRawPtr& RawLC(DistrMPolyInlPP& f);
00122     friend const RingElemRawPtr& RawLC(const DistrMPolyInlPP& f);
00123     //    friend RingElem content(const DistrMPolyInlPP& f);
00124     friend ConstRefPPMonoidElem LPP(const DistrMPolyInlPP& f);
00125     friend int CmpLPP(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00126     friend void MoveLM(DistrMPolyInlPP& f, DistrMPolyInlPP& g);
00127     void myDeleteLM();
00128 //     friend std::size_t StdDeg(const DistrMPolyInlPP& f);
00129 //     friend void wdeg(degree& d, const DistrMPolyInlPP& f);
00130 //     friend int CmpWDeg(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00131 //     friend long log(const DistrMPolyInlPP& f, std::size_t IndetIndex);
00132     void myAddMul(const DistrMPolyInlPP& h, const DistrMPolyInlPP& g, bool SkipLMg);
00133     void WeylAddMul(const DistrMPolyInlPP& h, const DistrMPolyInlPP& g);
00134     void myReductionStep(const DistrMPolyInlPP& g);
00135     void myReductionStepGCD(const DistrMPolyInlPP& g, RefRingElem fscale);
00136     void myAddClear(DistrMPolyInlPP& g);
00137     void myAppendClear(DistrMPolyInlPP& g);
00138     friend void DivLM(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00139     void myMulByCoeff(RingElemConstRawPtr rawc);  ///< EXCEPTION SAFE
00140     void myDivByCoeff(RingElemConstRawPtr rawc);  ///< EXCEPTION SAFE
00141     void myMulByPP(PPMonoidElemConstRawPtr rawpp);
00142     void WeylMul(PPMonoidElemConstRawPtr rawpp);
00143     void myPushFront(RingElemConstRawPtr rawc, const std::vector<long>& expv);
00144     void myPushBack(RingElemConstRawPtr rawc, const std::vector<long>& expv);
00145     void myPushFront(summand* t);
00146     void myPushBack(summand* t);
00147     void RemoveSummand(summand** prev_link);
00148     void InsertSummand(summand* s, summand** prev_link);
00149     friend bool IsZeroAddLCs(DistrMPolyInlPP& f, DistrMPolyInlPP& g);
00150     void myNegate();    ///< MIGHT THROW????
00151 
00152     friend void add(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00153     friend void sub(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00154     //    friend void mul(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00155     friend bool div(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00156     friend void gcd(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00157     friend void output(std::ostream& out, const DistrMPolyInlPP& f);
00158     //    friend bool IsPrintAtom(const DistrMPolyInlPP& f);
00159     //    friend void output(OpenMathOutput& OMOut, const DistrMPolyInlPP& f);
00160     friend bool IsZero(const DistrMPolyInlPP& f);
00161 //     friend bool IsOne(const DistrMPolyInlPP& f);
00162 //     friend bool IsMinusOne(const DistrMPolyInlPP& f);
00163 //     friend bool IsConstant(const DistrMPolyInlPP& f);
00164 //     friend bool IsIndet(std::size_t& index, const DistrMPolyInlPP& f);
00165     friend bool IsMonomial(const DistrMPolyInlPP& f);
00166     friend bool IsEqual(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00167     friend void deriv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP&, std::size_t IndetIndex);
00168     friend void deriv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& f, ConstRefPPMonoidElem x);
00169 
00170     friend void WeylMul(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00171     friend void WeylDiv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00172   private:
00173      void myAddMulSummand(const summand* s, const DistrMPolyInlPP& g, bool SkipLMg);
00174      void myWeylAddMulSummand(const summand* s, const DistrMPolyInlPP& g, bool SkipLMg);
00175 
00176   public:
00177     // iter implements a SparsePolyIter for DistrMPolyInlPP objects
00178     class iter: public SparsePolyIterBase
00179     {
00180     public:
00181       explicit iter(const DistrMPolyInlPP& f);
00182       iter(const DistrMPolyInlPP& f, const summand* TermPtr);
00183       // Default copy ctor and assignment are fine.
00184       // Default dtor is fine.
00185       iter* myClone() const;
00186       bool IamEnded() const;
00187       void myForward();
00188       iter& operator++();
00189       iter operator++(int);
00190       ConstRefRingElem myCoeff() const;
00191       ConstRefPPMonoidElem myPP() const;
00192 //???      bool operator==(const iter& i2) const;
00193 //???      bool operator!=(const iter& i2) const;
00194     protected:
00195       const void* myPolyPtr() const;
00196       const void* myTermPtr() const;
00197     private: // data members
00198       const DistrMPolyInlPP& myPoly;
00199       const summand* mySummand;
00200     };
00201 
00202   };
00203 
00204 
00205   void deriv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP&, std::size_t IndetIndex);
00206   void deriv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& f, ConstRefPPMonoidElem x);
00207 
00208 
00209   // Friend functions - must also be declared outside the class (how very tedious).
00210   const ring& CoeffRing(const DistrMPolyInlPP& f);
00211   const PPMonoid& PPM(const DistrMPolyInlPP& f);
00212 
00213   bool IsCompatible(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00214   std::size_t NumTerms(const DistrMPolyInlPP& f);
00215   ConstRefRingElem LC(const DistrMPolyInlPP& f);
00216   RingElemRawPtr& RawLC(DistrMPolyInlPP& f);
00217   const RingElemRawPtr& RawLC(const DistrMPolyInlPP& f);
00218   RingElem content(const DistrMPolyInlPP& f);
00219   ConstRefPPMonoidElem LPP(const DistrMPolyInlPP& f);
00220   int CmpLPP(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00221   void MoveLM(DistrMPolyInlPP& f, DistrMPolyInlPP& g);
00222   long log(const DistrMPolyInlPP& f, std::size_t IndetIndex);
00223   void DivLM(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00224   bool IsZeroAddLCs(DistrMPolyInlPP& f, DistrMPolyInlPP& g);
00225   void add(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00226   void sub(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00227   bool div(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00228   void gcd(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00229   void output(std::ostream& out, const DistrMPolyInlPP& f);
00230   bool IsPrintAtom(const DistrMPolyInlPP& f);
00231   void output(OpenMathOutput& OMOut, const DistrMPolyInlPP& f);
00232   bool IsZero(const DistrMPolyInlPP& f);
00233   bool IsOne(const DistrMPolyInlPP& f);
00234   bool IsMinusOne(const DistrMPolyInlPP& f);
00235   bool IsConstant(const DistrMPolyInlPP& f);
00236   bool IsIndet(std::size_t& index, const DistrMPolyInlPP& f);
00237   bool IsEqual(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g);
00238   void deriv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP&, std::size_t IndetIndex);
00239   void deriv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& f, ConstRefPPMonoidElem x);
00240 
00241   void WeylMul(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00242   void WeylDiv(DistrMPolyInlPP& lhs, const DistrMPolyInlPP& g, const DistrMPolyInlPP& h);
00243 
00244 
00245   //---------------------------------------------------------------------------
00246   // Inline functions.
00247 
00248   inline std::size_t DistrMPolyInlPP::SummandSize(const ring&, const OrdvArith::reference& OA)
00249   {
00250     return sizeof(summand) + sizeof(OrdvArith::OrdvElem)*(OrdvWords(OA)-1);
00251   }
00252 
00253 
00254   inline const ring& CoeffRing(const DistrMPolyInlPP& f)
00255   {
00256     return f.myCoeffRing;
00257   }
00258 
00259 
00260   inline const PPMonoid& PPM(const DistrMPolyInlPP& f)
00261   {
00262     return f.myPPM;
00263   }
00264 
00265 
00266 //   // Just syntactic sugar
00267 //   inline void DistrMPolyInlPP::myPushFront(RingElemConstRawPtr rawc, const std::vector<SmallExponent_t>& expv)
00268 //   {
00269 //     myPushFront(c, &expv[0]);
00270 //   }
00271 
00272 //   // Just syntactic sugar
00273 //   inline void DistrMPolyInlPP::myPushBack(RingElemConstRawPtr rawc, const std::vector<SmallExponent_t>& expv)
00274 //   {
00275 //     myPushBack(c, &expv[0]);
00276 //   }
00277 
00278 
00279   inline int CmpLPP(const DistrMPolyInlPP& f, const DistrMPolyInlPP& g)
00280   {
00281     CoCoA_ASSERT(!IsZero(f) && !IsZero(g));
00282     return f.myOrdvArith->myCmp(f.mySummands->myOrdv, g.mySummands->myOrdv);
00283   }
00284 
00285 
00286   inline DistrMPolyInlPP::iter::iter(const DistrMPolyInlPP& f):
00287       myPoly(f),
00288       mySummand(f.mySummands)
00289   {}
00290 
00291 
00292   inline DistrMPolyInlPP::iter::iter(const DistrMPolyInlPP& f, const summand* TermPtr):
00293       myPoly(f),
00294       mySummand(TermPtr) // TermPtr *MUST* point to a term in f, or be NULL.
00295   {}
00296 
00297 
00298   inline DistrMPolyInlPP::iter* DistrMPolyInlPP::iter::myClone() const
00299   {
00300     return new iter(*this);
00301   }
00302 
00303 
00304   inline bool DistrMPolyInlPP::iter::IamEnded() const
00305   {
00306     return mySummand == 0;
00307   }
00308 
00309   inline bool IsEnded(const DistrMPolyInlPP::iter& i)
00310   {
00311     return i.IamEnded();
00312   }
00313 
00314 
00315   inline void DistrMPolyInlPP::iter::myForward()
00316   {
00317     CoCoA_ASSERT(!IamEnded());
00318     mySummand = mySummand->myNext;
00319   }
00320 
00321   inline DistrMPolyInlPP::iter& DistrMPolyInlPP::iter::operator++()
00322   {
00323     if (IamEnded()) CoCoA_ERROR(ERR::PolyIterEnded, "DistrMPolyInlPP::iter::op++");
00324     myForward();
00325     return *this;
00326   }
00327 
00328 
00329   inline DistrMPolyInlPP::iter DistrMPolyInlPP::iter::operator++(int)
00330   {
00331     if (IamEnded()) CoCoA_ERROR(ERR::PolyIterEnded, "DistrMPolyInlPP::iter::op++");
00332     iter ans(*this);
00333     myForward();
00334     return ans;
00335   }
00336 
00337 
00338   inline ConstRefRingElem DistrMPolyInlPP::iter::myCoeff() const
00339   {
00340     CoCoA_ASSERT(!IamEnded());
00341     return ConstRefRingElem(CoeffRing(myPoly), mySummand->myCoeff);
00342   }
00343 
00344   inline ConstRefRingElem coeff(const DistrMPolyInlPP::iter& i)
00345   {
00346     if (IsEnded(i)) CoCoA_ERROR(ERR::PolyIterEnded, "coeff(PolyIter)");
00347     return i.myCoeff();
00348   }
00349 
00350 
00351   inline ConstRefPPMonoidElem DistrMPolyInlPP::iter::myPP() const
00352   {
00353     CoCoA_ASSERT(!IamEnded());
00354     return ConstRefPPMonoidElem(PPM(myPoly), PPMonoidElemConstRawPtr(mySummand->myOrdv));
00355   }
00356 
00357   inline ConstRefPPMonoidElem PP(const DistrMPolyInlPP::iter& i)
00358   {
00359     if (IsEnded(i)) CoCoA_ERROR(ERR::PolyIterEnded, "PP(PolyIter)");
00360     return i.myPP();
00361   }
00362 
00363 
00364 //   inline bool DistrMPolyInlPP::iter::operator==(const iter& i2) const
00365 //   {
00366 //     if (&myPoly != &(i2.myPoly)) CoCoA_ERROR(ERR::MixedPolyIters, "PolyIter == PolyIter");
00367 //     return mySummand == i2.mySummand;
00368 //   }
00369 
00370 //   inline bool DistrMPolyInlPP::iter::operator!=(const iter& i2) const
00371 //   {
00372 //     if (&myPoly != &(i2.myPoly)) CoCoA_ERROR(ERR::MixedPolyIters, "PolyIter != PolyIter");
00373 //     return mySummand != i2.mySummand;
00374 //   }
00375 
00376 
00377   inline const void* DistrMPolyInlPP::iter::myPolyPtr() const
00378   {
00379     return &myPoly;
00380   }
00381 
00382 
00383   inline const void* DistrMPolyInlPP::iter::myTermPtr() const
00384   {
00385     return mySummand;
00386   }
00387 
00388 
00389   inline void swap(DistrMPolyInlPP& f, DistrMPolyInlPP& g)
00390   {
00391     DistrMPolyInlPP::ourSwap(f, g);
00392   }
00393 
00394 } // end of namespace CoCoA
00395 
00396 
00397 
00398 // RCS header/log in the next few lines
00399 // $Header: /Volumes/Home/cocoa/cvs-repository/CoCoALib-0.99/include/CoCoA/DistrMPolyInlPP.H,v 1.2 2007/03/12 16:00:29 bigatti Exp $
00400 // $Log: DistrMPolyInlPP.H,v $
00401 // Revision 1.2  2007/03/12 16:00:29  bigatti
00402 // -- moved myLog(F, index) into unique implementation in SparsePolyRing
00403 //
00404 // Revision 1.1.1.1  2007/03/09 15:16:11  abbott
00405 // Imported files
00406 //
00407 // Revision 1.17  2007/03/07 13:42:45  bigatti
00408 // -- removed useless argument and other minor changes
00409 //
00410 // Revision 1.16  2007/01/11 14:04:18  cocoa
00411 // -- added prefix "raw" to RawPtr arguments names
00412 //
00413 // Revision 1.15  2006/12/07 17:36:19  cocoa
00414 // -- migrated  myRemoveBigContent myContent myPowerSmallExp  into
00415 //    single implementation in SparsePolyRing
00416 // -- removed  content  from DistrMPoly(..)
00417 //
00418 // Revision 1.14  2006/12/06 17:09:37  cocoa
00419 // -- removed #include "config.H"
00420 //
00421 // Revision 1.13  2006/11/24 17:16:29  cocoa
00422 // -- reorganized includes of header files
00423 //
00424 // Revision 1.12  2006/11/23 18:01:53  cocoa
00425 // -- moved printing functions in unified implementation in SparsePolyRing
00426 // -- simplified "output(f)" for debugging only
00427 //
00428 // Revision 1.11  2006/11/21 18:09:24  cocoa
00429 // -- added myIsMonomial
00430 // -- implemented myIsOne, myIsMinusOne, myIsConstant, myIsIndet in SparsePolyRing
00431 // -- removed the 4 functions from DistrMPoly(..) and RingDistrMPoly(..)
00432 // -- changed all names of RawPtr arguments into "raw(..)"
00433 //
00434 // Revision 1.10  2006/11/02 13:25:44  cocoa
00435 // Simplification of header files: the OpenMath classes have been renamed.
00436 // Many minor consequential changes.
00437 //
00438 // Revision 1.9  2006/10/16 23:18:59  cocoa
00439 // Corrected use of std::swap and various special swap functions.
00440 // Improved myApply memfn for homs of RingDistrMPolyInlPP.
00441 //
00442 // Revision 1.8  2006/10/09 21:48:51  cocoa
00443 // Commented out "pointless" template specialization of std::swap.
00444 // Added overloading swap functions in CoCoA namespace.
00445 //
00446 // Revision 1.7  2006/10/06 14:04:16  cocoa
00447 // Corrected position of #ifndef in header files.
00448 // Separated CoCoA_ASSERT into assert.H from config.H;
00449 // many minor consequential changes (have to #include assert.H).
00450 // A little tidying of #include directives (esp. in Max's code).
00451 //
00452 // Revision 1.6  2006/10/06 10:00:18  cocoa
00453 // Added independent declarations of functions declared as friends -- permits
00454 // compilation with gcc-4.1 series.  Changes some friends into static member
00455 // functions.
00456 //
00457 // Revision 1.5  2006/08/07 21:23:25  cocoa
00458 // Removed almost all publicly visible references to SmallExponent_t;
00459 // changed to long in all PPMonoid functions and SparsePolyRing functions.
00460 // DivMask remains to sorted out.
00461 //
00462 // Revision 1.4  2006/07/20 17:06:08  cocoa
00463 // -- moved myStdDeg into SparsePolyRing
00464 //
00465 // Revision 1.3  2006/06/22 14:07:18  cocoa
00466 // Minor cleaning and elimination of useless #includes.
00467 //
00468 // Revision 1.2  2006/06/08 16:45:28  cocoa
00469 // -- RingDistrMPoly*.H  have been "moved" into RingDistrMPoly*.C
00470 // -- some coding conventions fixed in DistrMPoly*
00471 // -- functions wdeg and CmpWDeg have a common implementation in SparsePolyRing
00472 //
00473 // Revision 1.1.1.1  2006/05/30 11:39:36  cocoa
00474 // Imported files
00475 //
00476 // Revision 1.11  2006/05/12 16:10:59  cocoa
00477 // Added OpenMathFwd.H, and tidied OpenMath.H.
00478 // Many consequential but trivial changes.
00479 //
00480 // Revision 1.10  2006/04/27 12:19:26  cocoa
00481 // -- coding conventions (myAddMulSummand)
00482 //
00483 // Revision 1.9  2006/04/26 16:44:53  cocoa
00484 // -- myMul has now a single implementation in SparsePolyRing
00485 // -- myMul and mul in RingDistrMPoly* and DistrMPoly* have been disabled
00486 //
00487 // Revision 1.8  2006/03/21 17:55:08  cocoa
00488 // -- changed: "my.." coding conventions
00489 //
00490 // Revision 1.7  2006/03/17 18:08:51  cocoa
00491 // -- changed: mul --> myMulByPP
00492 //
00493 // Revision 1.6  2006/03/16 17:56:14  cocoa
00494 // -- changed: mul, div --> myMulByCoeff, myDivByCoeff (+check IsOne(c))
00495 // -- changed: myOutputSelf for homomorphism
00496 //
00497 // Revision 1.5  2006/03/12 21:28:34  cocoa
00498 // Major check in after many changes
00499 //
00500 // Revision 1.4  2006/03/07 10:06:12  cocoa
00501 // -- fixed: PPMonoidElem LPP(f) now returns ConstRefPPMonoidElem
00502 //
00503 // Revision 1.3  2006/02/20 22:41:20  cocoa
00504 // All forms of the log function for power products now return SmallExponent_t
00505 // (instead of int).  exponents now resizes the vector rather than requiring
00506 // the user to pass in the correct size.
00507 //
00508 // Revision 1.2  2006/02/13 13:17:40  cocoa
00509 // -- fixed: "const PPMonoidElem&" --> "ConstRefPPMonoidElem"
00510 //
00511 // Revision 1.1.1.1  2005/10/17 10:46:54  cocoa
00512 // Imported files
00513 //
00514 // Revision 1.8  2005/09/30 15:03:39  cocoa
00515 // Minor cleaning and tidying.
00516 // DistrMPolyInlPP: use of summands now rather cleaner.
00517 //
00518 // Revision 1.7  2005/08/08 16:36:33  cocoa
00519 // Just checking in before going on holiday.
00520 // Don't really recall what changes have been made.
00521 // Added IsIndet function for RingElem, PPMonoidElem,
00522 // and a member function of OrdvArith.
00523 // Improved the way failed assertions are handled.
00524 //
00525 // Revision 1.6  2005/07/19 15:30:20  cocoa
00526 // A first attempt at iterators over sparse polynomials.
00527 // Main additions are to SparsePolyRing, DistrMPoly*.
00528 // Some consequential changes to PPMonoid*.
00529 //
00530 // Revision 1.5  2005/07/15 16:34:33  cocoa
00531 // Added iterators for sparse polynomials.
00532 // The code compiles (and the old tests still run).
00533 // It'd Friday evening -- I'm going home before
00534 // getting any ideas about making the iterator code run.
00535 //
00536 // Revision 1.4  2005/07/08 15:09:29  cocoa
00537 // Added new symbol class (to represent names of indets).
00538 // Integrated the new class into concrete polynomial rings
00539 // and PPMonoid -- many consequential changes.
00540 // Change ctors for the "inline" sparse poly rings: they no
00541 // longer expect a PPMonoid, but build their own instead
00542 // (has to be a PPMonoidOv).
00543 //
00544 // Revision 1.3  2005/07/01 16:08:16  cocoa
00545 // Friday check-in.  Major change to structure under PolyRing:
00546 // now SparsePolyRing and DUPolyRing are separated (in preparation
00547 // for implementing iterators).
00548 //
00549 // A number of other relatively minor changes had to be chased through
00550 // (e.g. IndetPower).
00551 //
00552 // Revision 1.2  2005/06/22 14:47:56  cocoa
00553 // PPMonoids and PPMonoidElems updated to mirror the structure
00554 // used for rings and RingElems.  Many consequential changes.
00555 //
00556 // Revision 1.1.1.1  2005/05/03 15:47:30  cocoa
00557 // Imported files
00558 //
00559 // Revision 1.3  2005/04/19 14:06:04  cocoa
00560 // Added GPL and GFDL licence stuff.
00561 //
00562 // Revision 1.2  2005/02/11 14:15:20  cocoa
00563 // New style ring elements and references to ring elements;
00564 // I hope I have finally got it right!
00565 //
00566 // Revision 1.1.1.1  2005/01/27 15:12:13  cocoa
00567 // Imported files
00568 //
00569 // Revision 1.15  2004/11/25 16:14:21  cocoa
00570 // (1) Fixed definition of specialization of std::swap template function
00571 //     so that it compiles with gcc 3.4.3
00572 // (2) Implemented monomial function for polynomial rings.
00573 // (3) Added one(PPM) and PPM->myOne() functions.
00574 //
00575 // Revision 1.14  2004/11/11 13:35:48  cocoa
00576 // -- minor changes for doxygen
00577 //
00578 // Revision 1.13  2004/11/08 14:03:32  cocoa
00579 // -- small changes for doxygen support
00580 //
00581 // Revision 1.12  2004/11/02 15:17:26  cocoa
00582 // -- minor changes for doxygen
00583 //
00584 // Revision 1.11  2004/10/29 15:26:17  cocoa
00585 // -- code fixed for compatibility with OrdvArith
00586 //
00587 // Revision 1.9  2004/07/20 15:04:06  cocoa
00588 // The next step in the new "ring element" conversion process:
00589 // handling the case of creating a "const RefRingElem" object
00590 // (since C++ refuses to do this properly itself).
00591 //
00592 // Revision 1.8  2004/03/20 17:46:11  cocoa
00593 // Check in prior to departure to RWCA
00594 //
00595 // Revision 1.7  2004/01/28 16:27:00  cocoa
00596 // Added the necessary for CmpDeg to work.
00597 //
00598 // Revision 1.6  2003/11/14 13:06:05  cocoa
00599 // -- New function "myIsPrintAtom" for printing polynomials and fractions
00600 //
00601 // Revision 1.5  2003/10/17 10:51:06  cocoa
00602 // Major cleaning, and new naming convention.
00603 //
00604 // Revision 1.4  2003/10/09 14:55:20  cocoa
00605 // - minor debugging after merge
00606 //
00607 // Revision 1.3  2003/10/09 12:48:17  cocoa
00608 // New coding convention for rings.
00609 //
00610 // Revision 1.2  2003/10/01 10:35:32  cocoa
00611 // - applied "my" coding convention to PPMonoid and PPOrdering
00612 //
00613 // Revision 1.1.1.1  2003/09/24 12:55:43  cocoa
00614 // Imported files
00615 //
00616 // Revision 1.5  2003/09/17 15:17:16  abbott
00617 // Added missing "reference" to third arg of deriv.
00618 //
00619 // Revision 1.4  2003/06/23 17:03:06  abbott
00620 // Minor cleaning prior to public release.
00621 // Name change, and consequences.
00622 //
00623 // Revision 1.3  2003/05/08 10:40:35  abbott
00624 // Checking in prior to a probable major overhaul (this code is a mess).
00625 // Numerous changes, mostly due to name changes for rings and PPMonoids.
00626 // Added function deriv to compute derivatives.
00627 //
00628 // Revision 1.2  2002/11/18 17:53:26  bigatti
00629 // - AddMulSummand is now private
00630 //
00631 // Revision 1.1  2002/11/15 15:50:31  abbott
00632 // Initial revision
00633 //
00634 //
00635 
00636 #endif

Generated on Wed May 23 13:43:34 2007 for CoCoALib by  doxygen 1.4.6