source: git/kernel/lists.h @ cce6ed3

spielwiese
Last change on this file since cce6ed3 was cce6ed3, checked in by Christian Eder, 15 years ago
lists done, started implementing f5incremental and critpair subalgorithms git-svn-id: file:///usr/local/Singular/svn/trunk@11330 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.5 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/* $Id: lists.h,v 1.4 2009-01-25 17:13:06 ederc Exp $ */
5/*
6* ABSTRACT: list interface
7*/
8#include "lpolynomial.h"
9#ifndef LISTS_HEADER
10#define LISTS_HEADER
11
12#ifdef HAVE_F5
13/*
14============================
15============================
16classes for lists used in F5
17============================
18============================
19*/
20class LNode;
21class LList;
22class PrevNode;
23class PrevList;
24class CNode;
25class CList;
26class RList;
27class RNode;
28
29/*
30=======================================
31LNode class (nodes for lists of LPolys)
32=======================================
33*/
34class LNode {
35    private:
36        LPoly* data;
37        LNode* next;
38    public:
39        // generating new list elements from the labeled / classical polynomial view
40                LNode(LPoly* lp);
41                LNode(poly* t, int* i, poly* p);
42                LNode(LNode* ln);
43                ~LNode();
44        // insert new elements to the list in first place from the labeled / classical polynomial view
45        LNode*  insert(LPoly* lp);
46        LNode*  insert(poly* t, int* i, poly* p);
47        // insert new elements to the list with resp. to increasing labels
48        // only used for the S-polys to be reduced (TopReduction building new S-polys with higher label)
49        LNode*  insertByLabel(LPoly* lp);
50        // deletes the first elements of the list with the same degree
51        // get next from current LNode
52        LNode*  getNext();
53        // only used for the S-polys, which are already sorted by increasing degree by CList
54        LNode*  deleteByDeg();
55        // get the LPoly* out of LNode*
56        LPoly*  getLPoly();
57        // get the data from the LPoly saved in LNode
58        poly*   getPoly();
59        poly*   getTerm();
60        int*    getIndex();
61        // test if for any list element the polynomial part of the data is equal to *p
62        bool    polyTest(poly* p);
63        LNode*  getNext(LNode* l);
64};
65
66
67/*
68============================
69class LList(lists of LPolys)
70============================
71*/
72class LList {
73    private:
74        LNode*  first;
75    public:
76                LList(LPoly* lp);
77                LList(poly* t,int* i,poly* p);
78                ~LList();
79        void    insert(LPoly* lp);
80        // insertion in front of the list
81        void    insert(poly* t,int* i, poly* p);
82        void    insertByLabel(LPoly* lp);
83        void    deleteByDeg();
84        bool    polyTest(poly* p);
85        LNode*  getFirst(); 
86        LNode*  getNext(LNode* l);
87};
88
89
90/*
91=============================================
92PrevNode class (nodes for lists of gPrevLast)
93=============================================
94*/
95class PrevNode {
96    private:
97        LNode*      data;
98        PrevNode*   next;
99    public:
100        PrevNode(LNode* l);
101        ~PrevNode();
102        PrevNode*   append(LNode* l);
103        LNode*      getLNode();
104        LNode*      getPrevLast(int i);
105};
106
107
108/*
109====================================================
110class PrevList(lists of last node elements in gPrev)
111====================================================
112*/
113class PrevList {
114    private:
115        PrevNode*   first;
116        PrevNode*   last;
117    public:
118                PrevList(LNode* l);
119                ~PrevList();
120        void    append(LNode* l);
121        LNode*  getPrevLast(int i);
122};
123
124
125/*
126=======================================
127class CNode (nodes for lists of CPairs)
128=======================================
129*/
130class CNode {
131    private:
132        CPair* data;
133        CNode* next;
134    public:
135                CNode(CPair* c);
136                ~CNode(); 
137        CNode*  insert(CPair* c); 
138        CNode*  getMinDeg();
139        //CNode*  getLPoly() const;
140};
141
142
143/*
144============================
145class CList(lists of CPairs)
146============================
147*/
148class CList {
149    private:
150        CNode*  first;
151    public:
152                CList(CPair* c); 
153                ~CList(); 
154        void    insert(CPair* c);
155        CNode*  getMinDeg();
156
157};
158
159
160/*
161======================================
162class RNode (nodes for lists of Rules)
163======================================
164*/
165class RNode {
166    private:
167        Rule*   data;
168        RNode*  next;
169    public:
170                RNode(Rule* r);
171                ~RNode();
172        RNode*  insert(Rule* r);
173};
174
175/*
176============================
177class RList (lists of Rules)
178============================
179*/
180class RList {
181    private:
182        RNode*  first;
183    public:
184                RList(Rule* r);
185                ~RList();
186        void    insert(Rule* r);
187};
188#endif
189#endif
Note: See TracBrowser for help on using the repository browser.