1 | /**************************************** |
---|
2 | * Computer Algebra System SINGULAR * |
---|
3 | ****************************************/ |
---|
4 | /*************************************************************** |
---|
5 | * File: ncSACache.cc |
---|
6 | * Purpose: implementation of special Cache+Hash for Multiplier |
---|
7 | * Author: motsak |
---|
8 | * Created: |
---|
9 | * Version: $Id$ |
---|
10 | *******************************************************************/ |
---|
11 | |
---|
12 | #define MYTEST 0 |
---|
13 | |
---|
14 | #if MYTEST |
---|
15 | #define OM_CHECK 4 |
---|
16 | #define OM_TRACK 5 |
---|
17 | // these settings must be before "mod2.h" in order to work!!! |
---|
18 | #endif |
---|
19 | |
---|
20 | |
---|
21 | #include "config.h" |
---|
22 | #include <misc/auxiliary.h> |
---|
23 | |
---|
24 | #ifndef NDEBUG |
---|
25 | #define OUTPUT 1 |
---|
26 | #else |
---|
27 | #define OUTPUT 0 |
---|
28 | #endif |
---|
29 | |
---|
30 | namespace |
---|
31 | { |
---|
32 | static const char* m_Typenames[2] = {"lookup", "store"}; |
---|
33 | } |
---|
34 | |
---|
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" |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | void CGlobalCacheHash::History(const EHistoryType t, const CGlobalCacheHash::CExponent a, const CGlobalCacheHash::CExponent b, const poly p) |
---|
46 | { |
---|
47 | #if OUTPUT |
---|
48 | Print("History: GlobalPair, Action: %s", m_Typenames[(int)(t)]); |
---|
49 | PrintLn(); |
---|
50 | PrintS("Left : "); p_Write(a, GetBasering()); |
---|
51 | PrintS("Right: "); p_Write(b, GetBasering()); |
---|
52 | if( t == MULT_STORE ) |
---|
53 | { |
---|
54 | PrintS("Result: "); p_Write(p, GetBasering()); |
---|
55 | } |
---|
56 | #endif |
---|
57 | } |
---|
58 | |
---|
59 | |
---|
60 | void CSpecialPairCacheHash::History(const EHistoryType t, const CSpecialPairCacheHash::CExponent a, const CSpecialPairCacheHash::CExponent b, const poly p) |
---|
61 | { |
---|
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 |
---|
72 | } |
---|