Changeset 1495df4 in git for kernel/ncSACache.h
- Timestamp:
- Jul 15, 2008, 6:27:58 PM (16 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- e3164c057b351ebc7de36b8955221b4cb648bdbe
- Parents:
- 67dbdb5d3b02ace5998471f519c0e9ae91a1c63b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ncSACache.h
r67dbdb r1495df4 1 #ifndef GRING_SA_ MULT_H2 #define GRING_SA_ MULT_H1 #ifndef GRING_SA_CACHEHASH_H 2 #define GRING_SA_CACHEHASH_H 3 3 /***************************************** 4 4 * Computer Algebra System SINGULAR * 5 5 *****************************************/ 6 /* $Id: ncSACache.h,v 1. 1 2008-07-11 15:53:28 motsak Exp $ */6 /* $Id: ncSACache.h,v 1.2 2008-07-15 16:27:58 motsak Exp $ */ 7 7 8 8 // #include <ncSACache.h> // for CCacheHash etc classes 9 9 10 10 #include <structs.h> 11 11 #include <febase.h> // for Print! 12 12 // //////////////////////////////////////////////////////////////////////// // 13 13 // 14 15 16 14 17 15 const int iMaxCacheSize = 20; … … 20 18 class CCacheHash 21 19 { 20 private: 21 ring m_basering; 22 int m_NVars; 23 22 24 public: 25 CCacheHash(ring r): m_basering(r), m_NVars(r->N){}; 26 27 const ring GetBasering() const { return m_basering; }; 28 inline int NVars() const { return m_NVars; } 29 30 virtual ~CCacheHash(){}; 31 23 32 enum EHistoryType { 24 33 MULT_LOOKUP 25 } 34 }; 26 35 27 36 struct CCacheItem … … 45 54 46 55 // -1 means no hits! 47 int Lookup (CExponent a, CExponent b, CCacheItem*& pItems) const56 int LookupEE(CExponent a, CExponent b, CCacheItem*& pItems) 48 57 { 49 58 History(a, b, MULT_LOOKUP); … … 52 61 } 53 62 54 bool Store (CExponent a, CExponent b, poly pProduct)63 bool StoreEE(CExponent a, CExponent b, poly pProduct) 55 64 { 65 Print("StoreEE!\n"); 56 66 return false; // the pair was not stored! 57 67 }; … … 59 69 virtual void History(const CExponent a, const CExponent b, const EHistoryType t) 60 70 { 61 Print("Mult !\n");71 Print("MultHistory!\n"); 62 72 } 63 73 64 74 private: // no copy constuctors! 65 CCacheHash( );66 operator =(CCacheHash&);75 CCacheHash(const CCacheHash&); 76 CCacheHash& operator=(const CCacheHash&); 67 77 }; 68 78 … … 74 84 typedef poly CExponent; 75 85 86 CGlobalCacheHash(ring r): CCacheHash<poly>(r) {}; 87 88 virtual ~CGlobalCacheHash() {}; 89 76 90 protected: 77 91 virtual void History(CExponent a, CExponent b, const EHistoryType t); 78 92 }; 79 80 81 93 82 94 class CSpecialPairCacheHash: public CCacheHash<int> … … 84 96 public: 85 97 typedef int CExponent; 86 98 99 CSpecialPairCacheHash(ring r): CCacheHash<int>(r) {}; 100 101 virtual ~CSpecialPairCacheHash() {}; 102 87 103 protected: 88 104 virtual void History(const CExponent a, const CExponent b, const EHistoryType t); 89 105 }; 90 106 107 108 109 #endif // GRING_SA_CACHEHASH_H 110 111
Note: See TracChangeset
for help on using the changeset viewer.