1 | /**************************************** |
---|
2 | * Computer Algebra System SINGULAR * |
---|
3 | ****************************************/ |
---|
4 | /* $Id: lpolynomial.cc,v 1.7 2009-01-28 17:21:07 Singular 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 "lpolynomial.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) { |
---|
33 | set(t,i,p); |
---|
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) { |
---|
69 | this->setTerm(t); |
---|
70 | this->setIndex(i); |
---|
71 | this->setPoly(p); |
---|
72 | } |
---|
73 | |
---|
74 | LPoly* LPoly::get() { |
---|
75 | return this; |
---|
76 | } |
---|
77 | |
---|
78 | /* |
---|
79 | ==================================== |
---|
80 | functions working on the class CPair |
---|
81 | ==================================== |
---|
82 | */ |
---|
83 | CPair::CPair(long degree, poly term1, LPoly* lpoly1, poly term2, LPoly* lpoly2) { |
---|
84 | deg = degree; |
---|
85 | t1 = term1; |
---|
86 | lp1 = lpoly1; |
---|
87 | t2 = term2; |
---|
88 | lp2 = lpoly2; |
---|
89 | } |
---|
90 | |
---|
91 | long CPair::getDeg() { |
---|
92 | return deg; |
---|
93 | } |
---|
94 | |
---|
95 | poly CPair::getT1() { |
---|
96 | return t1; |
---|
97 | } |
---|
98 | |
---|
99 | poly CPair::getT2() { |
---|
100 | return t2; |
---|
101 | } |
---|
102 | |
---|
103 | poly CPair::getLp1Poly() { |
---|
104 | return *(lp1->getPoly()); |
---|
105 | } |
---|
106 | |
---|
107 | poly CPair::getLp2Poly() { |
---|
108 | return *(lp2->getPoly()); |
---|
109 | } |
---|
110 | |
---|
111 | poly CPair::getLp1Term() { |
---|
112 | return *(lp1->getTerm()); |
---|
113 | } |
---|
114 | |
---|
115 | poly CPair::getLp2Term() { |
---|
116 | return *(lp2->getTerm()); |
---|
117 | } |
---|
118 | |
---|
119 | int CPair::getLp1Index() { |
---|
120 | return *(lp1->getIndex()); |
---|
121 | } |
---|
122 | |
---|
123 | |
---|
124 | int CPair::getLp2Index() { |
---|
125 | return *(lp2->getIndex()); |
---|
126 | } |
---|
127 | |
---|
128 | |
---|
129 | /* |
---|
130 | =================================== |
---|
131 | functions working on the class Rule |
---|
132 | =================================== |
---|
133 | */ |
---|
134 | Rule::Rule(int* i, poly* t) { |
---|
135 | index = i; |
---|
136 | term = t; |
---|
137 | } |
---|
138 | |
---|
139 | int Rule::getIndex() { |
---|
140 | return *index; |
---|
141 | } |
---|
142 | |
---|
143 | poly Rule::getTerm() { |
---|
144 | return *term; |
---|
145 | } |
---|
146 | #endif |
---|