CoCoALib-0.9905 date: 23 May 2007


RingFp.H

Go to the documentation of this file.
00001 #ifndef CoCoA_RingFp_H
00002 #define CoCoA_RingFp_H
00003 
00004 //   Copyright (c)  2005,2006  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 #include "CoCoA/QuotientRing.H"
00024 
00025 namespace CoCoA
00026 {
00027 
00028   QuotientRing NewRingFp(long p);
00029   QuotientRing NewRingFp(const ZZ& P);
00030   QuotientRing NewRingFp(const ideal& I);
00031 
00032   bool IsRingFp(const ring& R); ///< DO NOT USE this function unless you really know what you're doing!
00033 
00034 } // end of namespace CoCoA
00035 
00036 
00037 
00038 // RCS header/log
00039 // $Header: /Volumes/Home/cocoa/cvs-repository/CoCoALib-0.99/include/CoCoA/RingFp.H,v 1.1.1.1 2007/03/09 15:16:11 abbott Exp $
00040 // $Log: RingFp.H,v $
00041 // Revision 1.1.1.1  2007/03/09 15:16:11  abbott
00042 // Imported files
00043 //
00044 // Revision 1.5  2007/03/02 10:47:53  cocoa
00045 // First stage of RingZ modifications -- tests do not compile currently, Anna will fix this.
00046 //
00047 // Revision 1.4  2006/12/06 17:21:56  cocoa
00048 // -- removed #include "config.H"
00049 //
00050 // Revision 1.3  2006/10/06 10:15:53  cocoa
00051 // In response to Susan's bug: a fiasco when compiling with CoCoA_MEMPOOL_DEBUG
00052 // set wrongly.  Moved several implementation classes out of their header files
00053 // into the implementation files.  Several functions had to be uninlined.
00054 // Also corrected position of #include, etc.
00055 //
00056 // Revision 1.2  2006/08/07 21:23:25  cocoa
00057 // Removed almost all publicly visible references to SmallExponent_t;
00058 // changed to long in all PPMonoid functions and SparsePolyRing functions.
00059 // DivMask remains to sorted out.
00060 //
00061 // Revision 1.1.1.1  2006/05/30 11:39:37  cocoa
00062 // Imported files
00063 //
00064 // Revision 1.7  2006/05/29 16:22:37  cocoa
00065 // Third time lucky???
00066 // Added myIsInteger member function to all rings (NYI for RingFloat).
00067 //
00068 // Revision 1.6  2006/05/12 16:10:58  cocoa
00069 // Added OpenMathFwd.H, and tidied OpenMath.H.
00070 // Many consequential but trivial changes.
00071 //
00072 // Revision 1.5  2006/04/21 15:01:36  cocoa
00073 // Changed default implementation of RingBase::myGcd -- it now gives a SERIOUS
00074 // error.  All fields must now handle a call to gcd explicitly: they can use
00075 // the new myGcdInField function.  It's now cleaner than it was.
00076 //
00077 // Revision 1.4  2006/03/15 18:09:31  cocoa
00078 // Changed names of member functions which print out their object
00079 // into myOutputSelf -- hope this will appease the Intel C++ compiler.
00080 //
00081 // Revision 1.3  2006/03/14 15:01:49  cocoa
00082 // Improved the implementation of ring member fns for computing powers.
00083 // Should keep Intel C++ compiler quieter too.
00084 //
00085 // Revision 1.2  2006/03/12 21:28:34  cocoa
00086 // Major check in after many changes
00087 //
00088 // Revision 1.1.1.1  2005/10/17 10:46:54  cocoa
00089 // Imported files
00090 //
00091 // Revision 1.3  2005/10/14 15:25:07  cocoa
00092 // Major tidying and cleaning to small prime finite fields.
00093 // Several consequential changes.  Improved their documentation.
00094 //
00095 // Added Makefile and script to include/CoCoA/ directory to
00096 // keep library.H up to date.
00097 //
00098 // Revision 1.2  2005/10/11 16:37:30  cocoa
00099 // Added new small prime finite field class (see RingFpDouble).
00100 //
00101 // Cleaned makefiles and configuration script.
00102 //
00103 // Tidied PPMonoid code (to eliminate compiler warnings).
00104 //
00105 // Fixed bug in RingFloat::myIsInteger.
00106 //
00107 // Revision 1.1.1.1  2005/05/03 15:47:30  cocoa
00108 // Imported files
00109 //
00110 // Revision 1.3  2005/04/19 14:06:04  cocoa
00111 // Added GPL and GFDL licence stuff.
00112 //
00113 // Revision 1.2  2005/02/11 14:15:20  cocoa
00114 // New style ring elements and references to ring elements;
00115 // I hope I have finally got it right!
00116 //
00117 // Revision 1.1.1.1  2005/01/27 15:12:13  cocoa
00118 // Imported files
00119 //
00120 // Revision 1.18  2004/11/18 18:33:41  cocoa
00121 // Now every ring know its own "one" element (as well as "zero").
00122 // Several consequential changes.
00123 //
00124 // Revision 1.17  2004/11/11 13:04:30  cocoa
00125 // -- added \include *.txt for doxygen
00126 //
00127 // Revision 1.16  2004/11/05 15:34:33  cocoa
00128 // Consequential change following from the renaming of
00129 // FieldIdealImpl and the introduction of the new pseudo-ctor.
00130 //
00131 // Revision 1.15  2004/11/04 18:47:43  cocoa
00132 // (1) Ring member functions which previously expected mpz_t args
00133 //     now expect ZZ args.  Numerous minor consequential changes.
00134 // (2) Renamed function which gives access to the mpz_t value inside
00135 //     a ZZ object: previously was raw(...), now is mpzref(...).
00136 //     Plenty of calls had to be altered.
00137 //
00138 // Revision 1.14  2004/07/27 16:03:39  cocoa
00139 // Added IsCommutative test and IamCommutative member function
00140 // to all rings.  Tidied geobuckets a little.
00141 //
00142 // Revision 1.13  2004/07/16 15:45:12  cocoa
00143 // First stage of new RingElem implementation completed.
00144 //
00145 // Revision 1.12  2004/07/14 16:40:42  cocoa
00146 // Separated RingFpLog from its implementation which now resides in
00147 // a new class: SmallFpLogImpl.  This is analogous to the change made
00148 // to RingFp yesterday.
00149 //
00150 // Some tidying and other sundry minor changes.
00151 //
00152 // Revision 1.11  2004/07/13 16:32:26  cocoa
00153 // First stage of major revamp of ring elements.
00154 // Implementation of RingFp has been split into "ring interface"
00155 // and "algorithms plus data structures".
00156 //
00157 // Revision 1.10  2004/05/24 15:52:13  cocoa
00158 // Major update:
00159 //   new error mechanism
00160 //   many fixes
00161 //   RingHoms almost work now
00162 //   RingFloat much improved
00163 //
00164 // Revision 1.9  2004/04/08 15:33:34  cocoa
00165 // Added function IsInteger, and the related RingBase::myIsInteger
00166 // virtual function, plus all necessary implementations.
00167 //
00168 // Revision 1.8  2004/03/20 17:46:10  cocoa
00169 // Check in prior to departure to RWCA
00170 //
00171 // Revision 1.7  2004/02/03 16:16:20  cocoa
00172 // Removed pointless IamGCDDomain functions from several concrete rings.
00173 // Added IamOrderedDomain functions where appropriate.
00174 // Tidied ctors for the small finite fields.
00175 //
00176 // Revision 1.6  2004/01/30 14:07:10  cocoa
00177 // Tidied RingRawValue union: now it contains just two fields,
00178 // and has no need of forward declarations of types used internally
00179 // by the concrete rings -- it uses explicitly a void* instead.
00180 //
00181 // I have tidied the "import" functions used by most concrete rings.
00182 //
00183 // I have moved the choice of representation type for RingFp and RingFpLog
00184 // into a typedef in config.H -- this is to recognise that different
00185 // choices may work best on different platforms.
00186 //
00187 // Revision 1.5  2003/11/14 13:06:05  cocoa
00188 // -- New function "myIsPrintAtom" for printing polynomials and fractions
00189 //
00190 // Revision 1.4  2003/10/17 10:51:06  cocoa
00191 // Major cleaning, and new naming convention.
00192 //
00193 // Revision 1.3  2003/10/09 14:55:19  cocoa
00194 // - minor debugging after merge
00195 //
00196 // Revision 1.2  2003/10/09 12:15:45  cocoa
00197 // New coding convention for rings.
00198 //
00199 // Revision 1.19  2003/06/23 16:53:23  abbott
00200 // Minor cleaning prior to public release.
00201 // Just a name change to following coding conventions.
00202 //
00203 // Revision 1.18  2003/04/24 16:11:24  abbott
00204 // Made exgcd a static member function so it could "see" the private type
00205 // ring_Fp::FpElem (previously it had been public).
00206 //
00207 // Revision 1.17  2003/04/23 10:05:45  abbott
00208 // Predominantly some minor tidying:
00209 //  * typedef for FpElem is now private (it is an implementation detail)
00210 //  * disabled copy ctor and assignment for ring_Fp
00211 //  * ctor for ring_Fp::hom now expects a QuotientRing (instead of ring)
00212 //  * added commented out code to allow use of doubles in ring_Fp::mul
00213 //
00214 // Revision 1.16  2003/04/17 16:50:19  abbott
00215 // Numerous changes:
00216 //  * added mem fns ring_Fp::IsOne, IsMinusOne, init and assign from ZZ
00217 //    (needed by RingBase)
00218 //  * ring_Fp now derived from QuotientRingBase
00219 //  * constructor for ring_Fp is now compatible with NewQuotientRing
00220 //  * added mem fns ring_Fp::CanonRepr and ReduceModI (needed by QuotientRingBase)
00221 //  * added mem fns ring_Fp::NewIdeal and ReduceMod (needed by RingBase to
00222 //    handle ideals)
00223 //  * added mem fns ring_Fp::compose and MakeInducedHom (needed by RingBase
00224 //    and QuotientRingBase to handle homomorphisms).
00225 //  * added ring_Fp::hom class to represent homomorphisms
00226 //  * no need for a class to handle ideals as FieldIdeal does that already.
00227 //
00228 // Revision 1.15  2002/11/14 18:05:05  abbott
00229 // Revised in line with the renaming in ring.H.
00230 //
00231 // Revision 1.14  2002/07/05 15:22:24  abbott
00232 // Added member function IsDivisible.
00233 //
00234 // Revision 1.13  2002/06/28 14:48:28  abbott
00235 // Now the zero element is pointed by an auto_ptr (to be consistent with
00236 // other rings).  The member typedef "elem" is now called "FpElem".
00237 //
00238 // Revision 1.12  2002/06/27 16:09:34  abbott
00239 // Added declaration for the specialized definition of the
00240 // member function "power", previously the default definition
00241 // (sequential powering) was inherited.
00242 //
00243 // Revision 1.11  2002/06/22 17:08:54  abbott
00244 // Changed name of "equal" member function to "IsEqual" (as per new ring.H).
00245 //
00246 // Revision 1.10  2002/05/19 17:39:29  abbott
00247 // Added IsField and zero member functions.
00248 //
00249 // Revision 1.9  2002/05/15 15:00:36  abbott
00250 // Updated the "virtual" interface to agree with the revised ring.H.
00251 // Tidied layout.
00252 // Altered data member name (now accords with coding conventions).
00253 //
00254 // Revision 1.8  2002/02/08 11:13:43  bigatti
00255 // - changed syntax to IsZeroAddMul
00256 //
00257 // Revision 1.7  2002/01/30 15:13:47  abbott
00258 // Constructor now takes an unsigned long (previously unsigned int).
00259 // Added the IsZeroAddMul function required by new ring.H.
00260 //
00261 // Revision 1.6  2001/12/07 18:23:13  abbott
00262 // Changed names in accordance with the new cpding conventions.
00263 //
00264 // Revision 1.5  2001/11/23 20:57:25  abbott
00265 // Added assignment from a long (member of ring_Fp).
00266 //
00267 // Revision 1.4  2001/11/16 18:52:13  bigatti
00268 // added: std::
00269 // for compatibility with gcc-3
00270 //
00271 // Revision 1.3  2001/11/07 20:56:01  abbott
00272 // The change of ring::raw_elem to a union (from a void*) permits "inline"
00273 // small finite field coefficients.  In turn, this obviates the need for
00274 // a MemPool which has been removed.
00275 //
00276 // Revision 1.2  2001/10/29 20:39:41  abbott
00277 // Some minor friend declarations to permit compilation.
00278 // Added a MemPool to manage the storage used by the finite field values.
00279 // Once again the question of whether to put the values in directly
00280 // rather than use pointers arises -- related to the void*/union question
00281 // for ring::raw_elem values.
00282 //
00283 // Revision 1.1  2001/10/05 12:55:32  abbott
00284 // Initial revision
00285 //
00286 
00287 #endif

Generated on Wed May 23 13:45:24 2007 for CoCoALib by  doxygen 1.4.6