My Project  debian-1:4.1.1-p2+ds-4build3
Public Member Functions | Private Attributes
CNode Class Reference

#include <f5lists.h>

Public Member Functions

 CNode ()
 
 CNode (CPairOld *c)
 
 CNode (CPairOld *c, CNode *n)
 
 ~CNode ()
 
CNodeinsert (CPairOld *c)
 
CNodeinsertWithoutSort (CPairOld *cp)
 
CNodegetMinDeg ()
 
CPairOldgetData ()
 
CNodegetNext ()
 
LPolyOldgetAdLp1 ()
 
LPolyOldgetAdLp2 ()
 
poly getLp1Poly ()
 
poly getLp2Poly ()
 
poly getLp1Term ()
 
poly getLp2Term ()
 
poly getT1 ()
 
poly * getAdT1 ()
 
poly getT2 ()
 
poly * getAdT2 ()
 
int getLp1Index ()
 
int getLp2Index ()
 
bool getDel ()
 
RuleOldgetTestedRuleOld ()
 
void print ()
 

Private Attributes

CPairOlddata
 
CNodenext
 

Detailed Description

Definition at line 232 of file f5lists.h.

Constructor & Destructor Documentation

◆ CNode() [1/3]

CNode::CNode ( )

Definition at line 680 of file f5lists.cc.

680  {
681  data = NULL;
682  next = NULL;
683 }

◆ CNode() [2/3]

CNode::CNode ( CPairOld c)

Definition at line 685 of file f5lists.cc.

685  {
686  data = c;
687  next = NULL;
688 }

◆ CNode() [3/3]

CNode::CNode ( CPairOld c,
CNode n 
)

Definition at line 690 of file f5lists.cc.

690  {
691  data = c;
692  next = n;
693 }

◆ ~CNode()

CNode::~CNode ( )

Definition at line 695 of file f5lists.cc.

695  {
696  delete data;
697 }

Member Function Documentation

◆ getAdLp1()

LPolyOld * CNode::getAdLp1 ( )

Definition at line 829 of file f5lists.cc.

829  {
830  return this->data->getAdLp1();
831 }

◆ getAdLp2()

LPolyOld * CNode::getAdLp2 ( )

Definition at line 833 of file f5lists.cc.

833  {
834  return this->data->getAdLp2();
835 }

◆ getAdT1()

poly * CNode::getAdT1 ( )

Definition at line 865 of file f5lists.cc.

865  {
866  return this->data->getAdT1();
867 }

◆ getAdT2()

poly * CNode::getAdT2 ( )

Definition at line 873 of file f5lists.cc.

873  {
874  return this->data->getAdT2();
875 }

◆ getData()

CPairOld * CNode::getData ( )

Definition at line 821 of file f5lists.cc.

821  {
822  return data;
823 }

◆ getDel()

bool CNode::getDel ( )

Definition at line 877 of file f5lists.cc.

877  {
878  return data->getDel();
879 }

◆ getLp1Index()

int CNode::getLp1Index ( )

Definition at line 853 of file f5lists.cc.

853  {
854  return this->data->getLp1Index();
855 }

◆ getLp1Poly()

poly CNode::getLp1Poly ( )

Definition at line 837 of file f5lists.cc.

837  {
838  return this->data->getLp1Poly();
839 }

◆ getLp1Term()

poly CNode::getLp1Term ( )

Definition at line 845 of file f5lists.cc.

845  {
846  return this->data->getLp1Term();
847 }

◆ getLp2Index()

int CNode::getLp2Index ( )

Definition at line 857 of file f5lists.cc.

857  {
858  return this->data->getLp2Index();
859 }

◆ getLp2Poly()

poly CNode::getLp2Poly ( )

Definition at line 841 of file f5lists.cc.

841  {
842  return this->data->getLp2Poly();
843 }

◆ getLp2Term()

poly CNode::getLp2Term ( )

Definition at line 849 of file f5lists.cc.

849  {
850  return this->data->getLp2Term();
851 }

◆ getMinDeg()

CNode * CNode::getMinDeg ( )

Definition at line 806 of file f5lists.cc.

806  {
807  CNode* temp = this;
808  while(NULL != temp) {
809  while(NULL != temp->next && temp->next->data->getDeg() == this->data->getDeg()) {
810  temp = temp->next;
811  }
812  CNode* returnCNode = temp->next;
813  // every CListOld should end with a (NULL,NULL) element for a similar behaviour
814  // using termination conditions throughout the algorithm
815  temp->next = NULL;
816  return returnCNode;
817  }
818  return NULL;
819 }

◆ getNext()

CNode * CNode::getNext ( )

Definition at line 825 of file f5lists.cc.

825  {
826  return next;
827 }

◆ getT1()

poly CNode::getT1 ( )

Definition at line 861 of file f5lists.cc.

861  {
862  return this->data->getT1();
863 }

◆ getT2()

poly CNode::getT2 ( )

Definition at line 869 of file f5lists.cc.

869  {
870  return this->data->getT2();
871 }

◆ getTestedRuleOld()

RuleOld * CNode::getTestedRuleOld ( )

Definition at line 881 of file f5lists.cc.

881  {
882  return this->data->getTestedRuleOld();
883 }

◆ insert()

CNode * CNode::insert ( CPairOld c)

Definition at line 703 of file f5lists.cc.

703  {
704  if(NULL == this) {
705  CNode* newElement = new CNode(c, this);
706  return newElement;
707  }
708  else {
709  poly u1 = ppMult_qq(c->getT1(),c->getLp1Term());
710  if( c->getDeg() < this->data->getDeg() ) { // lower degree than the first list element
711  CNode* newElement = new CNode(c, this);
712  return newElement;
713  }
714  if( c->getDeg() == this->data->getDeg() ) { // same degree than the first list element
715  if(1 != pLmCmp(u1,ppMult_qq(this->data->getT1(), this->data->getLp1Term()))) {
716  //pWrite(u1);
717  //Print("Multi-Term in CritPairs Sortierung altes Element: ");
718  //pWrite(ppMult_qq(this->data->getT1(),this->data->getLp1Term()));
719  CNode* newElement = new CNode(c, this);
720  return newElement;
721  }
722  else {
723  //Print("Insert Deg\n");
724  CNode* temp = this;
725  while( NULL != temp->next) {
726  if(temp->next->data->getDeg() == c->getDeg() ) {
727  if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) {
728  temp = temp->next;
729  }
730  else {
731  CNode* newElement = new CNode(c, temp->next);
732  temp->next = newElement;
733  return this;
734  }
735  }
736  else {
737  CNode* newElement = new CNode(c, temp->next);
738  temp->next = newElement;
739  return this;
740  }
741  }
742  CNode* newElement = new CNode(c, NULL);
743  temp->next = newElement;
744  return this;
745  }
746  } // outer if-clause
747  if( c->getDeg() > this->data->getDeg() ) { // greater degree than the first list element
748  CNode* temp = this;
749  while( NULL != temp->next ) {
750  if( c->getDeg() < temp->next->data->getDeg() ) {
751  CNode* newElement = new CNode(c, temp->next);
752  temp->next = newElement;
753  return this;
754  }
755  if( c->getDeg() == temp->next->data->getDeg() ) {
756  if(1 != pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) {
757  CNode* newElement = new CNode(c, temp->next);
758  temp->next = newElement;
759  return this;
760  }
761  else {
762  temp = temp->next;
763  while( NULL != temp->next ) {
764  if( temp->next->data->getDeg() == c->getDeg() ) {
765  if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),
766  temp->next->data->getLp1Term()))) {
767  temp = temp->next;
768  }
769  else {
770  CNode* newElement = new CNode(c, temp->next);
771  temp->next = newElement;
772  return this;
773  }
774  }
775  else {
776  CNode* newElement = new CNode(c, temp->next);
777  temp->next = newElement;
778  return this;
779  }
780  }
781  CNode* newElement = new CNode(c, NULL);
782  temp->next = newElement;
783  return this;
784  }
785  }
786  if( c->getDeg() > temp->next->data->getDeg() ) {
787  temp = temp->next;
788  }
789  }
790  CNode* newElement = new CNode(c, NULL);
791  temp->next = newElement;
792  return this;
793  }
794  }
795 }

◆ insertWithoutSort()

CNode * CNode::insertWithoutSort ( CPairOld cp)

Definition at line 798 of file f5lists.cc.

798  {
799  CNode* newElement = new CNode(cp);
800  newElement->next = this;
801  return newElement;
802 }

◆ print()

void CNode::print ( )

Definition at line 886 of file f5lists.cc.

887 {
888  CNode* temp = this;
889  PrintS("___________________List of critical pairs______________________:\n");
890  while(NULL != temp)
891  {
892  pWrite(ppMult_qq(temp->getT1(),temp->getLp1Term()));
893  Print("LP1 Index: %d\n",temp->getLp1Index());
894  PrintS("T1: ");
895  pWrite(temp->getT1());
896  Print("%p\n",temp->getT1());
897  PrintS("LP1 Term: ");
898  pWrite(temp->getLp1Term());
899  PrintS("LP1 Poly: ");
900  pWrite(temp->getLp1Poly());
901  Print("LP2 Index: %d\n",temp->getLp2Index());
902  PrintS("T2: ");
903  pWrite(temp->getT2());
904  Print("%p\n",temp->getT2());
905  PrintS("LP2 Term: ");
906  pWrite(temp->getLp2Term());
907  PrintS("LP2 Poly: ");
908  pWrite(temp->getLp2Poly());
909  PrintLn();
910  temp = temp->next;
911  }
912 }

Field Documentation

◆ data

CPairOld* CNode::data
private

Definition at line 234 of file f5lists.h.

◆ next

CNode* CNode::next
private

Definition at line 235 of file f5lists.h.


The documentation for this class was generated from the following files:
CPairOld::getLp1Term
poly getLp1Term()
Definition: f5data.h:198
CNode::getLp2Term
poly getLp2Term()
Definition: f5lists.cc:849
CPairOld::getLp2Index
int getLp2Index()
Definition: f5data.h:210
CPairOld::getT1
poly getT1()
Definition: f5data.h:166
CPairOld::getLp2Poly
poly getLp2Poly()
Definition: f5data.h:194
CPairOld::getTestedRuleOld
RuleOld * getTestedRuleOld()
Definition: f5data.h:218
CPairOld::getAdLp2
LPolyOld * getAdLp2()
Definition: f5data.h:186
CNode::CNode
CNode()
Definition: f5lists.cc:680
CPairOld::getAdT1
poly * getAdT1()
Definition: f5data.h:170
CNode::getT1
poly getT1()
Definition: f5lists.cc:861
ppMult_qq
#define ppMult_qq(p, q)
Definition: polys.h:195
CNode::getLp2Poly
poly getLp2Poly()
Definition: f5lists.cc:841
CNode::getLp1Index
int getLp1Index()
Definition: f5lists.cc:853
PrintS
void PrintS(const char *s)
Definition: reporter.cc:284
CNode::getLp1Poly
poly getLp1Poly()
Definition: f5lists.cc:837
CNode::getLp1Term
poly getLp1Term()
Definition: f5lists.cc:845
CPairOld::getLp1Index
int getLp1Index()
Definition: f5data.h:206
CPairOld::getAdT2
poly * getAdT2()
Definition: f5data.h:174
CNode::data
CPairOld * data
Definition: f5lists.h:234
CNode::getLp2Index
int getLp2Index()
Definition: f5lists.cc:857
Print
#define Print
Definition: emacs.cc:80
CPairOld::getAdLp1
LPolyOld * getAdLp1()
Definition: f5data.h:182
CPairOld::getLp2Term
poly getLp2Term()
Definition: f5data.h:202
NULL
#define NULL
Definition: omList.c:10
CNode::next
CNode * next
Definition: f5lists.h:235
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
CPairOld::getDel
bool getDel()
Definition: f5data.h:214
PrintLn
void PrintLn()
Definition: reporter.cc:310
CNode::getT2
poly getT2()
Definition: f5lists.cc:869
CPairOld::getDeg
long getDeg()
Definition: f5data.h:162
CNode
Definition: f5lists.h:232
CPairOld::getT2
poly getT2()
Definition: f5data.h:178
pWrite
void pWrite(poly p)
Definition: polys.h:294
CPairOld::getLp1Poly
poly getLp1Poly()
Definition: f5data.h:190