Changeset a05c71 in git for kernel/f5lists.cc


Ignore:
Timestamp:
Aug 31, 2009, 3:55:46 PM (14 years ago)
Author:
Christian Eder
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
fb1212fa95dcc1179dddfd72a79683e1282d5662
Parents:
f414c0965b52eb8faa2ff8c9afef799657e50a29
Message:
termination tests included in procedure findReducers()


git-svn-id: file:///usr/local/Singular/svn/trunk@12090 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/f5lists.cc

    rf414c0 ra05c71  
    3030    next                =   NULL;
    3131}
    32 LNode::LNode(LPoly* lp) {
     32LNode::LNode(LPolyOld* lp) {
    3333    data                =   lp;
    3434    next                =   NULL;
    3535}
    3636       
    37 LNode::LNode(LPoly* lp, LNode* l) {
     37LNode::LNode(LPolyOld* lp, LNode* l) {
    3838//Print("HIER LNODE\n");
    3939    data                =   lp;
     
    4141}
    4242
    43 LNode::LNode(poly t, int i, poly p, Rule* r) {
    44 LPoly* lp           =   new LPoly(t,i,p,r);
     43LNode::LNode(poly t, int i, poly p, RuleOld* r) {
     44LPolyOld* lp           =   new LPolyOld(t,i,p,r);
    4545data                =   lp;
    4646next                =   NULL;
    4747}
    4848       
    49 LNode::LNode(poly t, int i, poly p, Rule* r, LNode* l) {
    50     LPoly* lp           =   new LPoly(t,i,p,r);
     49LNode::LNode(poly t, int i, poly p, RuleOld* r, LNode* l) {
     50    LPolyOld* lp           =   new LPolyOld(t,i,p,r);
    5151    data                =   lp;
    5252    next                =   l;
     
    5454
    5555LNode::LNode(LNode* ln) {
    56     data                =   ln->getLPoly();
     56    data                =   ln->getLPolyOld();
    5757    next                =   ln->getNext();
    5858}
     
    7575// insert new elements to the list always at the end (labeled / classical polynomial view)
    7676// needed for list gPrev
    77 inline LNode* LNode::insert(LPoly* lp) {
     77inline LNode* LNode::insert(LPolyOld* lp) {
    7878    //Print("LAST GPREV: ");
    7979    //pWrite(this->getPoly());
     
    8989}
    9090       
    91 inline LNode* LNode::insert(poly t, int i, poly p, Rule* r) {
     91inline LNode* LNode::insert(poly t, int i, poly p, RuleOld* r) {
    9292    if(NULL == this) {
    9393        LNode* newElement   =   new LNode(t,i,p,r,this);
     
    103103// insert new elements to the list always in front (labeled / classical polynomial view)
    104104// needed for sPolyList
    105 inline LNode* LNode::insertSP(LPoly* lp) {
     105inline LNode* LNode::insertSP(LPolyOld* lp) {
    106106    LNode* newElement   =   new LNode(lp, this);
    107107    //Print("INSERTED IN SPOLYLIST: ");
     
    110110}
    111111       
    112 inline LNode* LNode::insertSP(poly t, int i, poly p, Rule* r) {
     112inline LNode* LNode::insertSP(poly t, int i, poly p, RuleOld* r) {
    113113    LNode* newElement   =   new LNode(t, i, p, r, this);
    114114     //Print("INSERTED IN SPOLYLIST: ");
     
    118118// insert new elemets to the list w.r.t. increasing labels
    119119// only used for the S-polys to be reduced (TopReduction building new S-polys with higher label)
    120 inline LNode* LNode::insertByLabel(poly t, int i, poly p, Rule* r) {
     120inline LNode* LNode::insertByLabel(poly t, int i, poly p, RuleOld* r) {
    121121    //Print("ADDING SOLYS TO THE LIST\n");
    122122    //Print("new element: ");
     
    222222}
    223223
    224 // get the LPoly* out of LNode*
    225 LPoly* LNode::getLPoly() {
     224// get the LPolyOld* out of LNode*
     225LPolyOld* LNode::getLPolyOld() {
    226226    return data;
    227227}
    228228
    229 // get the data from the LPoly saved in LNode
     229// get the data from the LPolyOld saved in LNode
    230230poly LNode::getPoly() {
    231231    return data->getPoly();
     
    240240}
    241241
    242 Rule* LNode::getRule() {
    243     return data->getRule();
    244 }
    245 
    246 void LNode::setRule(Rule* r) {
    247     return data->setRule(r);
     242RuleOld* LNode::getRuleOld() {
     243    return data->getRuleOld();
     244}
     245
     246void LNode::setRuleOld(RuleOld* r) {
     247    return data->setRuleOld(r);
    248248}
    249249
     
    252252}
    253253
    254 // set the data from the LPoly saved in LNode
     254// set the data from the LPolyOld saved in LNode
    255255void LNode::setPoly(poly p) {
    256256    data->setPoly(p);
     
    333333}
    334334
    335 LList::LList(LPoly* lp) {
     335LList::LList(LPolyOld* lp) {
    336336    first   =   new LNode(lp);
    337337    last    =   first;
     
    339339}
    340340
    341 LList::LList(poly t,int i,poly p,Rule* r) {
     341LList::LList(poly t,int i,poly p,RuleOld* r) {
    342342    first   =   new LNode(t,i,p,r);
    343343    last    =   first;
     
    356356
    357357// insertion at the end of the list, needed for gPrev
    358 void LList::insert(LPoly* lp) {
     358void LList::insert(LPolyOld* lp) {
    359359    last = last->insert(lp);
    360360    if(NULL == first) {
     
    369369}
    370370
    371 void LList::insert(poly t,int i, poly p, Rule* r) {
     371void LList::insert(poly t,int i, poly p, RuleOld* r) {
    372372    last = last->insert(t,i,p,r);
    373373    if(NULL == first) {
     
    379379
    380380// insertion in front of the list, needed for sPolyList
    381 void LList::insertSP(LPoly* lp) {
     381void LList::insertSP(LPolyOld* lp) {
    382382    first = first->insertSP(lp);
    383383    length++;
     
    385385}
    386386
    387 void LList::insertSP(poly t,int i, poly p, Rule* r) {
     387void LList::insertSP(poly t,int i, poly p, RuleOld* r) {
    388388    first = first->insertSP(t,i,p,r);
    389389    length++;
     
    392392
    393393
    394 void LList::insertByLabel(poly t, int i, poly p, Rule* r) {
     394void LList::insertByLabel(poly t, int i, poly p, RuleOld* r) {
    395395    first = first->insertByLabel(t,i,p,r);
    396396    length++;
     
    483483
    484484// NOTE: We insert at the beginning of the list and length = i-1, where i is the actual index.
    485 //       Thus given actual index i and idx being the index of the LPoly under investigation
     485//       Thus given actual index i and idx being the index of the LPolyOld under investigation
    486486//       the element on position length-idx is the right one
    487487LNode* LTagNode::get(int idx, int length) {
     
    719719}
    720720
    721 LPoly* CNode::getAdLp1() {
     721LPolyOld* CNode::getAdLp1() {
    722722    return this->data->getAdLp1();
    723723}
    724724
    725 LPoly* CNode::getAdLp2() {
     725LPolyOld* CNode::getAdLp2() {
    726726    return this->data->getAdLp2();
    727727}
     
    767767}
    768768
    769 Rule* CNode::getTestedRule() {
    770     return this->data->getTestedRule();
     769RuleOld* CNode::getTestedRuleOld() {
     770    return this->data->getTestedRuleOld();
    771771}
    772772
     
    854854}
    855855
    856 RNode::RNode(Rule* r) {
     856RNode::RNode(RuleOld* r) {
    857857    data    =   r;
    858858    next    =   NULL;
     
    860860
    861861RNode::~RNode() {
    862     //Print("DELETE RULE\n");
     862    //Print("DELETE RuleOld\n");
    863863    delete  data;
    864864}
    865865
    866 RNode* RNode::insert(Rule* r) {
     866RNode* RNode::insert(RuleOld* r) {
    867867    RNode* newElement   =   new RNode(r);
    868868    newElement->next    =   this;
     
    873873    //Print("IN INSERT: ");
    874874    //pWrite(t);
    875     Rule*   r           =   new Rule(i,t);
    876     //Print("ADDRESS OF RULE: %p\n",r);
     875    RuleOld*   r           =   new RuleOld(i,t);
     876    //Print("ADDRESS OF RuleOld: %p\n",r);
    877877    RNode* newElement   =   new RNode(r);
    878878    //Print("ADDRESS OF RNODE: %p\n",newElement);
    879     //Print("ADDRESS OF RNODE DATA: %p\n",newElement->getRule());
     879    //Print("ADDRESS OF RNODE DATA: %p\n",newElement->getRuleOld());
    880880    newElement->next    =   this;
    881881    return newElement;
     
    883883
    884884
    885 RNode* RNode::insertOrdered(Rule* r) {
     885RNode* RNode::insertOrdered(RuleOld* r) {
    886886    RNode* newElement   =   new RNode(r);
    887887    RNode* temp         =   this;
     
    890890        return newElement;
    891891    }
    892     if(1 == pLmCmp(newElement->getRuleTerm(),temp->getRuleTerm())) {
     892    if(1 == pLmCmp(newElement->getRuleOldTerm(),temp->getRuleOldTerm())) {
    893893        newElement->next =   temp;
    894894        return newElement;
    895895    }
    896896    else {
    897         while(NULL != temp && 1 ==  pLmCmp(temp->getRuleTerm(),newElement->getRuleTerm())) {
     897        while(NULL != temp && 1 ==  pLmCmp(temp->getRuleOldTerm(),newElement->getRuleOldTerm())) {
    898898            temp    =   temp->getNext();
    899899        }
     
    908908}   
    909909
    910 Rule* RNode::getRule() {
     910RuleOld* RNode::getRuleOld() {
    911911    return data;
    912912}
    913913
    914 int RNode::getRuleIndex() {
     914int RNode::getRuleOldIndex() {
    915915    return data->getIndex();
    916916}
    917917
    918 poly RNode::getRuleTerm() {
     918poly RNode::getRuleOldTerm() {
    919919    return data->getTerm();
    920920}
     
    923923    RNode* temp  =   this;
    924924    while(NULL != temp) {
    925         pWrite(temp->getRuleTerm());
    926         Print("%d\n\n",temp->getRuleIndex());
     925        pWrite(temp->getRuleOldTerm());
     926        Print("%d\n\n",temp->getRuleOldIndex());
    927927        temp    =   temp->getNext();
    928928    }
     
    938938}
    939939
    940 RList::RList(Rule* r) {
     940RList::RList(RuleOld* r) {
    941941    first = new RNode(r);
    942942}
     
    950950        //Print("1 %p\n",first);
    951951        //if(first) {
    952             //Print("1' %p\n",first->getRule());
     952            //Print("1' %p\n",first->getRuleOld());
    953953            //Print("2 %p\n",first->getNext());
    954             //Print("3 %p\n",first->getNext()->getRule());
    955             //Print("3 %p\n",first->getNext()->getRuleTerm());
     954            //Print("3 %p\n",first->getNext()->getRuleOld());
     955            //Print("3 %p\n",first->getNext()->getRuleOldTerm());
    956956        //}
    957957        delete  temp;
     
    964964}
    965965
    966 void RList::insert(Rule* r) {
     966void RList::insert(RuleOld* r) {
    967967    first = first->insert(r);
    968968}
    969969
    970 void RList::insertOrdered(Rule* r) {
     970void RList::insertOrdered(RuleOld* r) {
    971971    first   =   first->insertOrdered(r);
    972972}
     
    976976}
    977977
    978 Rule* RList::getRule() {
    979     return this->getRule();
     978RuleOld* RList::getRuleOld() {
     979    return this->getRuleOld();
    980980}
    981981
     
    10291029
    10301030// NOTE: We insert at the beginning of the list and length = i-1, where i is the actual index.
    1031 //       Thus given actual index i and idx being the index of the LPoly under investigation
     1031//       Thus given actual index i and idx being the index of the LPolyOld under investigation
    10321032//       the element on position length-idx+1 is the right one
    10331033RNode* RTagNode::get(int idx, int length) {
     
    10581058    RTagNode* temp  =   this;
    10591059    if(NULL != temp && NULL != temp->getRNode()) {
    1060         Print("1. element: %d,  ",getRNode()->getRule()->getIndex());
    1061         pWrite(getRNode()->getRule()->getTerm());
     1060        Print("1. element: %d,  ",getRNode()->getRuleOld()->getIndex());
     1061        pWrite(getRNode()->getRuleOld()->getTerm());
    10621062        temp    =   temp->next;
    10631063        int i   =   2;
    10641064        while(NULL != temp->getRNode() && NULL != temp) {
    1065             Print("%d. element: %d,  ",i,getRNode()->getRule()->getIndex());
    1066             pWrite(getRNode()->getRule()->getTerm());
     1065            Print("%d. element: %d,  ",i,getRNode()->getRuleOld()->getIndex());
     1066            pWrite(getRNode()->getRuleOld()->getTerm());
    10671067            temp    =   temp->next;
    10681068            i++;
Note: See TracChangeset for help on using the changeset viewer.