source: git/kernel/f5data.h @ 341696

spielwiese
Last change on this file since 341696 was 341696, checked in by Hans Schönemann <hannes@…>, 14 years ago
Adding Id property to all files git-svn-id: file:///usr/local/Singular/svn/trunk@12231 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.7 KB
Line 
1//! \file f5data.cc
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5/* $Id$ */
6/*
7* ABSTRACT: labeled polynomial interface
8*/
9#ifndef F5DATA_HEADER
10#define F5DATA_HEADER
11#ifdef HAVE_F5
12/*!
13=========================================================
14=========================================================
15classes for labeled polynomials/pairs/S-polynomials in F5
16=========================================================
17=========================================================
18*/
19class LPolyOld;
20class CPairOld;
21class RuleOld;
22
23
24/*!
25============================
26class of labeled polynomials
27============================
28*/
29class LPolyOld {
30    private:
31        poly    term;           //term of signature
32        int     index;          //index of signature
33        poly    polynomial;     //standard polynomial data
34        RuleOld*   _RuleOld;
35        bool    del;
36    public:
37        inline          LPolyOld(poly t, int i, poly p, RuleOld* r=NULL);
38        inline  void    setPoly(poly p);
39        inline  poly    getPoly();
40        inline  void    setTerm(poly t);
41        inline  poly    getTerm();
42        inline  void    setIndex(int i);
43        inline  int     getIndex();
44        inline  void    setRuleOld(RuleOld* r);
45        inline  RuleOld*   getRuleOld();
46        inline  void    setDel(bool d);
47        inline  bool    getDel();
48        inline  void    set(poly t, int i, poly p, RuleOld* r);
49        inline  LPolyOld*  get();
50};
51
52LPolyOld::LPolyOld(poly t,int i,poly p, RuleOld* r) {
53    set(t,i,p,r);
54    del =   0;
55}
56
57void LPolyOld::setPoly(poly p)  {
58    //poly _p     =   pInit();
59    //_p          =   pCopy(p);
60    polynomial = p;
61}
62
63void LPolyOld::setTerm(poly t) {
64    //poly _t     =   pInit();
65    //_t          =   pCopy(t);
66    term = t;
67}
68
69void LPolyOld::setIndex(int i) {
70    index = i;
71}
72
73void LPolyOld::setRuleOld(RuleOld* r) {
74    _RuleOld   =   r;
75}
76
77void LPolyOld::setDel(bool d) {
78    del =   d;
79}
80
81poly LPolyOld::getPoly() {
82    return polynomial;
83}
84
85poly LPolyOld::getTerm() {
86    return term;
87}
88
89int LPolyOld::getIndex() {
90    return index;
91}
92
93RuleOld* LPolyOld::getRuleOld() {
94    return _RuleOld;
95}
96
97bool LPolyOld::getDel() {
98    return del;
99}
100
101void LPolyOld::set(poly t, int i, poly p, RuleOld* r) {
102    this->setTerm(t);
103    this->setIndex(i);
104    this->setPoly(p);
105    this->setRuleOld(r);
106}
107
108LPolyOld* LPolyOld::get() {
109    return this;
110}
111
112
113/*!
114===================================
115structure of labeled critical pairs
116===================================
117*/
118class CPairOld {
119    private:
120        long    deg;            // total degree of the critical pair
121        poly    t1;             // first term for label
122        LPolyOld*  lp1;            // first labeled poly
123        poly    t2;             // second term for label
124        LPolyOld*  lp2;            // second labeled poly
125        RuleOld*   testedRuleOld;     // already tested by RuleOlds up to lastRuleOldTested
126        bool  del;
127    public:
128        inline          CPairOld(long degree, poly term1, LPolyOld* LPolyOld1, poly term2, LPolyOld* LPolyOld2, bool useless, RuleOld* r = NULL);
129        inline  long    getDeg();
130        inline  poly    getT1();
131        inline  poly*   getAdT1();
132        inline  LPolyOld*  getAdLp1();
133        inline  poly    getLp1Poly();
134        inline  poly    getLp1Term();
135        inline  int     getLp1Index();
136        inline  poly    getT2();
137        inline  poly*   getAdT2();
138        inline  LPolyOld*  getAdLp2();
139        inline  poly    getLp2Poly();
140        inline  poly    getLp2Term();
141        inline  int     getLp2Index();
142        inline  bool    getDel();
143        inline  RuleOld*   getTestedRuleOld();
144        inline  void    setTestedRuleOld(RuleOld* r);
145};
146
147CPairOld::CPairOld(long degree, poly term1, LPolyOld* LPolyOld1, poly term2, LPolyOld* LPolyOld2, bool useless, RuleOld* r) {
148   deg              =   degree;
149   t1               =   term1;
150   lp1              =   LPolyOld1;
151   t2               =   term2;
152   lp2              =   LPolyOld2;
153   testedRuleOld       =   r;
154   del              =   useless;
155}
156
157long CPairOld::getDeg() {
158    return deg;
159}
160
161poly CPairOld::getT1() {
162    return t1;
163}
164
165poly* CPairOld::getAdT1() {
166    return &t1;
167}
168
169poly* CPairOld::getAdT2() {
170    return &t2;
171}
172
173poly CPairOld::getT2() {
174    return t2;
175}
176
177LPolyOld* CPairOld::getAdLp1() {
178    return lp1;
179}
180
181LPolyOld* CPairOld::getAdLp2() {
182    return lp2;
183}
184
185poly CPairOld::getLp1Poly() {
186    return lp1->getPoly();
187}
188
189poly CPairOld::getLp2Poly() {
190    return lp2->getPoly();
191}
192
193poly CPairOld::getLp1Term() {
194    return lp1->getTerm();
195}
196
197poly CPairOld::getLp2Term() {
198    return lp2->getTerm();
199}
200
201int CPairOld::getLp1Index() {
202    return lp1->getIndex();
203}
204
205int CPairOld::getLp2Index() {
206    return lp2->getIndex();
207}
208
209bool CPairOld::getDel() {
210  return del;
211}
212
213RuleOld* CPairOld::getTestedRuleOld() {
214    return testedRuleOld;
215}
216
217void CPairOld::setTestedRuleOld(RuleOld* r) {
218    testedRuleOld      =   r;
219}
220
221
222/*!
223========================================================
224structure of RuleOlds(i.e. already computed / known labels)
225========================================================
226*/
227class RuleOld {
228    private:
229        int     index;      // index of the labeled polynomial the RuleOld comes from
230        poly    term;       // term of the labeled polynomial the RuleOld comes from
231    public:
232        inline          RuleOld(int i, poly term);
233        inline          ~RuleOld();
234        inline  int     getIndex();
235        inline  poly    getTerm();
236};
237
238RuleOld::RuleOld(int i, poly t) {
239    index   =   i;
240    term    =   t;
241}
242
243RuleOld::~RuleOld() {
244    //pDelete(&term);
245}
246
247int RuleOld::getIndex() {
248    return index;
249}
250
251poly RuleOld::getTerm() {
252    return term;
253}
254#endif
255#endif
Note: See TracBrowser for help on using the repository browser.