1 | /**************************************** |
---|
2 | * Computer Algebra System SINGULAR * |
---|
3 | ****************************************/ |
---|
4 | /* $Id: f5data.cc,v 1.7 2009-02-18 20:43:05 ederc Exp $ */ |
---|
5 | /* |
---|
6 | * ABSTRACT: lpolynomial definition |
---|
7 | */ |
---|
8 | #include "mod2.h" |
---|
9 | |
---|
10 | #ifdef HAVE_F5 |
---|
11 | #include "kutil.h" |
---|
12 | #include "structs.h" |
---|
13 | #include "omalloc.h" |
---|
14 | #include "polys.h" |
---|
15 | #include "p_polys.h" |
---|
16 | #include "ideals.h" |
---|
17 | #include "febase.h" |
---|
18 | #include "kstd1.h" |
---|
19 | #include "khstd.h" |
---|
20 | #include "kbuckets.h" |
---|
21 | #include "weight.h" |
---|
22 | #include "intvec.h" |
---|
23 | #include "pInline1.h" |
---|
24 | #include "f5gb.h" |
---|
25 | #include "f5data.h" |
---|
26 | #include "f5lists.h" |
---|
27 | /* |
---|
28 | ================================================================ |
---|
29 | all functions working on the class LPoly for labeled polynomials |
---|
30 | ================================================================ |
---|
31 | */ |
---|
32 | LPoly::LPoly(poly t,int i,poly p, Rule* r) { |
---|
33 | set(t,i,p,r); |
---|
34 | } |
---|
35 | |
---|
36 | void LPoly::setPoly(poly p) { |
---|
37 | //poly _p = pInit(); |
---|
38 | //_p = pCopy(p); |
---|
39 | polynomial = p; |
---|
40 | } |
---|
41 | |
---|
42 | void LPoly::setTerm(poly t) { |
---|
43 | //poly _t = pInit(); |
---|
44 | //_t = pCopy(t); |
---|
45 | term = t; |
---|
46 | } |
---|
47 | |
---|
48 | void LPoly::setIndex(int i) { |
---|
49 | index = i; |
---|
50 | } |
---|
51 | |
---|
52 | void LPoly::setRule(Rule* r) { |
---|
53 | _rule = r; |
---|
54 | } |
---|
55 | |
---|
56 | poly LPoly::getPoly() { |
---|
57 | return polynomial; |
---|
58 | } |
---|
59 | |
---|
60 | poly LPoly::getTerm() { |
---|
61 | return term; |
---|
62 | } |
---|
63 | |
---|
64 | int LPoly::getIndex() { |
---|
65 | return index; |
---|
66 | } |
---|
67 | |
---|
68 | Rule* LPoly::getRule() { |
---|
69 | return _rule; |
---|
70 | } |
---|
71 | void LPoly::set(poly t, int i, poly p, Rule* r) { |
---|
72 | this->setTerm(t); |
---|
73 | this->setIndex(i); |
---|
74 | this->setPoly(p); |
---|
75 | this->setRule(r); |
---|
76 | } |
---|
77 | |
---|
78 | LPoly* LPoly::get() { |
---|
79 | return this; |
---|
80 | } |
---|
81 | |
---|
82 | /* |
---|
83 | ==================================== |
---|
84 | functions working on the class CPair |
---|
85 | ==================================== |
---|
86 | */ |
---|
87 | CPair::CPair(long degree, poly term1, LPoly* lpoly1, poly term2, LPoly* lpoly2) { |
---|
88 | deg = degree; |
---|
89 | t1 = term1; |
---|
90 | lp1 = lpoly1; |
---|
91 | t2 = term2; |
---|
92 | lp2 = lpoly2; |
---|
93 | lastRuleTested = NULL; |
---|
94 | } |
---|
95 | |
---|
96 | long CPair::getDeg() { |
---|
97 | return deg; |
---|
98 | } |
---|
99 | |
---|
100 | poly CPair::getT1() { |
---|
101 | return t1; |
---|
102 | } |
---|
103 | |
---|
104 | poly* CPair::getAdT1() { |
---|
105 | return &t1; |
---|
106 | } |
---|
107 | |
---|
108 | poly* CPair::getAdT2() { |
---|
109 | return &t2; |
---|
110 | } |
---|
111 | |
---|
112 | poly CPair::getT2() { |
---|
113 | return t2; |
---|
114 | } |
---|
115 | |
---|
116 | LPoly* CPair::getAdLp1() { |
---|
117 | return lp1; |
---|
118 | } |
---|
119 | |
---|
120 | LPoly* CPair::getAdLp2() { |
---|
121 | return lp2; |
---|
122 | } |
---|
123 | |
---|
124 | poly CPair::getLp1Poly() { |
---|
125 | return lp1->getPoly(); |
---|
126 | } |
---|
127 | |
---|
128 | poly CPair::getLp2Poly() { |
---|
129 | return lp2->getPoly(); |
---|
130 | } |
---|
131 | |
---|
132 | poly CPair::getLp1Term() { |
---|
133 | return lp1->getTerm(); |
---|
134 | } |
---|
135 | |
---|
136 | poly CPair::getLp2Term() { |
---|
137 | return lp2->getTerm(); |
---|
138 | } |
---|
139 | |
---|
140 | int CPair::getLp1Index() { |
---|
141 | return lp1->getIndex(); |
---|
142 | } |
---|
143 | |
---|
144 | int CPair::getLp2Index() { |
---|
145 | return lp2->getIndex(); |
---|
146 | } |
---|
147 | |
---|
148 | Rule* CPair::getLastRuleTested() { |
---|
149 | return lastRuleTested; |
---|
150 | } |
---|
151 | |
---|
152 | void CPair::setLastRuleTested(Rule* r) { |
---|
153 | lastRuleTested = r; |
---|
154 | } |
---|
155 | |
---|
156 | /* |
---|
157 | =================================== |
---|
158 | functions working on the class Rule |
---|
159 | =================================== |
---|
160 | */ |
---|
161 | Rule::Rule(int i, poly t) { |
---|
162 | index = i; |
---|
163 | term = t; |
---|
164 | } |
---|
165 | |
---|
166 | int Rule::getIndex() { |
---|
167 | return index; |
---|
168 | } |
---|
169 | |
---|
170 | poly Rule::getTerm() { |
---|
171 | return term; |
---|
172 | } |
---|
173 | #endif |
---|