[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: |
---|
[341696] | 9 | * Version: $Id$ |
---|
[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 | |
---|
[d6a97c3] | 21 | #include "config.h" |
---|
| 22 | #include <misc/auxiliary.h> |
---|
[03cecc2] | 23 | |
---|
[a7fbdd] | 24 | #ifndef NDEBUG |
---|
| 25 | #define OUTPUT 1 |
---|
| 26 | #else |
---|
| 27 | #define OUTPUT 0 |
---|
[03cecc2] | 28 | #endif |
---|
| 29 | |
---|
[ef7b98] | 30 | namespace |
---|
| 31 | { |
---|
[0276c1] | 32 | static const char* m_Typenames[2] = {"lookup", "store"}; |
---|
[ef7b98] | 33 | } |
---|
[1367162] | 34 | |
---|
[d6a97c3] | 35 | #include <coeffs/numbers.h> |
---|
| 36 | #include "coeffrings.h" |
---|
| 37 | |
---|
| 38 | #include "nc/ncSACache.h" // for CCacheHash etc classes |
---|
| 39 | |
---|
| 40 | #include "monomials/ring.h" |
---|
| 41 | #include "monomials/p_polys.h" |
---|
[a7fbdd] | 42 | |
---|
[1367162] | 43 | |
---|
| 44 | |
---|
[f78891] | 45 | void CGlobalCacheHash::History(const EHistoryType t, const CGlobalCacheHash::CExponent a, const CGlobalCacheHash::CExponent b, const poly p) |
---|
[1367162] | 46 | { |
---|
[f78891] | 47 | #if OUTPUT |
---|
| 48 | Print("History: GlobalPair, Action: %s", m_Typenames[(int)(t)]); |
---|
| 49 | PrintLn(); |
---|
[1495df4] | 50 | PrintS("Left : "); p_Write(a, GetBasering()); |
---|
[f78891] | 51 | PrintS("Right: "); p_Write(b, GetBasering()); |
---|
| 52 | if( t == MULT_STORE ) |
---|
| 53 | { |
---|
| 54 | PrintS("Result: "); p_Write(p, GetBasering()); |
---|
| 55 | } |
---|
| 56 | #endif |
---|
[1367162] | 57 | } |
---|
| 58 | |
---|
| 59 | |
---|
[f78891] | 60 | void CSpecialPairCacheHash::History(const EHistoryType t, const CSpecialPairCacheHash::CExponent a, const CSpecialPairCacheHash::CExponent b, const poly p) |
---|
[1367162] | 61 | { |
---|
[f78891] | 62 | #if OUTPUT |
---|
| 63 | Print("History: SpecialPair, Action: %s", m_Typenames[(int)(t)]); |
---|
| 64 | PrintLn(); |
---|
| 65 | Print("Left : %d, Right: %d", a, b); |
---|
| 66 | PrintLn(); |
---|
| 67 | if( t == MULT_STORE ) |
---|
| 68 | { |
---|
| 69 | PrintS("Result: "); p_Write(p, GetBasering()); |
---|
| 70 | } |
---|
| 71 | #endif |
---|
[1367162] | 72 | } |
---|