My Project
Loading...
Searching...
No Matches
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 679 of file f5lists.cc.

679 {
680 data = NULL;
681 next = NULL;
682}
CPairOld * data
Definition: f5lists.h:234
CNode * next
Definition: f5lists.h:235
#define NULL
Definition: omList.c:12

◆ CNode() [2/3]

CNode::CNode ( CPairOld c)

Definition at line 684 of file f5lists.cc.

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

◆ CNode() [3/3]

CNode::CNode ( CPairOld c,
CNode n 
)

Definition at line 689 of file f5lists.cc.

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

◆ ~CNode()

CNode::~CNode ( )

Definition at line 694 of file f5lists.cc.

694 {
695 delete data;
696}

Member Function Documentation

◆ getAdLp1()

LPolyOld * CNode::getAdLp1 ( )

Definition at line 828 of file f5lists.cc.

828 {
829 return this->data->getAdLp1();
830}
LPolyOld * getAdLp1()
Definition: f5data.h:182

◆ getAdLp2()

LPolyOld * CNode::getAdLp2 ( )

Definition at line 832 of file f5lists.cc.

832 {
833 return this->data->getAdLp2();
834}
LPolyOld * getAdLp2()
Definition: f5data.h:186

◆ getAdT1()

poly * CNode::getAdT1 ( )

Definition at line 864 of file f5lists.cc.

864 {
865 return this->data->getAdT1();
866}
poly * getAdT1()
Definition: f5data.h:170

◆ getAdT2()

poly * CNode::getAdT2 ( )

Definition at line 872 of file f5lists.cc.

872 {
873 return this->data->getAdT2();
874}
poly * getAdT2()
Definition: f5data.h:174

◆ getData()

CPairOld * CNode::getData ( )

Definition at line 820 of file f5lists.cc.

820 {
821 return data;
822}

◆ getDel()

bool CNode::getDel ( )

Definition at line 876 of file f5lists.cc.

876 {
877 return data->getDel();
878}
bool getDel()
Definition: f5data.h:214

◆ getLp1Index()

int CNode::getLp1Index ( )

Definition at line 852 of file f5lists.cc.

852 {
853 return this->data->getLp1Index();
854}
int getLp1Index()
Definition: f5data.h:206

◆ getLp1Poly()

poly CNode::getLp1Poly ( )

Definition at line 836 of file f5lists.cc.

836 {
837 return this->data->getLp1Poly();
838}
poly getLp1Poly()
Definition: f5data.h:190

◆ getLp1Term()

poly CNode::getLp1Term ( )

Definition at line 844 of file f5lists.cc.

844 {
845 return this->data->getLp1Term();
846}
poly getLp1Term()
Definition: f5data.h:198

◆ getLp2Index()

int CNode::getLp2Index ( )

Definition at line 856 of file f5lists.cc.

856 {
857 return this->data->getLp2Index();
858}
int getLp2Index()
Definition: f5data.h:210

◆ getLp2Poly()

poly CNode::getLp2Poly ( )

Definition at line 840 of file f5lists.cc.

840 {
841 return this->data->getLp2Poly();
842}
poly getLp2Poly()
Definition: f5data.h:194

◆ getLp2Term()

poly CNode::getLp2Term ( )

Definition at line 848 of file f5lists.cc.

848 {
849 return this->data->getLp2Term();
850}
poly getLp2Term()
Definition: f5data.h:202

◆ getMinDeg()

CNode * CNode::getMinDeg ( )

Definition at line 805 of file f5lists.cc.

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

◆ getNext()

CNode * CNode::getNext ( )

Definition at line 824 of file f5lists.cc.

824 {
825 return next;
826}

◆ getT1()

poly CNode::getT1 ( )

Definition at line 860 of file f5lists.cc.

860 {
861 return this->data->getT1();
862}
poly getT1()
Definition: f5data.h:166

◆ getT2()

poly CNode::getT2 ( )

Definition at line 868 of file f5lists.cc.

868 {
869 return this->data->getT2();
870}
poly getT2()
Definition: f5data.h:178

◆ getTestedRuleOld()

RuleOld * CNode::getTestedRuleOld ( )

Definition at line 880 of file f5lists.cc.

880 {
881 return this->data->getTestedRuleOld();
882}
RuleOld * getTestedRuleOld()
Definition: f5data.h:218

◆ insert()

CNode * CNode::insert ( CPairOld c)

Definition at line 702 of file f5lists.cc.

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

◆ insertWithoutSort()

CNode * CNode::insertWithoutSort ( CPairOld cp)

Definition at line 797 of file f5lists.cc.

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

◆ print()

void CNode::print ( )

Definition at line 885 of file f5lists.cc.

886{
887 CNode* temp = this;
888 PrintS("___________________List of critical pairs______________________:\n");
889 while(NULL != temp)
890 {
891 pWrite(ppMult_qq(temp->getT1(),temp->getLp1Term()));
892 Print("LP1 Index: %d\n",temp->getLp1Index());
893 PrintS("T1: ");
894 pWrite(temp->getT1());
895 Print("%p\n",temp->getT1());
896 PrintS("LP1 Term: ");
897 pWrite(temp->getLp1Term());
898 PrintS("LP1 Poly: ");
899 pWrite(temp->getLp1Poly());
900 Print("LP2 Index: %d\n",temp->getLp2Index());
901 PrintS("T2: ");
902 pWrite(temp->getT2());
903 Print("%p\n",temp->getT2());
904 PrintS("LP2 Term: ");
905 pWrite(temp->getLp2Term());
906 PrintS("LP2 Poly: ");
907 pWrite(temp->getLp2Poly());
908 PrintLn();
909 temp = temp->next;
910 }
911}
poly getT1()
Definition: f5lists.cc:860
poly getLp2Poly()
Definition: f5lists.cc:840
int getLp2Index()
Definition: f5lists.cc:856
poly getLp1Term()
Definition: f5lists.cc:844
poly getT2()
Definition: f5lists.cc:868
poly getLp2Term()
Definition: f5lists.cc:848
int getLp1Index()
Definition: f5lists.cc:852
poly getLp1Poly()
Definition: f5lists.cc:836
#define Print
Definition: emacs.cc:80
void pWrite(poly p)
Definition: polys.h:308
void PrintS(const char *s)
Definition: reporter.cc:284
void PrintLn()
Definition: reporter.cc:310

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: