Changeset 1495df4 in git for kernel/ncSACache.h


Ignore:
Timestamp:
Jul 15, 2008, 6:27:58 PM (16 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
e3164c057b351ebc7de36b8955221b4cb648bdbe
Parents:
67dbdb5d3b02ace5998471f519c0e9ae91a1c63b
Message:
*motsak: special multiplication


git-svn-id: file:///usr/local/Singular/svn/trunk@10868 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/ncSACache.h

    r67dbdb r1495df4  
    1 #ifndef GRING_SA_MULT_H
    2 #define GRING_SA_MULT_H
     1#ifndef GRING_SA_CACHEHASH_H
     2#define GRING_SA_CACHEHASH_H
    33/*****************************************
    44 *  Computer Algebra System SINGULAR     *
    55 *****************************************/
    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 $ */
    77
    88// #include <ncSACache.h> // for CCacheHash etc classes
    99
    1010#include <structs.h>
    11 
     11#include <febase.h> // for Print!
    1212// //////////////////////////////////////////////////////////////////////// //
    1313//
    14 
    15 
    1614
    1715const int iMaxCacheSize = 20;
     
    2018class CCacheHash
    2119{
     20  private:
     21    ring m_basering;
     22    int m_NVars;
     23   
    2224  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   
    2332    enum EHistoryType {
    2433      MULT_LOOKUP
    25     }
     34    };
    2635
    2736    struct CCacheItem
     
    4554   
    4655    // -1 means no hits!
    47     int Lookup(CExponent a, CExponent b, CCacheItem*& pItems) const
     56    int LookupEE(CExponent a, CExponent b, CCacheItem*& pItems)
    4857    {
    4958      History(a, b, MULT_LOOKUP);
     
    5261    }
    5362
    54     bool Store(CExponent a, CExponent b, poly pProduct)
     63    bool StoreEE(CExponent a, CExponent b, poly pProduct)
    5564    {
     65      Print("StoreEE!\n");
    5666      return false; // the pair was not stored!
    5767    };
     
    5969    virtual void History(const CExponent a, const CExponent b, const EHistoryType t)
    6070    {
    61       Print("Mult!\n");
     71      Print("MultHistory!\n");
    6272    }
    6373
    6474  private: // no copy constuctors!
    65     CCacheHash();
    66     operator =(CCacheHash&);
     75    CCacheHash(const CCacheHash&);
     76    CCacheHash& operator=(const CCacheHash&);
    6777};
    6878
     
    7484    typedef poly CExponent;
    7585
     86    CGlobalCacheHash(ring r): CCacheHash<poly>(r) {};
     87
     88    virtual ~CGlobalCacheHash() {};
     89
    7690  protected:
    7791    virtual void History(CExponent a, CExponent b, const EHistoryType t);
    7892};
    79 
    80 
    8193
    8294class CSpecialPairCacheHash: public CCacheHash<int>
     
    8496  public:
    8597    typedef int CExponent;
    86    
     98
     99    CSpecialPairCacheHash(ring r): CCacheHash<int>(r) {};
     100
     101    virtual ~CSpecialPairCacheHash() {};
     102
    87103  protected:
    88104    virtual void History(const CExponent a, const CExponent b, const EHistoryType t);
    89105};
    90106
     107
     108
     109#endif // GRING_SA_CACHEHASH_H
     110
     111
Note: See TracChangeset for help on using the changeset viewer.