Changeset 66e7b5 in git for kernel/f5lists.h
- Timestamp:
- Jan 29, 2009, 6:59:30 PM (15 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 5d0556d9643aab314fbe86e3ef4cbcd69d864661
- Parents:
- 5376a6afb7e0e9c5e8ba37a9e7964552e94edc3b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5lists.h
r5376a6 r66e7b5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5lists.h,v 1. 1 2009-01-27 10:38:08 SingularExp $ */4 /* $Id: f5lists.h,v 1.2 2009-01-29 17:59:30 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: list interface … … 20 20 class LNode; 21 21 class LList; 22 class PrevNode;23 class PrevList;22 class LTagNode; 23 class LTagList; 24 24 class CNode; 25 25 class CList; 26 26 class RList; 27 27 class RNode; 28 29 /* 30 ======================================= 31 LNode class (nodes for lists of LPolys) 28 class RTagNode; 29 class RTagList; 30 31 32 /* 33 ======================================= 34 class LNode (nodes for lists of LPolys) 32 35 ======================================= 33 36 */ … … 39 42 // generating new list elements from the labeled / classical polynomial view 40 43 LNode(LPoly* lp); 44 LNode(LPoly* lp, LNode* l); 41 45 LNode(poly* t, int* i, poly* p); 46 LNode(poly* t, int* i, poly* p, LNode* l); 42 47 LNode(LNode* ln); 43 48 ~LNode(); … … 56 61 LPoly* getLPoly(); 57 62 // get the data from the LPoly saved in LNode 58 poly *getPoly();59 poly *getTerm();60 int *getIndex();63 poly getPoly(); 64 poly getTerm(); 65 int getIndex(); 61 66 // test if for any list element the polynomial part of the data is equal to *p 62 67 bool polyTest(poly* p); … … 89 94 90 95 /* 91 ============================================= 92 PrevNode class (nodes for lists of gPrevLast)93 ============================================= 94 */ 95 class PrevNode {96 ============================================== 97 class LtagNode (nodes for lists of LPoly tags) 98 ============================================== 99 */ 100 class LTagNode { 96 101 private: 97 102 LNode* data; 98 PrevNode* next; 99 public: 100 PrevNode(LNode* l); 101 ~PrevNode(); 102 PrevNode* append(LNode* l); 103 LTagNode* next; 104 public: 105 LTagNode(LNode* l); 106 LTagNode(LNode* l, LTagNode* n); 107 ~LTagNode(); 108 // declaration with first as parameter due to sorting of LTagList 109 LTagNode* insert(LNode* l); 103 110 LNode* getLNode(); 104 LNode* getPrevLast(int i); 105 }; 106 107 108 /* 109 ==================================================== 110 class PrevList(lists of last node elements in gPrev) 111 ==================================================== 112 */ 113 class 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); 111 LNode* get(int i, int length); 112 }; 113 114 115 /* 116 ========================================================================= 117 class LTagList(lists of LPoly tags, i.e. first elements of a given index) 118 ========================================================================= 119 */ 120 class LTagList { 121 private: 122 LTagNode* first; 123 int length; 124 public: 125 LTagList(LNode* l); 126 ~LTagList(); 127 // declaration with first as parameter in LTagNode due to sorting of LTagList 128 void insert(LNode* l); 129 LNode* get(int idx); 122 130 }; 123 131 … … 133 141 CNode* next; 134 142 public: 143 CNode(); 135 144 CNode(CPair* c); 145 CNode(CPair* c, CNode* n); 136 146 ~CNode(); 137 CNode* insert(CPair* c );147 CNode* insert(CPair* c, CNode* last); 138 148 CNode* getMinDeg(); 139 //CNode* getLPoly() const; 149 poly getLp1Poly(); 150 poly getLp2Poly(); 151 poly getLp1Term(); 152 poly getLp2Term(); 153 poly getT1(); 154 poly getT2(); 155 int getLp1Index(); 156 int getLp2Index(); 157 void print(); 140 158 }; 141 159 … … 149 167 private: 150 168 CNode* first; 151 public: 169 // last alway has data=NULL and next=NULL, for initialization purposes used 170 CNode* last; 171 public: 172 // for initialization of CLists, last element alwas has data=NULL and next=NULL 173 CList(); 152 174 CList(CPair* c); 153 175 ~CList(); 154 176 void insert(CPair* c); 155 177 CNode* getMinDeg(); 156 178 void print(); 157 179 }; 158 180 … … 168 190 RNode* next; 169 191 public: 192 RNode(); 170 193 RNode(Rule* r); 171 194 ~RNode(); 172 195 RNode* insert(Rule* r); 196 RNode* getNext(); 197 Rule* getRule(); 198 int getRuleIndex(); 199 poly getRuleTerm(); 173 200 }; 174 201 … … 181 208 private: 182 209 RNode* first; 183 public: 210 // last alway has data=NULL and next=NULL, for initialization purposes used 211 RNode* last; 212 public: 213 RList(); 184 214 RList(Rule* r); 185 215 ~RList(); 186 216 void insert(Rule* r); 217 RNode* getFirst(); 218 Rule* getRule(); 219 }; 220 221 222 223 /* 224 ============================================= 225 class RtagNode (nodes for lists of Rule tags) 226 ============================================= 227 */ 228 class RTagNode { 229 private: 230 RNode* data; 231 RTagNode* next; 232 public: 233 RTagNode(RNode* r); 234 RTagNode(RNode* r, RTagNode* n); 235 ~RTagNode(); 236 // declaration with first as parameter due to sorting of LTagList 237 RTagNode* insert(RNode* r); 238 RNode* getRNode(); 239 RNode* get(int idx, int length); 240 }; 241 242 243 /* 244 ======================================================================== 245 class RTagList(lists of Rule tags, i.e. first elements of a given index) 246 ======================================================================== 247 */ 248 class RTagList { 249 private: 250 RTagNode* first; 251 int length; 252 public: 253 RTagList(RNode* r); 254 ~RTagList(); 255 // declaration with first as parameter in LTagNode due to sorting of LTagList 256 void insert(RNode* r); 257 RNode* get(int idx); 187 258 }; 188 259 #endif
Note: See TracChangeset
for help on using the changeset viewer.