1 | /**************************************** |
---|
2 | * Computer Algebra System SINGULAR * |
---|
3 | ****************************************/ |
---|
4 | /* $Id: f5data.cc,v 1.3 2009-02-06 20:12:35 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,bool d) { |
---|
33 | set(t,i,p,d); |
---|
34 | } |
---|
35 | |
---|
36 | void LPoly::setPoly(poly p) { |
---|
37 | polynomial = p; |
---|
38 | } |
---|
39 | |
---|
40 | void LPoly::setTerm(poly t) { |
---|
41 | term = t; |
---|
42 | } |
---|
43 | |
---|
44 | void LPoly::setIndex(int i) { |
---|
45 | index = i; |
---|
46 | } |
---|
47 | |
---|
48 | void LPoly::setDel(bool b) { |
---|
49 | del = b; |
---|
50 | } |
---|
51 | |
---|
52 | poly LPoly::getPoly() { |
---|
53 | return polynomial; |
---|
54 | } |
---|
55 | |
---|
56 | poly LPoly::getTerm() { |
---|
57 | return term; |
---|
58 | } |
---|
59 | |
---|
60 | int LPoly::getIndex() { |
---|
61 | return index; |
---|
62 | } |
---|
63 | |
---|
64 | bool LPoly::getDel() const { |
---|
65 | return del; |
---|
66 | } |
---|
67 | |
---|
68 | void LPoly::set(poly t, int i, poly p, bool d) { |
---|
69 | this->setTerm(t); |
---|
70 | this->setIndex(i); |
---|
71 | this->setPoly(p); |
---|
72 | this->setDel(d); |
---|
73 | } |
---|
74 | |
---|
75 | LPoly* LPoly::get() { |
---|
76 | return this; |
---|
77 | } |
---|
78 | |
---|
79 | /* |
---|
80 | ==================================== |
---|
81 | functions working on the class CPair |
---|
82 | ==================================== |
---|
83 | */ |
---|
84 | CPair::CPair(long degree, poly term1, LPoly* lpoly1, poly term2, LPoly* lpoly2) { |
---|
85 | deg = degree; |
---|
86 | t1 = term1; |
---|
87 | lp1 = lpoly1; |
---|
88 | t2 = term2; |
---|
89 | lp2 = lpoly2; |
---|
90 | lastRuleTested = NULL; |
---|
91 | } |
---|
92 | |
---|
93 | long CPair::getDeg() { |
---|
94 | return deg; |
---|
95 | } |
---|
96 | |
---|
97 | poly CPair::getT1() { |
---|
98 | return t1; |
---|
99 | } |
---|
100 | |
---|
101 | poly* CPair::getAdT1() { |
---|
102 | return &t1; |
---|
103 | } |
---|
104 | |
---|
105 | poly* CPair::getAdT2() { |
---|
106 | return &t2; |
---|
107 | } |
---|
108 | |
---|
109 | poly CPair::getT2() { |
---|
110 | return t2; |
---|
111 | } |
---|
112 | |
---|
113 | LPoly* CPair::getAdLp1() { |
---|
114 | return lp1; |
---|
115 | } |
---|
116 | |
---|
117 | LPoly* CPair::getAdLp2() { |
---|
118 | return lp2; |
---|
119 | } |
---|
120 | |
---|
121 | poly CPair::getLp1Poly() { |
---|
122 | return lp1->getPoly(); |
---|
123 | } |
---|
124 | |
---|
125 | poly CPair::getLp2Poly() { |
---|
126 | return lp2->getPoly(); |
---|
127 | } |
---|
128 | |
---|
129 | poly CPair::getLp1Term() { |
---|
130 | return lp1->getTerm(); |
---|
131 | } |
---|
132 | |
---|
133 | poly CPair::getLp2Term() { |
---|
134 | return lp2->getTerm(); |
---|
135 | } |
---|
136 | |
---|
137 | int CPair::getLp1Index() { |
---|
138 | return lp1->getIndex(); |
---|
139 | } |
---|
140 | |
---|
141 | int CPair::getLp2Index() { |
---|
142 | return lp2->getIndex(); |
---|
143 | } |
---|
144 | |
---|
145 | Rule* CPair::getLastRuleTested() { |
---|
146 | return lastRuleTested; |
---|
147 | } |
---|
148 | |
---|
149 | /* |
---|
150 | =================================== |
---|
151 | functions working on the class Rule |
---|
152 | =================================== |
---|
153 | */ |
---|
154 | Rule::Rule(int i, poly t, LPoly* l) { |
---|
155 | index = i; |
---|
156 | term = t; |
---|
157 | origin = l; |
---|
158 | } |
---|
159 | |
---|
160 | int Rule::getIndex() { |
---|
161 | return index; |
---|
162 | } |
---|
163 | |
---|
164 | poly Rule::getTerm() { |
---|
165 | return term; |
---|
166 | } |
---|
167 | |
---|
168 | LPoly* Rule::getOrigin() { |
---|
169 | return origin; |
---|
170 | } |
---|
171 | #endif |
---|