CoCoALib-0.9905 date: 23 May 2007


FreeModule.H

Go to the documentation of this file.
00001 #ifndef CoCoA_FreeModule_H
00002 #define CoCoA_FreeModule_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 FreeModule
00024 
00025 
00026 #include "CoCoA/EFGModule.H"
00027 #include "CoCoA/degree.H"
00028 
00029 
00030 namespace CoCoA
00031 {
00032 
00033   class module;             // forward declaration -- defined in module.H
00034   class ring;               // forward declaration -- defined in ring.H
00035   class ConstRefPPMonoidElem; // forward declaration -- defined in PPMonoid.H
00036   class ModuleTermOrdering; // forward declaration -- defined in ModuleTermOrdering.H
00037   class SparsePolyRing;     // forward declaration -- defined in SparsePolyRing.H
00038 
00039   class FreeModuleBase: public EFGModuleBase
00040   {};
00041 
00042   /*-----------------------------------------------------------------*/
00043   /** \include FreeModule.txt  */
00044   /*-----------------------------------------------------------------*/
00045   class FreeModule: public EFGModule
00046   {
00047   public:
00048     // Default copy ctor is OK.
00049     explicit FreeModule(const FreeModuleBase* MPtr);   //??? public???
00050     explicit FreeModule(const module& M);        // specializing copy ctor
00051 //???    module& operator=(const module& rhs);
00052     ~FreeModule();
00053 
00054     const FreeModuleBase* myModulePtr() const;
00055     const FreeModuleBase* operator->() const;  // allow const member fns to be called
00056   };
00057 
00058 
00059   FreeModule NewFreeModule(const ring& R, std::size_t NumCompts);
00060   bool IsFreeModule(const module& M);
00061   FreeModule AsFreeModule(const module& M);
00062   size_t FirstNonZeroPos(const ModuleElem& v);
00063 
00064 
00065   //---------------------------------------------------------------------------
00066   // Inline functions  -- order is important
00067 
00068   inline const FreeModuleBase* FreeModule::operator->() const
00069   {
00070     return static_cast<const FreeModuleBase*>(myRawPtr());
00071   }
00072 
00073 //   class GradedFreeModule: public FreeModule  // copied from SparsePolyRing
00074 //   {
00075 //   public:
00076 //     explicit GradedFreeModule(const GradedFreeModuleImpl* MPtr);
00077 //     // Default copy ctor works fine.
00078 //     // Default dtor works fine.
00079 //   private: // disable assignment
00080 //     GradedFreeModule& operator=(const GradedFreeModule& rhs); // NEVER DEFINED -- assignment disabled
00081 //   public:
00082 //     const GradedFreeModuleImpl* operator->() const; // allow member fns to be called
00083 //   };
00084 
00085 
00086   const std::vector<degree>& shifts(const FreeModule& M); ///< defined only if GradedFreeModuleImpl
00087   const ModuleTermOrdering& ordering(const FreeModule& M); ///< defined only if GradedFreeModuleImpl
00088 
00089   FreeModule NewGradedFreeModule(const SparsePolyRing& P, std::size_t NumCompts);  ///< this is not intended for public use: NewFreeModule is intelligent
00090   FreeModule NewFreeModule(const ring& P, const ModuleTermOrdering& O); // inline
00091   bool IsGradedFreeModule(const module& M);
00092 
00093   std::size_t LPos(const ModuleElem& v);
00094   degree wdeg(const ModuleElem& v);
00095   int CmpWDeg(const ModuleElem& v1, const ModuleElem& v2);
00096   ConstRefPPMonoidElem LPP(const ModuleElem& v);
00097   bool IsHomogeneous(const ModuleElem& v);
00098 
00099 } // end of namespace CoCoA
00100 
00101 
00102 
00103 // RCS header/log in the next few lines
00104 // $Header: /Volumes/Home/cocoa/cvs-repository/CoCoALib-0.99/include/CoCoA/FreeModule.H,v 1.1.1.1 2007/03/09 15:16:11 abbott Exp $
00105 // $Log: FreeModule.H,v $
00106 // Revision 1.1.1.1  2007/03/09 15:16:11  abbott
00107 // Imported files
00108 //
00109 // Revision 1.6  2006/12/06 17:11:16  cocoa
00110 // -- removed #include "config.H"
00111 //
00112 // Revision 1.5  2006/11/24 17:17:58  cocoa
00113 // -- reorganized includes of header files
00114 //
00115 // Revision 1.4  2006/11/14 17:46:20  cocoa
00116 // -- changed: reference counting in modules now uses SmartPtrIRC
00117 //
00118 // Revision 1.3  2006/10/06 09:53:06  cocoa
00119 // Moved definition of FreeModuleImpl out of the header file.
00120 // Merged GradedFreeModule code into here so it can access FreeModuleImpl
00121 // (which is no longer visible in the header file).
00122 //
00123 // Revision 1.2  2006/07/18 10:51:25  cocoa
00124 // -- added: FirstNonZeroPos
00125 //
00126 // Revision 1.1.1.1  2006/05/30 11:39:36  cocoa
00127 // Imported files
00128 //
00129 // Revision 1.10  2006/05/12 16:10:59  cocoa
00130 // Added OpenMathFwd.H, and tidied OpenMath.H.
00131 // Many consequential but trivial changes.
00132 //
00133 // Revision 1.9  2006/05/04 14:25:16  cocoa
00134 // -- major cleaning of FreeModule: created GradedFreeModule and moved
00135 //    some code around
00136 //
00137 // Revision 1.8  2006/04/21 14:56:33  cocoa
00138 // Changed return type of myCompt member function: now it returns a
00139 // ConstRefRingElem instead of a RingElem (i.e. a copy).
00140 //
00141 // Revision 1.7  2006/03/27 12:21:26  cocoa
00142 // Minor silly changes to reduce number of complaints from some compiler or other.
00143 //
00144 // Revision 1.6  2006/03/15 18:09:31  cocoa
00145 // Changed names of member functions which print out their object
00146 // into myOutputSelf -- hope this will appease the Intel C++ compiler.
00147 //
00148 // Revision 1.5  2006/03/12 21:28:34  cocoa
00149 // Major check in after many changes
00150 //
00151 // Revision 1.4  2005/12/31 12:22:18  cocoa
00152 // Several minor tweaks to silence the Microsoft compiler:
00153 //  - added some missing #includes and using directives
00154 //  - moved some function defns into the right namespace
00155 //  - etc.
00156 //
00157 // Revision 1.3  2005/11/29 13:04:47  cocoa
00158 // -- added "const" to myCompt argument
00159 //
00160 // Revision 1.2  2005/11/24 16:09:38  cocoa
00161 // -- added operator[] for ModuleElem
00162 //
00163 // Revision 1.1.1.1  2005/10/17 10:46:54  cocoa
00164 // Imported files
00165 //
00166 // Revision 1.3  2005/09/28 11:50:35  cocoa
00167 // -- new code for graded modules
00168 //
00169 // Revision 1.2  2005/06/22 14:42:16  cocoa
00170 // Renamed MemPool data member to myMemMgr
00171 // (seems more sensible than myMemory).
00172 //
00173 // Revision 1.1.1.1  2005/05/03 15:47:30  cocoa
00174 // Imported files
00175 //
00176 // Revision 1.4  2005/04/20 15:40:48  cocoa
00177 // Major change: modified the standard way errors are to be signalled
00178 // (now via a macro which records filename and line number).  Updated
00179 // documentation in error.txt accordingly.
00180 //
00181 // Improved the documentation in matrix.txt (still more work to be done).
00182 //
00183 // Revision 1.3  2005/04/19 14:06:04  cocoa
00184 // Added GPL and GFDL licence stuff.
00185 //
00186 // Revision 1.2  2005/02/11 14:15:20  cocoa
00187 // New style ring elements and references to ring elements;
00188 // I hope I have finally got it right!
00189 //
00190 // Revision 1.1.1.1  2005/01/27 15:12:13  cocoa
00191 // Imported files
00192 //
00193 // Revision 1.4  2004/11/12 15:49:29  cocoa
00194 // Tidying prior to 0.90 release.
00195 // (a) documentation improved (or marked as poor)
00196 // (b) sundry minor improvements to the code
00197 //
00198 // Revision 1.3  2004/11/08 14:03:32  cocoa
00199 // -- small changes for doxygen support
00200 //
00201 // Revision 1.2  2004/01/28 15:56:49  cocoa
00202 // "Old style" code, brought in alignment with the new coding conventions.
00203 //
00204 // Revision 1.1.1.1  2003/09/24 12:55:43  cocoa
00205 // Imported files
00206 //
00207 
00208 #endif

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