My Project
Public Member Functions | Private Attributes
LNode Class Reference

#include <f5lists.h>

Public Member Functions

 LNode ()
 
 LNode (LPolyOld *lp)
 
 LNode (LPolyOld *lp, LNode *l)
 
 LNode (poly t, int i, poly p, RuleOld *r=NULL)
 
 LNode (poly t, int i, poly p, RuleOld *r, LNode *l)
 
 LNode (LNode *ln)
 
 ~LNode ()
 
void deleteAll ()
 
LNode * insert (LPolyOld *lp)
 
LNode * insert (poly t, int i, poly p, RuleOld *r)
 
LNode * insertByDeg (LPolyOld *lp)
 
LNode * insertSP (LPolyOld *lp)
 
LNode * insertSP (poly t, int i, poly p, RuleOld *r)
 
LNode * insertByLabel (poly t, int i, poly p, RuleOld *r)
 
LNode * insertByLabel (LNode *l)
 
LNode * insertFirst (LNode *l)
 
LNode * getNext ()
 
LNode * getPrev ()
 
LNode * deleteByDeg ()
 
LPolyOld * getLPolyOld ()
 
poly getPoly ()
 
poly getTerm ()
 
int getIndex ()
 
RuleOld * getRuleOld ()
 
bool getDel ()
 
void setPoly (poly p)
 
void setTerm (poly t)
 
void setIndex (int i)
 
void setNext (LNode *l)
 
void setRuleOld (RuleOld *r)
 
void setDel (bool d)
 
bool polyTest (poly *p)
 
LNode * getNext (LNode *l)
 
void print ()
 
int count (LNode *l)
 

Private Attributes

LPolyOld * data
 
LNode * next
 

Detailed Description

Definition at line 65 of file f5lists.h.

Constructor & Destructor Documentation

◆ LNode() [1/6]

LNode::LNode ( )

Definition at line 129 of file f5lists.cc.

129  {
130  data = NULL;
131  next = NULL;
132 }
LNode * next
Definition: f5lists.h:68
LPolyOld * data
Definition: f5lists.h:67
#define NULL
Definition: omList.c:12

◆ LNode() [2/6]

LNode::LNode ( LPolyOld *  lp)

Definition at line 133 of file f5lists.cc.

133  {
134  data = lp;
135  next = NULL;
136 }

◆ LNode() [3/6]

LNode::LNode ( LPolyOld *  lp,
LNode *  l 
)

Definition at line 138 of file f5lists.cc.

138  {
139 //Print("HIER LNODE\n");
140  data = lp;
141  next = l;
142 }
int l
Definition: cfEzgcd.cc:100

◆ LNode() [4/6]

LNode::LNode ( poly  t,
int  i,
poly  p,
RuleOld *  r = NULL 
)

Definition at line 144 of file f5lists.cc.

144  {
145 LPolyOld* lp = new LPolyOld(t,i,p,r);
146 data = lp;
147 next = NULL;
148 }
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4078

◆ LNode() [5/6]

LNode::LNode ( poly  t,
int  i,
poly  p,
RuleOld *  r,
LNode *  l 
)

Definition at line 150 of file f5lists.cc.

150  {
151  LPolyOld* lp = new LPolyOld(t,i,p,r);
152  data = lp;
153  next = l;
154 }

◆ LNode() [6/6]

LNode::LNode ( LNode *  ln)

Definition at line 156 of file f5lists.cc.

156  {
157  data = ln->getLPolyOld();
158  next = ln->getNext();
159 }
LNode * getNext()
Definition: f5lists.cc:321
LPolyOld * getLPolyOld()
Definition: f5lists.cc:326

◆ ~LNode()

LNode::~LNode ( )

Definition at line 161 of file f5lists.cc.

161  {
162  //delete next;
163  //Print("DELETE LNODE\n");
164  delete data;
165 }

Member Function Documentation

◆ count()

int LNode::count ( LNode *  l)

Definition at line 408 of file f5lists.cc.

408  {
409  int nonDel = 0;
410  LNode* temp = l;
411  while(NULL != temp) {
412  if(!temp->getDel()) {
413  nonDel++;
414  temp = temp->next;
415  }
416  else {
417  temp = temp->next;
418  }
419  }
420  return nonDel;
421 }
Definition: f5lists.h:65
bool getDel()
Definition: f5lists.cc:351

◆ deleteAll()

void LNode::deleteAll ( )

Definition at line 167 of file f5lists.cc.

167  {
168  while(NULL != next) {
169  //Print("%p\n",next);
170  //pWrite(next->data->getPoly());
171  next->deleteAll();
172  }
173  delete data;
174 }
void deleteAll()
Definition: f5lists.cc:167

◆ deleteByDeg()

LNode * LNode::deleteByDeg ( )

Definition at line 316 of file f5lists.cc.

316  {
317  return this;
318 }

◆ getDel()

bool LNode::getDel ( )

Definition at line 351 of file f5lists.cc.

351  {
352  return data->getDel();
353 }
bool getDel()
Definition: f5data.h:102

◆ getIndex()

int LNode::getIndex ( )

Definition at line 339 of file f5lists.cc.

339  {
340  return data->getIndex();
341 }
int getIndex()
Definition: f5data.h:94

◆ getLPolyOld()

LPolyOld * LNode::getLPolyOld ( )

Definition at line 326 of file f5lists.cc.

326  {
327  return data;
328 }

◆ getNext() [1/2]

LNode * LNode::getNext ( )

Definition at line 321 of file f5lists.cc.

321  {
322  return next;
323 }

◆ getNext() [2/2]

LNode * LNode::getNext ( LNode *  l)

Definition at line 388 of file f5lists.cc.

388  {
389  return l->next;
390 }

◆ getPoly()

poly LNode::getPoly ( )

Definition at line 331 of file f5lists.cc.

331  {
332  return data->getPoly();
333 }
poly getPoly()
Definition: f5data.h:86

◆ getPrev()

LNode* LNode::getPrev ( )

◆ getRuleOld()

RuleOld * LNode::getRuleOld ( )

Definition at line 343 of file f5lists.cc.

343  {
344  return data->getRuleOld();
345 }
RuleOld * getRuleOld()
Definition: f5data.h:98

◆ getTerm()

poly LNode::getTerm ( )

Definition at line 335 of file f5lists.cc.

335  {
336  return data->getTerm();
337 }
poly getTerm()
Definition: f5data.h:90

◆ insert() [1/2]

LNode * LNode::insert ( LPolyOld *  lp)
inline

Definition at line 178 of file f5lists.cc.

178  {
179  //Print("LAST GPREV: ");
180  //pWrite(this->getPoly());
181  if(NULL == this) {
182  LNode* newElement = new LNode(lp,this);
183  return newElement;
184  }
185  else {
186  LNode* newElement = new LNode(lp, NULL);
187  this->next = newElement;
188  return newElement;
189  }
190 }
LNode()
Definition: f5lists.cc:129

◆ insert() [2/2]

LNode * LNode::insert ( poly  t,
int  i,
poly  p,
RuleOld *  r 
)
inline

Definition at line 192 of file f5lists.cc.

192  {
193  if(NULL == this) {
194  LNode* newElement = new LNode(t,i,p,r,this);
195  return newElement;
196  }
197  else {
198  LNode* newElement = new LNode(t, i, p, r, NULL);
199  this->next = newElement;
200  return newElement;
201  }
202 }

◆ insertByDeg()

LNode* LNode::insertByDeg ( LPolyOld *  lp)

◆ insertByLabel() [1/2]

LNode * LNode::insertByLabel ( LNode *  l)
inline

Definition at line 270 of file f5lists.cc.

270  {
271  //Print("ADDING SOLYS TO THE LIST\n");
272  //Print("new element: ");
273  //pWrite(t);
274  if(NULL == this) { // || NULL == data) {
275  l->next = this;
276  return l;
277  }
278  else {
279  //Print("tested element1: ");
280  //pWrite(this->getTerm());
281  if(-1 == pLmCmp(l->getTerm(),this->getTerm())) {
282  //Print("HIERDRIN\n");
283  l->next = this;
284  //Print("%p\n",this);
285  //Print("%p\n",newElement->next);
286  return l;
287  }
288  else {
289  LNode* temp = this;
290  while(NULL != temp->next && NULL != temp->next->data) {
291  //Print("tested element: ");
292  //pWrite(temp->getTerm());
293  if(-1 == pLmCmp(l->getTerm(),temp->next->getTerm())) {
294  l->next = temp->next;
295  temp->next = l;
296  return this;
297  }
298  else {
299  temp = temp->next;
300  //Print("%p\n",temp);
301  //Print("%p\n",temp->data);
302 
303  //Print("%p\n",temp->next);
304  }
305  }
306  //Print("HIER\n");
307  l->next = temp->next;
308  temp->next = l;
309  return this;
310  }
311  }
312 }
poly getTerm()
Definition: f5lists.cc:335
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105

◆ insertByLabel() [2/2]

LNode * LNode::insertByLabel ( poly  t,
int  i,
poly  p,
RuleOld *  r 
)
inline

Definition at line 221 of file f5lists.cc.

221  {
222  //Print("ADDING SOLYS TO THE LIST\n");
223  //Print("new element: ");
224  //pWrite(t);
225  if(NULL == this) { // || NULL == data) {
226  LNode* newElement = new LNode(t, i, p, r, this);
227  return newElement;
228  }
229  else {
230  //Print("tested element1: ");
231  //pWrite(this->getTerm());
232  if(-1 == pLmCmp(t,this->getTerm())) {
233  //Print("HIERDRIN\n");
234  LNode* newElement = new LNode(t, i, p, r, this);
235  //Print("%p\n",this);
236  //Print("%p\n",newElement->next);
237  return newElement;
238  }
239  else {
240  LNode* temp = this;
241  while(NULL != temp->next && NULL != temp->next->data) {
242  //Print("tested element: ");
243  //pWrite(temp->getTerm());
244  if(-1 == pLmCmp(t,temp->next->getTerm())) {
245  LNode* newElement = new LNode(t, i, p, r, temp->next);
246  temp->next = newElement;
247  return this;
248  }
249  else {
250  temp = temp->next;
251  //Print("%p\n",temp);
252  //Print("%p\n",temp->data);
253 
254  //Print("%p\n",temp->next);
255  }
256  }
257  //Print("HIER\n");
258  LNode* newElement = new LNode(t, i, p, r, temp->next);
259  temp->next = newElement;
260  return this;
261  }
262  }
263 }

◆ insertFirst()

LNode * LNode::insertFirst ( LNode *  l)
inline

Definition at line 265 of file f5lists.cc.

265  {
266  l->next = this;
267  return l;
268 }

◆ insertSP() [1/2]

LNode * LNode::insertSP ( LPolyOld *  lp)
inline

Definition at line 206 of file f5lists.cc.

206  {
207  LNode* newElement = new LNode(lp, this);
208  //Print("INSERTED IN SPOLYLIST: ");
209  //pWrite(lp->getTerm());
210  return newElement;
211 }

◆ insertSP() [2/2]

LNode * LNode::insertSP ( poly  t,
int  i,
poly  p,
RuleOld *  r 
)
inline

Definition at line 213 of file f5lists.cc.

213  {
214  LNode* newElement = new LNode(t, i, p, r, this);
215  //Print("INSERTED IN SPOLYLIST: ");
216  //pWrite(t);
217 return newElement;
218 }

◆ polyTest()

bool LNode::polyTest ( poly *  p)

Definition at line 377 of file f5lists.cc.

377  {
378  LNode* temp = new LNode(this);
379  while(NULL != temp) {
380  if(pComparePolys(temp->getPoly(),*p)) {
381  return 1;
382  }
383  temp = temp->next;
384  }
385  return 0;
386 }
poly getPoly()
Definition: f5lists.cc:331

◆ print()

void LNode::print ( )

Definition at line 393 of file f5lists.cc.

394 {
395  LNode* temp = this;
396  PrintS("___________________List of S-polynomials______________________:\n");
397  while(NULL != temp && NULL != temp->data) {
398  Print("Index: %d\n",temp->getIndex());
399  PrintS("Term: ");
400  pWrite(temp->getTerm());
401  PrintS("Poly: ");
402  pWrite(temp->getPoly());
403  temp = temp->next;
404  }
405  PrintS("_______________________________________________________________\n");
406 }
int getIndex()
Definition: f5lists.cc:339
#define Print
Definition: emacs.cc:80
void pWrite(poly p)
Definition: polys.h:308
void PrintS(const char *s)
Definition: reporter.cc:284

◆ setDel()

void LNode::setDel ( bool  d)

Definition at line 372 of file f5lists.cc.

372  {
373  data->setDel(d);
374 }
void setDel(bool d)
Definition: f5data.h:82

◆ setIndex()

void LNode::setIndex ( int  i)

Definition at line 364 of file f5lists.cc.

364  {
365  data->setIndex(i);
366 }
void setIndex(int i)
Definition: f5data.h:74

◆ setNext()

void LNode::setNext ( LNode *  l)

Definition at line 368 of file f5lists.cc.

368  {
369  next = l;
370 }

◆ setPoly()

void LNode::setPoly ( poly  p)

Definition at line 356 of file f5lists.cc.

356  {
357  data->setPoly(p);
358 }
void setPoly(poly p)
Definition: f5data.h:62

◆ setRuleOld()

void LNode::setRuleOld ( RuleOld *  r)

Definition at line 347 of file f5lists.cc.

347  {
348  return data->setRuleOld(r);
349 }
void setRuleOld(RuleOld *r)
Definition: f5data.h:78

◆ setTerm()

void LNode::setTerm ( poly  t)

Definition at line 360 of file f5lists.cc.

360  {
361  data->setTerm(t);
362 }
void setTerm(poly t)
Definition: f5data.h:68

Field Documentation

◆ data

LPolyOld* LNode::data
private

Definition at line 67 of file f5lists.h.

◆ next

LNode* LNode::next
private

Definition at line 68 of file f5lists.h.


The documentation for this class was generated from the following files: