source: git/kernel/f5data.h @ eb72ba1

spielwiese
Last change on this file since eb72ba1 was eb72ba1, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: eliminated 'bad' variables (due to C++ standard) for the ticket #333: e.g. kernel/f5data.h: _RuleOld, kernel/mpr_base.cc: _Qi, kernel/p_polys.cc: _(External|Shifted)?Components From: Oleksandr Motsak <motsak@mathematik.uni-kl.de> git-svn-id: file:///usr/local/Singular/svn/trunk@14205 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.9 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          LPolyOld(poly t, int i, poly p, RuleOld* r=NULL, bool b=0);
39        inline  void    setPoly(poly p);
40        inline  poly    getPoly();
41        inline  void    setTerm(poly t);
42        inline  poly    getTerm();
43        inline  void    setIndex(int i);
44        inline  int     getIndex();
45        inline  void    setRuleOld(RuleOld* r);
46        inline  RuleOld*   getRuleOld();
47        inline  void    setDel(bool d);
48        inline  bool    getDel();
49        inline  void    set(poly t, int i, poly p, RuleOld* r);
50        inline  LPolyOld*  get();
51};
52
53LPolyOld::LPolyOld(poly t,int i,poly p, RuleOld* r) {
54    set(t,i,p,r);
55    del =   0;
56}
57
58/*LPolyOld::LPolyOld(poly t,int i,poly p, RuleOld* r, bool b) {
59    set(t,i,p,r);
60    del =   b;
61}
62*/
63void LPolyOld::setPoly(poly p)  {
64    //poly _p     =   pInit();
65    //_p          =   pCopy(p);
66    polynomial = p;
67}
68
69void LPolyOld::setTerm(poly t) {
70    //poly _t     =   pInit();
71    //_t          =   pCopy(t);
72    term = t;
73}
74
75void LPolyOld::setIndex(int i) {
76    index = i;
77}
78
79void LPolyOld::setRuleOld(RuleOld* r) {
80    _ruleOld   =   r;
81}
82
83void LPolyOld::setDel(bool d) {
84    del =   d;
85}
86
87poly LPolyOld::getPoly() {
88    return polynomial;
89}
90
91poly LPolyOld::getTerm() {
92    return term;
93}
94
95int LPolyOld::getIndex() {
96    return index;
97}
98
99RuleOld* LPolyOld::getRuleOld() {
100    return _ruleOld;
101}
102
103bool LPolyOld::getDel() {
104    return del;
105}
106
107void LPolyOld::set(poly t, int i, poly p, RuleOld* r) {
108    this->setTerm(t);
109    this->setIndex(i);
110    this->setPoly(p);
111    this->setRuleOld(r);
112}
113
114LPolyOld* LPolyOld::get() {
115    return this;
116}
117
118
119/*!
120===================================
121structure of labeled critical pairs
122===================================
123*/
124class CPairOld {
125    private:
126        long    deg;            // total degree of the critical pair
127        poly    t1;             // first term for label
128        LPolyOld*  lp1;            // first labeled poly
129        poly    t2;             // second term for label
130        LPolyOld*  lp2;            // second labeled poly
131        RuleOld*   testedRuleOld;     // already tested by RuleOlds up to lastRuleOldTested
132        bool  del;
133    public:
134        inline          CPairOld(long degree, poly term1, LPolyOld* LPolyOld1, poly term2, LPolyOld* LPolyOld2, bool useless, RuleOld* r = NULL);
135        inline  long    getDeg();
136        inline  poly    getT1();
137        inline  poly*   getAdT1();
138        inline  LPolyOld*  getAdLp1();
139        inline  poly    getLp1Poly();
140        inline  poly    getLp1Term();
141        inline  int     getLp1Index();
142        inline  poly    getT2();
143        inline  poly*   getAdT2();
144        inline  LPolyOld*  getAdLp2();
145        inline  poly    getLp2Poly();
146        inline  poly    getLp2Term();
147        inline  int     getLp2Index();
148        inline  bool    getDel();
149        inline  RuleOld*   getTestedRuleOld();
150        inline  void    setTestedRuleOld(RuleOld* r);
151};
152
153CPairOld::CPairOld(long degree, poly term1, LPolyOld* LPolyOld1, poly term2, LPolyOld* LPolyOld2, bool useless, RuleOld* r) {
154   deg              =   degree;
155   t1               =   term1;
156   lp1              =   LPolyOld1;
157   t2               =   term2;
158   lp2              =   LPolyOld2;
159   testedRuleOld       =   r;
160   del              =   useless;
161}
162
163long CPairOld::getDeg() {
164    return deg;
165}
166
167poly CPairOld::getT1() {
168    return t1;
169}
170
171poly* CPairOld::getAdT1() {
172    return &t1;
173}
174
175poly* CPairOld::getAdT2() {
176    return &t2;
177}
178
179poly CPairOld::getT2() {
180    return t2;
181}
182
183LPolyOld* CPairOld::getAdLp1() {
184    return lp1;
185}
186
187LPolyOld* CPairOld::getAdLp2() {
188    return lp2;
189}
190
191poly CPairOld::getLp1Poly() {
192    return lp1->getPoly();
193}
194
195poly CPairOld::getLp2Poly() {
196    return lp2->getPoly();
197}
198
199poly CPairOld::getLp1Term() {
200    return lp1->getTerm();
201}
202
203poly CPairOld::getLp2Term() {
204    return lp2->getTerm();
205}
206
207int CPairOld::getLp1Index() {
208    return lp1->getIndex();
209}
210
211int CPairOld::getLp2Index() {
212    return lp2->getIndex();
213}
214
215bool CPairOld::getDel() {
216  return del;
217}
218
219RuleOld* CPairOld::getTestedRuleOld() {
220    return testedRuleOld;
221}
222
223void CPairOld::setTestedRuleOld(RuleOld* r) {
224    testedRuleOld      =   r;
225}
226
227
228/*!
229========================================================
230structure of RuleOlds(i.e. already computed / known labels)
231========================================================
232*/
233class RuleOld {
234    private:
235        int     index;      // index of the labeled polynomial the RuleOld comes from
236        poly    term;       // term of the labeled polynomial the RuleOld comes from
237    public:
238        inline          RuleOld(int i, poly term);
239        inline          ~RuleOld();
240        inline  int     getIndex();
241        inline  poly    getTerm();
242};
243
244RuleOld::RuleOld(int i, poly t) {
245    index   =   i;
246    term    =   t;
247}
248
249RuleOld::~RuleOld() {
250    //pDelete(&term);
251}
252
253int RuleOld::getIndex() {
254    return index;
255}
256
257poly RuleOld::getTerm() {
258    return term;
259}
260#endif
261#endif
Note: See TracBrowser for help on using the repository browser.