[1367162] | 1 | /**************************************** |
---|
| 2 | * Computer Algebra System SINGULAR * |
---|
| 3 | ****************************************/ |
---|
| 4 | /*************************************************************** |
---|
[1495df4] | 5 | * File: ncSACache.cc |
---|
| 6 | * Purpose: implementation of special Cache+Hash for Multiplier |
---|
[1367162] | 7 | * Author: motsak |
---|
| 8 | * Created: |
---|
[a7fbdd] | 9 | * Version: $Id: ncSACache.cc,v 1.5 2008-07-23 07:09:45 motsak Exp $ |
---|
[1367162] | 10 | *******************************************************************/ |
---|
| 11 | |
---|
[a7fbdd] | 12 | #define MYTEST 0 |
---|
[1367162] | 13 | |
---|
| 14 | #if MYTEST |
---|
| 15 | #define OM_CHECK 4 |
---|
| 16 | #define OM_TRACK 5 |
---|
[a7fbdd] | 17 | // these settings must be before "mod2.h" in order to work!!! |
---|
[1367162] | 18 | #endif |
---|
| 19 | |
---|
[03cecc2] | 20 | |
---|
[a7fbdd] | 21 | #include "mod2.h" |
---|
[03cecc2] | 22 | |
---|
[a7fbdd] | 23 | #ifndef NDEBUG |
---|
| 24 | #define OUTPUT 1 |
---|
| 25 | #else |
---|
| 26 | #define OUTPUT 0 |
---|
[03cecc2] | 27 | #endif |
---|
| 28 | |
---|
[1367162] | 29 | |
---|
[a7fbdd] | 30 | |
---|
[1367162] | 31 | #include <ncSACache.h> // for CCacheHash etc classes |
---|
| 32 | |
---|
| 33 | #include <ring.h> |
---|
| 34 | #include <p_polys.h> |
---|
| 35 | |
---|
[f78891] | 36 | static const char* m_Typenames[2] = {"lookup", "store"}; |
---|
[1367162] | 37 | |
---|
[f78891] | 38 | void CGlobalCacheHash::History(const EHistoryType t, const CGlobalCacheHash::CExponent a, const CGlobalCacheHash::CExponent b, const poly p) |
---|
[1367162] | 39 | { |
---|
[f78891] | 40 | #if OUTPUT |
---|
| 41 | Print("History: GlobalPair, Action: %s", m_Typenames[(int)(t)]); |
---|
| 42 | PrintLn(); |
---|
[1495df4] | 43 | PrintS("Left : "); p_Write(a, GetBasering()); |
---|
[f78891] | 44 | PrintS("Right: "); p_Write(b, GetBasering()); |
---|
| 45 | if( t == MULT_STORE ) |
---|
| 46 | { |
---|
| 47 | PrintS("Result: "); p_Write(p, GetBasering()); |
---|
| 48 | } |
---|
| 49 | #endif |
---|
[1367162] | 50 | } |
---|
| 51 | |
---|
| 52 | |
---|
[f78891] | 53 | void CSpecialPairCacheHash::History(const EHistoryType t, const CSpecialPairCacheHash::CExponent a, const CSpecialPairCacheHash::CExponent b, const poly p) |
---|
[1367162] | 54 | { |
---|
[f78891] | 55 | #if OUTPUT |
---|
| 56 | Print("History: SpecialPair, Action: %s", m_Typenames[(int)(t)]); |
---|
| 57 | PrintLn(); |
---|
| 58 | Print("Left : %d, Right: %d", a, b); |
---|
| 59 | PrintLn(); |
---|
| 60 | if( t == MULT_STORE ) |
---|
| 61 | { |
---|
| 62 | PrintS("Result: "); p_Write(p, GetBasering()); |
---|
| 63 | } |
---|
| 64 | #endif |
---|
[1367162] | 65 | } |
---|