source: git/kernel/f5data.h @ 9cb4078

spielwiese
Last change on this file since 9cb4078 was 9cb4078, checked in by Christian Eder, 15 years ago
implemented interreduction, still with lots of bugs => commented out git-svn-id: file:///usr/local/Singular/svn/trunk@11514 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.0 KB
Line 
1//! \file f5data.cc
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5/* $Id: f5data.h,v 1.8 2009-03-04 20:23:05 ederc Exp $ */
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 LPoly;
20class CPair;
21class Rule;
22
23
24/*!
25============================
26class of labeled polynomials
27============================
28*/
29class LPoly {
30    private:
31        poly    term;           //term of signature
32        int     index;          //index of signature
33        poly    polynomial;     //standard polynomial data
34        Rule*   _rule;
35    public:
36        inline          LPoly(poly t, int i, poly p, Rule* r=NULL);
37        inline  void    setPoly(poly p);
38        inline  poly    getPoly();
39        inline  void    setTerm(poly t);
40        inline  poly    getTerm();
41        inline  void    setIndex(int i);
42        inline  int     getIndex();
43        inline  void    setRule(Rule* r);
44        inline  Rule*   getRule();
45        inline  void    set(poly t, int i, poly p, Rule* r);
46        inline  LPoly*  get();
47};
48
49LPoly::LPoly(poly t,int i,poly p, Rule* r) {
50    set(t,i,p,r);
51}
52
53void LPoly::setPoly(poly p)  {
54    //poly _p     =   pInit();
55    //_p          =   pCopy(p);
56    polynomial = p;
57}
58
59void LPoly::setTerm(poly t) {
60    //poly _t     =   pInit();
61    //_t          =   pCopy(t);
62    term = t;
63}
64
65void LPoly::setIndex(int i) {
66    index = i;
67}
68
69void LPoly::setRule(Rule* r) {
70    _rule   =   r;
71}
72
73poly LPoly::getPoly() {
74    return polynomial;
75}
76
77poly LPoly::getTerm() {
78    return term;
79}
80
81int LPoly::getIndex() {
82    return index;
83}
84
85Rule* LPoly::getRule() {
86    return _rule;
87}
88
89void LPoly::set(poly t, int i, poly p, Rule* r) {
90    this->setTerm(t);
91    this->setIndex(i);
92    this->setPoly(p);
93    this->setRule(r);
94}
95
96LPoly* LPoly::get() {
97    return this;
98}
99
100
101/*!
102===================================
103structure of labeled critical pairs
104===================================
105*/
106class CPair {
107    private:
108        long    deg;            // total degree of the critical pair
109        poly    t1;             // first term for label
110        LPoly*  lp1;            // first labeled poly
111        poly    t2;             // second term for label
112        LPoly*  lp2;            // second labeled poly
113        Rule*   testedRule;     // already tested by rules up to lastRuleTested
114    public:
115        inline          CPair(long degree, poly term1, LPoly* lpoly1, poly term2, LPoly* lpoly2, Rule* r = NULL);
116        inline  long    getDeg();
117        inline  poly    getT1();
118        inline  poly*   getAdT1();
119        inline  LPoly*  getAdLp1();
120        inline  poly    getLp1Poly();
121        inline  poly    getLp1Term();
122        inline  int     getLp1Index();
123        inline  poly    getT2();
124        inline  poly*   getAdT2();
125        inline  LPoly*  getAdLp2();
126        inline  poly    getLp2Poly();
127        inline  poly    getLp2Term();
128        inline  int     getLp2Index();
129        inline  Rule*   getTestedRule();
130        inline  void    setTestedRule(Rule* r);
131};
132
133CPair::CPair(long degree, poly term1, LPoly* lpoly1, poly term2, LPoly* lpoly2, Rule* r) {
134   deg              =   degree;
135   t1               =   term1;
136   lp1              =   lpoly1;
137   t2               =   term2;
138   lp2              =   lpoly2;
139   testedRule       =   r;
140}
141
142long CPair::getDeg() {
143    return deg;
144}
145
146poly CPair::getT1() {
147    return t1;
148}
149
150poly* CPair::getAdT1() {
151    return &t1;
152}
153
154poly* CPair::getAdT2() {
155    return &t2;
156}
157
158poly CPair::getT2() {
159    return t2;
160}
161
162LPoly* CPair::getAdLp1() {
163    return lp1;
164}
165
166LPoly* CPair::getAdLp2() {
167    return lp2;
168}
169
170poly CPair::getLp1Poly() {
171    return lp1->getPoly();
172}
173
174poly CPair::getLp2Poly() {
175    return lp2->getPoly();
176}
177
178poly CPair::getLp1Term() {
179    return lp1->getTerm();
180}
181
182poly CPair::getLp2Term() {
183    return lp2->getTerm();
184}
185
186int CPair::getLp1Index() {
187    return lp1->getIndex();
188}
189
190int CPair::getLp2Index() {
191    return lp2->getIndex();
192}
193
194Rule* CPair::getTestedRule() {
195    return testedRule;
196}
197
198void CPair::setTestedRule(Rule* r) {
199    testedRule      =   r;
200}
201
202
203/*!
204========================================================
205structure of rules(i.e. already computed / known labels)
206========================================================
207*/
208class Rule {
209    private:
210        int     index;      // index of the labeled polynomial the rule comes from
211        poly    term;       // term of the labeled polynomial the rule comes from
212    public:
213        inline          Rule(int i, poly term);
214        inline  int     getIndex();
215        inline  poly    getTerm();
216};
217
218Rule::Rule(int i, poly t) {
219    index   =   i;
220    term    =   t;
221}
222
223int Rule::getIndex() {
224    return index;
225}
226
227poly Rule::getTerm() {
228    return term;
229}
230#endif
231#endif
Note: See TracBrowser for help on using the repository browser.