My Project  UNKNOWN_GIT_VERSION
Public Member Functions | Private Attributes
PNode Class Reference

class PNode of nodes of polynomials More...

#include <f5lists.h>

Public Member Functions

 PNode (poly p, PNode *n)
 functions working on the class PNode More...
 
poly getPoly ()
 
PNodegetNext ()
 
PNodeinsert (poly p)
 

Private Attributes

poly data
 
PNodenext
 

Detailed Description

class PNode of nodes of polynomials

Definition at line 36 of file f5lists.h.

Constructor & Destructor Documentation

◆ PNode()

PNode::PNode ( poly  p,
PNode n 
)

functions working on the class PNode

Definition at line 26 of file f5lists.cc.

26  {
27  data = p;
28  next = n;
29 }

Member Function Documentation

◆ getNext()

PNode * PNode::getNext ( )

Definition at line 35 of file f5lists.cc.

35  {
36  return this->next;
37 }

◆ getPoly()

poly PNode::getPoly ( )

Definition at line 31 of file f5lists.cc.

31  {
32  return this->data;
33 }

◆ insert()

PNode * PNode::insert ( poly  p)

Definition at line 38 of file f5lists.cc.

38  {
39  poly q = pOne();
40  q = pCopy(p);
41  PNode* temp = this;
42  if(NULL == temp) {
43  PNode* pn = new PNode(q,temp);
44  return pn;
45  }
46  if(1 == pLmCmp(q,temp->getPoly())) {
47  PNode* pn = new PNode(q,temp);
48  return pn;
49  }
50  if(0 == pLmCmp(q,temp->getPoly())) {
51  return this;
52  }
53  if(-1 == pLmCmp(q,temp->getPoly())) {
54  while(NULL != temp->getNext() && -1 == pLmCmp(q,temp->getNext()->getPoly())) {
55  temp = temp->getNext();
56  }
57  if(NULL == temp->getNext() || 1 == pLmCmp(q,temp->getNext()->getPoly())) {
58  PNode* pn = new PNode(q,temp->getNext());
59  temp->next = pn;
60  return this;
61  }
62  if(0 == pLmCmp(q,temp->getNext()->getPoly())) {
63  return this;
64  }
65  }
66 }

Field Documentation

◆ data

poly PNode::data
private

Definition at line 38 of file f5lists.h.

◆ next

PNode* PNode::next
private

Definition at line 39 of file f5lists.h.


The documentation for this class was generated from the following files:
PNode::PNode
PNode(poly p, PNode *n)
functions working on the class PNode
Definition: f5lists.cc:26
PNode::data
poly data
Definition: f5lists.h:38
pOne
#define pOne()
Definition: polys.h:309
PNode::next
PNode * next
Definition: f5lists.h:39
PNode
class PNode of nodes of polynomials
Definition: f5lists.h:36
PNode::getNext
PNode * getNext()
Definition: f5lists.cc:35
NULL
#define NULL
Definition: omList.c:10
p
int p
Definition: cfModGcd.cc:4019
pLmCmp
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
pCopy
#define pCopy(p)
return a copy of the poly
Definition: polys.h:180
PNode::getPoly
poly getPoly()
Definition: f5lists.cc:31