Changeset 598870 in git for kernel/f5gb.cc


Ignore:
Timestamp:
Feb 23, 2009, 3:28:38 PM (15 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
35a76a17eccff079e65732eed250dcf59efee656
Parents:
b0237b842fe21cec3d4b51436f88ff9d8f8aad12
Message:
still debugging


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

Legend:

Unmodified
Added
Removed
  • kernel/f5gb.cc

    rb0237b8 r598870  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5gb.cc,v 1.32 2009-02-22 18:58:36 ederc Exp $ */
     4/* $Id: f5gb.cc,v 1.33 2009-02-23 14:28:38 ederc Exp $ */
    55/*
    66* ABSTRACT: f5gb interface
     
    105105        LNode* temp     =   sPolyList->getFirst();
    106106        while(NULL != temp && NULL != temp->getLPoly()) {
    107             Print("Spolylist element: ");
    108             pWrite(temp->getPoly());
     107            //Print("Spolylist element: ");
     108            //pWrite(temp->getPoly());
    109109            temp    =   temp->getNext();
    110         } 
     110        }
    111111        // reduction process of new S-polynomials and also adds new critical pairs to critPairs
    112112        reduction(sPolyList, critPairs, gPrev, rules, lTag, rTag, gbPrev);
    113113       
    114114        // DEBUG STUFF FOR GPREV
    115         temp    =   gPrev->getFirst();
    116         Print("\n\n");
    117         while(NULL != temp) {
    118             pWrite(temp->getPoly());
    119             temp    =   temp->getNext();
    120         }
    121         //sleep(10);
     115        //temp    =   gPrev->getFirst();
     116        //int number  =   1;
     117        //Print("\n\n");
     118        //while(NULL != temp) {
     119        //    Print("%d.  ",number);
     120        //    pWrite(temp->getPoly());
     121        //    temp    =   temp->getNext();
     122        //    number++;
     123        //    Print("\n");
     124        //}
     125        //sleep(5);
    122126   
    123127    }
    124     Print("REDUCTION DONE\n");
    125     Print("%p\n",rules->getFirst());
    126     Print("%p\n",rTag->getFirst());
     128    //Print("REDUCTION DONE\n");
     129    //Print("%p\n",rules->getFirst());
     130    //Print("%p\n",rTag->getFirst());
    127131    if(rules->getFirst() != rTag->getFirst()) {
    128         Print("+++++++++++++++++++++++++++++++++++++NEW RULES+++++++++++++++++++++++++++++++++++++\n");
     132        //Print("+++++++++++++++++++++++++++++++++++++NEW RULES+++++++++++++++++++++++++++++++++++++\n");
    129133        rTag->insert(rules->getFirst());
    130134    }
    131135    else {
    132         Print("+++++++++++++++++++++++++++++++++++NO NEW RULES++++++++++++++++++++++++++++++++++++\n");
     136        //Print("+++++++++++++++++++++++++++++++++++NO NEW RULES++++++++++++++++++++++++++++++++++++\n");
    133137    }
    134138    lTag->insert(lTag->getFirstCurrentIdx());
    135     Print("LTAG LIST: \n");
     139    //Print("LTAG LIST: \n");
    136140    LNode* tempTag = lTag->getFirst();
    137     Print("INDEX: %d\n",tempTag->getIndex());
    138     pWrite(tempTag->getPoly());
    139     Print("COMPLETED FIRST IN F5INC: \n");
     141    //Print("INDEX: %d\n",tempTag->getIndex());
     142    //pWrite(tempTag->getPoly());
     143    //Print("COMPLETED FIRST IN F5INC: \n");
    140144    //Print("1st gPrev: ");
    141145    //pWrite(gPrev->getFirst()->getPoly());
     
    179183        u2 = pDivide(lcm, pHead(temp->getPoly()));
    180184        pSetCoeff(u2,nOne);
    181         Print("IN CRITPAIRS\n");
    182         pWrite(u1);
    183         Print("1st ELEMENT: ");
    184         pWrite(newElement->getPoly());
    185         Print("2nd ELEMENT: ");
    186         pWrite(temp->getPoly());
     185        //Print("IN CRITPAIRS\n");
     186        //pWrite(u1);
     187        //Print("1st ELEMENT: ");
     188        //pWrite(newElement->getPoly());
     189        //Print("2nd ELEMENT: ");
     190        //pWrite(temp->getPoly());
    187191        // testing both new labels by the F5 Criterion
    188192        if(!criterion1(gPrev,u1,newElement,lTag) && !criterion1(gPrev,u2,temp,lTag) &&
     
    192196            if(newElement->getIndex() == temp->getIndex() &&
    193197            -1 == pLmCmp(ppMult_qq(u1, newElement->getTerm()),ppMult_qq(u2, temp->getTerm()))) {
    194                 Print("zweites groesser\n");
     198                //Print("zweites groesser\n");
    195199                CPair* cp   =   new CPair(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2,
    196200                                temp->getLPoly(), u1, newElement->getLPoly(), testedRule);                   
     
    198202            }
    199203            else {
    200                 Print("erstes groesser\n");
     204                //Print("erstes groesser\n");
    201205                CPair* cp   =   new CPair(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1,
    202206                                newElement->getLPoly(), u2, temp->getLPoly(), testedRule);                   
     
    207211        }
    208212       
    209         Print("\n\n");
     213        //Print("\n\n");
    210214        temp    =   temp->getNext();
    211215    }
    212216    // for debugging
    213217    if(NULL != critPairs) {
    214         critPairs->print();
     218        //critPairs->print();
    215219    }
    216220}
     
    234238        // save the monom t1*label_term(l) as it is tested various times in the following
    235239        poly u1 = ppMult_qq(t,l->getTerm());
    236         Print("------------------------------IN CRITERION 1-----------------------------------------\n");
    237         Print("TESTED ELEMENT: ");
    238         pWrite(l->getPoly());
    239         pWrite(ppMult_qq(t,l->getTerm()));
    240         Print("%d\n\n",l->getIndex());
     240        //Print("------------------------------IN CRITERION 1-----------------------------------------\n");
     241        //Print("TESTED ELEMENT: ");
     242        //pWrite(l->getPoly());
     243        //pWrite(ppMult_qq(t,l->getTerm()));
     244        //Print("%d\n\n",l->getIndex());
    241245        while(testNode->getIndex() < idx && NULL != testNode->getLPoly()) {
    242             pWrite(testNode->getPoly());
    243             Print("%d\n",testNode->getIndex());
     246            //pWrite(testNode->getPoly());
     247            //Print("%d\n",testNode->getIndex());
    244248            if(pLmDivisibleByNoComp(testNode->getPoly(),u1)) {
    245                 Print("Criterion 1 NOT passed!\n");
     249                //Print("Criterion 1 NOT passed!\n");
    246250                return true;
    247251            }
    248             pWrite(testNode->getNext()->getPoly());
     252            //pWrite(testNode->getNext()->getPoly());
    249253            testNode    =   testNode->getNext();
    250254        }
     
    261265*/
    262266bool criterion2(poly t, LNode* l, RList* rules, RTagList* rTag) {
    263     Print("------------------------------IN CRITERION 2-----------------------------------------\n");
    264         Print("RULES: \n");
     267    //Print("------------------------------IN CRITERION 2-----------------------------------------\n");
     268        //Print("RULES: \n");
    265269        RNode* tempR    =   rules->getFirst();
    266270        while(NULL != tempR->getRule()) {
    267             Print("ADDRESS OF RULE: %p\n",tempR->getRule());
    268             pWrite(tempR->getRuleTerm());
    269             Print("ADDRESS OF TERM: %p\n",tempR->getRuleTerm());
    270             Print("%d\n\n",tempR->getRuleIndex());
     271            //Print("ADDRESS OF RULE: %p\n",tempR->getRule());
     272            //pWrite(tempR->getRuleTerm());
     273            //Print("ADDRESS OF TERM: %p\n",tempR->getRuleTerm());
     274            //Print("%d\n\n",tempR->getRuleIndex());
    271275            tempR   =   tempR->getNext();
    272276        }
    273 Print("TESTED ELEMENT: ");
    274         pWrite(l->getPoly());
    275         pWrite(ppMult_qq(t,l->getTerm()));
    276         Print("%d\n\n",l->getIndex());
     277//Print("TESTED ELEMENT: ");
     278        //pWrite(l->getPoly());
     279        //pWrite(ppMult_qq(t,l->getTerm()));
     280        //Print("%d\n\n",l->getIndex());
    277281// start at the previously added element to gPrev, as all other elements will have the same index for sure
    278282    RNode* testNode =   new RNode();
     
    285289        }
    286290        else {
    287         Print("DEBUG\n");
    288         Print("L INDEX: %d\n",l->getIndex());
     291        //Print("DEBUG\n");
     292        //Print("L INDEX: %d\n",l->getIndex());
    289293            testNode    =   rTag->get(l->getIndex());
    290             Print("TESTNODE ADDRESS: %p\n",testNode);
     294            //Print("TESTNODE ADDRESS: %p\n",testNode);
    291295        }
    292296    }
     
    297301    // NOTE: testNode is possibly NULL as rTag->get() returns NULL for elements of index <=1!
    298302    if(NULL != testNode && NULL != testNode->getRule()) {   
    299         pWrite(testNode->getRuleTerm());
     303        //pWrite(testNode->getRuleTerm());
    300304    }
    301305    if(NULL != testNode) {
    302306        if(testNode->getRule() == l->getRule()) {
    303             Print("%p\n%p\n",testNode->getRule(),l->getRule());
    304             Print("EQUAL\n");
     307            //Print("%p\n%p\n",testNode->getRule(),l->getRule());
     308            //Print("EQUAL\n");
    305309        }
    306310        else {
    307             Print("NOT EQUAL\n");
     311            //Print("NOT EQUAL\n");
    308312        }
    309313    }
    310314    while(NULL != testNode && NULL != testNode->getRule() && testNode->getRule() != l->getRule()
    311315          && l->getIndex() == testNode->getRuleIndex()) {
    312         pWrite(testNode->getRuleTerm());
     316        //pWrite(testNode->getRuleTerm());
    313317                if(pLmDivisibleBy(testNode->getRuleTerm(),u1)) {
    314             Print("Criterion 2 NOT passed!\n");
     318            //Print("Criterion 2 NOT passed!\n");
    315319            pDelete(&u1);
    316320            return true;
     
    330334*/
    331335bool criterion2(poly t, LPoly* l, RList* rules, Rule* testedRule) {
    332     Print("------------------------------IN CRITERION 2-----------------------------------------\n");
    333     Print("LAST RULE TESTED: %p",testedRule);
    334     Print("RULES: \n");
     336    //Print("------------------------------IN CRITERION 2-----------------------------------------\n");
     337    //Print("LAST RULE TESTED: %p",testedRule);
     338    //Print("RULES: \n");
    335339        RNode* tempR    =   rules->getFirst();
    336340        while(NULL != tempR->getRule()) {
    337             pWrite(tempR->getRuleTerm());
    338             Print("%d\n\n",tempR->getRuleIndex());
     341            //pWrite(tempR->getRuleTerm());
     342            //Print("%d\n\n",tempR->getRuleIndex());
    339343            tempR   =   tempR->getNext();
    340344        }
    341         Print("TESTED ELEMENT: ");
    342         pWrite(l->getPoly());
    343         pWrite(ppMult_qq(t,l->getTerm()));
    344         Print("%d\n\n",l->getIndex());
     345        //Print("TESTED ELEMENT: ");
     346        //pWrite(l->getPoly());
     347        //pWrite(ppMult_qq(t,l->getTerm()));
     348        //Print("%d\n\n",l->getIndex());
    345349// start at the previously added element to gPrev, as all other elements will have the same index for sure
    346350        RNode* testNode =   rules->getFirst();
     
    349353        // first element added to rTag was NULL, check for this
    350354        while(NULL != testNode->getRule() && testNode->getRule() != testedRule) {
    351         pWrite(testNode->getRuleTerm());
     355        //pWrite(testNode->getRuleTerm());
    352356        if(pLmDivisibleBy(testNode->getRuleTerm(),u1)) {
    353             Print("Criterion 2 NOT passed!\n");
     357            //Print("Criterion 2 NOT passed!\n");
    354358            pDelete(&u1);
    355359            return true;
     
    383387                        sp      =   pSub(ppMult_qq(temp->getT1(),temp->getLp1Poly()),
    384388                                         ppMult_qq(temp->getT2(),temp->getLp2Poly()));
    385                         Print("BEGIN SPOLY1\n====================\n");
     389                        //Print("BEGIN SPOLY1\n====================\n");
    386390                        pNorm(sp);
    387                         pWrite(sp);
    388                         Print("END SPOLY1\n====================\n");
     391                        //pWrite(sp);
     392                        //Print("END SPOLY1\n====================\n");
    389393                        if(NULL == sp) {
    390394                            // as rules consist only of pointers we need to save the labeled
     
    394398                            // will never be used again as it is zero => no problems with
    395399                            // further criterion2() tests and termination conditions
    396                             Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ZERO REDUCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
     400                            //Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ZERO REDUCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
    397401                                                        reductionsToZero++;
    398402                            rules->insert(temp->getLp1Index(),ppMult_qq(temp->getT1(),temp->getLp1Term()));
    399                             Print("RULE ADDED: \n");
    400                             pWrite(rules->getFirst()->getRuleTerm());
     403                            //Print("RULE ADDED: \n");
     404                            //pWrite(rules->getFirst()->getRuleTerm());
    401405                            // as sp = NULL, delete it
    402406                            pDelete(&sp);
    403                             Print("HIER\n");
     407                            //Print("HIER\n");
    404408                        }
    405409                        else {
    406410                            rules->insert(temp->getLp1Index(),ppMult_qq(temp->getT1(),temp->getLp1Term()));
    407                             Print("RULE ADDED: \n");
    408                             pWrite(rules->getFirst()->getRuleTerm()); 
     411                            //Print("RULE ADDED: \n");
     412                            //pWrite(rules->getFirst()->getRuleTerm()); 
    409413                            sPolyList->insertSP(ppMult_qq(temp->getT1(),temp->getLp1Term()),temp->getLp1Index(),sp,rules->getFirst()->getRule());
    410414                        }
     
    416420                    sp      =   pSub(ppMult_qq(temp->getT1(),temp->getLp1Poly()),
    417421                                     ppMult_qq(temp->getT2(),temp->getLp2Poly()));
    418                     Print("BEGIN SPOLY2\n====================\n");
     422                    //Print("BEGIN SPOLY2\n====================\n");
    419423                    pNorm(sp);
    420                     pWrite(sp);
    421                     Print("END SPOLY2\n====================\n");
     424                    //pWrite(sp);
     425                    //Print("END SPOLY2\n====================\n");
    422426                    if(NULL == sp) {
    423427                        // zeroList->insert(temp->getAdT1(),temp->getLp1Index(),&sp);
     
    425429                        // will never be used again as it is zero => no problems with
    426430                        // further criterion2() tests and termination conditions
    427                             Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ZERO REDUCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
     431                            //Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ZERO REDUCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
    428432                        reductionsToZero++;
    429433                        rules->insert(temp->getLp1Index(),ppMult_qq(temp->getT1(),temp->getLp1Term()));
    430                         Print("RULE ADDED: \n");
    431                         pWrite(rules->getFirst()->getRuleTerm());
     434                        //Print("RULE ADDED: \n");
     435                        //pWrite(rules->getFirst()->getRuleTerm());
    432436                        // as sp = NULL, delete it
    433437                        pDelete(&sp);
     
    435439                    else {
    436440                        rules->insert(temp->getLp1Index(),ppMult_qq(temp->getT1(),temp->getLp1Term()));
    437                         Print("RULE ADDED: \n");
    438                         pWrite(rules->getFirst()->getRuleTerm());
    439                         Print("%d\n",rules->getFirst()->getRuleIndex());
    440                         Print("%p\n",sPolyList->getFirst());
     441                        //Print("RULE ADDED: \n");
     442                        //pWrite(rules->getFirst()->getRuleTerm());
     443                        //Print("%d\n",rules->getFirst()->getRuleIndex());
     444                        //Print("%p\n",sPolyList->getFirst());
    441445                        sPolyList->insertSP(ppMult_qq(temp->getT1(),temp->getLp1Term()),temp->getLp1Index(),sp,rules->getFirst()->getRule());
    442446                    }
     
    461465void reduction(LList* sPolyList, CList* critPairs, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag,
    462466                 ideal gbPrev) {
    463     Print("##########################################In REDUCTION!########################################\n");
     467    //Print("##########################################In REDUCTION!########################################\n");
    464468    // check if sPolyList has any elements
    465469    // NOTE: due to initialization sPolyList always has a default NULL element
    466470    while(sPolyList->getLength() > 0) {
    467         Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
     471        //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
    468472        if(sPolyList->getLength() > 1) {
    469         Print("%p\n",sPolyList->getFirst());
    470         Print("%p\n",sPolyList->getFirst()->getLPoly());
    471         Print("%p\n",sPolyList->getFirst()->getNext());
    472         Print("%p\n",sPolyList->getFirst()->getNext()->getLPoly());
    473         Print("%p\n",sPolyList->getFirst());
    474         }
    475         sPolyList->print();
     473        //Print("%p\n",sPolyList->getFirst());
     474        //Print("%p\n",sPolyList->getFirst()->getLPoly());
     475        //Print("%p\n",sPolyList->getFirst()->getNext());
     476        //Print("%p\n",sPolyList->getFirst()->getNext()->getLPoly());
     477        //Print("%p\n",sPolyList->getFirst());
     478        }
     479        //sPolyList->print();
    476480        // temp is the first element in the sPolyList which should be reduced
    477481        // due to earlier sorting this is the element of minimal degree AND
    478482        // minimal label
    479483        LNode* temp =   sPolyList->getFirst();
    480         pWrite(temp->getPoly());
     484        //pWrite(temp->getPoly());
    481485        // delete the above first element from sPolyList, temp will be either reduced to
    482486        // zero or added to gPrev, but never come back to sPolyList
    483         sPolyList->setFirst(temp->getNext());
    484         Print("HALLO %p\n",temp->getPoly());
    485         Print("%p\n",temp->getPoly());
    486         pWrite(temp->getPoly());
    487         idShow(gbPrev);
     487        if(NULL != temp && NULL != temp->getLPoly()) {
     488            sPolyList->setFirst(temp->getNext());
     489        //Print("HIER\n");
     490        }
     491        else {
     492            break;
     493        }
     494        //Print("HALLO %p\n",temp->getPoly());
     495        //Print("%p\n",temp->getPoly());
     496        //pWrite(temp->getPoly());
     497        //idShow(gbPrev);
    488498        poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly());
    489499        pNorm(tempNF);
    490         Print("LENGTH: %d\n",sPolyList->getLength());
    491         pWrite(tempNF);
    492         pWrite(temp->getPoly());
     500        //Print("LENGTH: %d\n",sPolyList->getLength());
     501        //pWrite(tempNF);
     502        //pWrite(temp->getPoly());
    493503        if(NULL != tempNF) {
    494504            // write the reduced polynomial in temp
     
    502512        if(NULL != temp->getPoly()) {
    503513            //CList* newCritPairs = new CList;
    504             Print("##################IN CRITPAIRS IN REDUCTION#####################\n");
     514            //Print("##################IN CRITPAIRS IN REDUCTION#####################\n");
    505515            criticalPair(gPrev,critPairs,lTag,rTag,rules);
    506516        }
     
    508518            //delete temp;
    509519            LNode* tempLoop = gPrev->getFirst();
    510             Print("AUSGABE IN REDUCTION:\n");       
     520            //Print("AUSGABE IN REDUCTION:\n");       
    511521            while(NULL != tempLoop) {
    512                 pWrite(tempLoop->getPoly());
     522                //pWrite(tempLoop->getPoly());
    513523                tempLoop = tempLoop->getNext();
    514524            }
     
    527537*/
    528538void topReduction(LNode* l, LList* sPolyList, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag) {
    529     Print("##########################################In topREDUCTION!########################################\n");
     539    //Print("##########################################In topREDUCTION!########################################\n");
    530540    // try l as long as there are reductors found by findReductor()
    531541    do {
    532542        LNode* tempRed  =   new LNode();
    533543        tempRed  =   findReductor(l,gPrev,rules,lTag,rTag);
    534         Print("--------------------------------HIER DEBUG 2----------------------------------\n");
     544        //Print("--------------------------------HIER DEBUG 2----------------------------------\n");
    535545        // if a reductor for l is found and saved in tempRed
    536546        if(NULL != tempRed) {
     
    539549            if(pLmCmp(tempRed->getTerm(),l->getTerm()) == 1) {
    540550                poly temp   =   pSub(tempRed->getPoly(),l->getPoly());
    541                 Print("OH JE\n");
    542                 pWrite(temp);
     551                //pWrite(temp);
    543552                if(NULL != temp) {
    544553                    pNorm(temp);
    545554                    tempRed->setPoly(temp);
    546555                    // for debugging
    547                     pWrite(tempRed->getPoly());
    548                     Print("RULE ADDED\n");
     556                    //pWrite(tempRed->getPoly());
     557                    //Print("RULE ADDED\n");
    549558                    rules->insert(tempRed->getIndex(),tempRed->getTerm());
    550                      
    551559                    tempRed->getLPoly()->setRule(rules->getFirst()->getRule());
    552                     Print("%p\n",sPolyList->getFirst());
    553                     Print("%p\n",sPolyList->getFirst()->getLPoly());
    554                     Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
     560                    //Print("%p\n",sPolyList->getFirst());
     561                    //Print("%p\n",sPolyList->getFirst()->getLPoly());
     562                    //Print("SPOLYLIST LENGTH: %d\n",sPolyList->getLength());
    555563                    sPolyList->insertByLabel(tempRed);
     564                //Print("OH JE\n");
    556565                }
    557566                else {
    558567                    pDelete(&temp);
    559568                    reductionsToZero++;
    560                     Print("RULE ADDED\n");
    561         Print("wieder hier2\n");
     569                    //Print("RULE ADDED\n");
     570        //Print("wieder hier2\n");
    562571                    rules->insert(tempRed->getIndex(),tempRed->getTerm());
    563572                    delete tempRed;
     
    569578            else {
    570579                poly temp   =   pSub(l->getPoly(),tempRed->getPoly());
    571                 pWrite(temp);
     580                //pWrite(temp);
    572581                if(NULL != temp) {
    573582                    pNorm(temp);
     
    576585                }
    577586                else {
    578                     Print("ZERO REDUCTION!\n");
     587                    //Print("ZERO REDUCTION!\n");
    579588                    reductionsToZero++;
    580589                    pDelete(&temp);
    581590                    l->setPoly(NULL);
    582                     pWrite(gPrev->getLast()->getPoly());
     591                    //pWrite(gPrev->getLast()->getPoly());
    583592                    break;
    584593                }
     
    587596        else {
    588597            if(NULL != l->getPoly()) {
    589                 Print("ADDED TO GPREV IN TOPREDUCTION: ");
    590                 pWrite(l->getPoly());
    591                 pWrite(l->getTerm());
    592                 Print("INDEX: %d\n", l->getIndex());
     598                //Print("ADDED TO GPREV IN TOPREDUCTION: ");
     599                //pWrite(l->getPoly());
     600                //pWrite(l->getTerm());
     601                //Print("INDEX: %d\n", l->getIndex());
    593602                //sleep(10);
    594603                gPrev->insert(l->getLPoly());
    595                 Print("GPREV: \n");
     604                //Print("GPREV: \n");
    596605                LNode* tempLoop = gPrev->getFirst();
    597606                while(NULL != tempLoop) {
    598                     Print("HERE\n");
    599                     pWrite(tempLoop->getPoly());
     607                    //Print("HERE\n");
     608                    //pWrite(tempLoop->getPoly());
    600609                    tempLoop = tempLoop->getNext();
    601610                }
     
    614623LNode* findReductor(LNode* l, LList* gPrev, RList* rules, LTagList* lTag,RTagList* rTag) {
    615624    // allociation of memory for the possible reductor
    616     Print("IN FIND REDUCTOR\n");
     625    //Print("IN FIND REDUCTOR\n");
    617626    poly u      =   pOne();
    618627    poly red    =   pOne();
     
    652661                    // passing criterion1 ?
    653662                    if(!criterion1(gPrev,u,temp,lTag)) {
    654                             Print("HIER DEBUG\n");
     663                            //Print("HIER DEBUG\n");
    655664                            l->setGPrevRedCheck(temp);
    656665                            LNode* redNode  =   new LNode(u,temp->getIndex(),red,NULL,NULL);
     
    664673   
    665674//    delete temp;
    666    Print("1st gPrev: ");
    667     pWrite(gPrev->getFirst()->getPoly());
    668     Print("2nd gPrev: ");
    669     pWrite(gPrev->getFirst()->getNext()->getPoly());
     675   //Print("1st gPrev: ");
     676    //pWrite(gPrev->getFirst()->getPoly());
     677    //Print("2nd gPrev: ");
     678    //pWrite(gPrev->getFirst()->getNext()->getPoly());
    670679 return NULL;
    671680}
     
    685694    // tag the first element of index i-1 for criterion 1
    686695    LTagList* lTag  =   new LTagList();
    687     Print("LTAG BEGINNING: %p\n",lTag->getFirst());
     696    //Print("LTAG BEGINNING: %p\n",lTag->getFirst());
    688697   
    689698    // first element in rTag is first element of rules which is NULL RNode,
     
    703712    }
    704713    LList* gPrev    =   new LList(ONE, i, id->m[0]);
    705     Print("%p\n",id->m[0]);
    706     pWrite(id->m[0]);
    707     Print("%p\n",gPrev->getFirst()->getPoly());
    708     pWrite(gPrev->getFirst()->getPoly());
     714    //Print("%p\n",id->m[0]);
     715    //pWrite(id->m[0]);
     716    //Print("%p\n",gPrev->getFirst()->getPoly());
     717    //pWrite(gPrev->getFirst()->getPoly());
    709718
    710719    lTag->insert(gPrev->getFirst());
     
    712721    // computing the groebner basis of the elements of index < actual index
    713722    gbLength    =   gPrev->getLength();
    714     Print("Laenge der bisherigen Groebner Basis: %d\n",gPrev->getLength());
     723    //Print("Laenge der bisherigen Groebner Basis: %d\n",gPrev->getLength());
    715724    ideal gbPrev    =   idInit(gbLength,1);
    716725    // initializing the groebner basis of elements of index < actual index
    717726    gbPrev->m[0]    =   gPrev->getFirst()->getPoly();
    718     idShow(gbPrev);
    719     idShow(currQuotient);
     727    //idShow(gbPrev);
     728    //idShow(currQuotient);
    720729
    721730    for(i=2; i<=IDELEMS(id); i++) {
    722731        LNode* gPrevTag =   gPrev->getLast();
    723         Print("Last POlynomial in GPREV: ");
    724         Print("%p\n",gPrevTag);   
    725         pWrite(gPrevTag->getPoly());
     732        //Print("Last POlynomial in GPREV: ");
     733        //Print("%p\n",gPrevTag);   
     734        //pWrite(gPrevTag->getPoly());
    726735        gPrev   =   F5inc(i, id->m[i-1], gPrev, gbPrev, ONE, lTag, rules, rTag);
    727736        // DEBUGGING STUFF
    728737        LNode* temp    =   gPrev->getFirst();
    729     while(NULL != temp) {
    730         pWrite(temp->getPoly());
    731         temp    =   temp->getNext();
    732     }// comuting new groebner basis gbPrev
     738    // computing new groebner basis gbPrev
    733739        if(gPrev->getLength() > gbLength) {
    734740            ideal gbAdd =   idInit(gPrev->getLength()-gbLength,1);
    735741        LNode*  temp    =   gPrevTag;
    736         Print("%p\n",gPrevTag);   
    737         Print("%p\n",gPrev->getLast());   
    738         pWrite(temp->getPoly());
    739         Print("LENGTH OF GPREV LIST: %d\n",gPrev->getLength());
    740         Print("%d\n",gbLength);
     742        //Print("%p\n",gPrevTag);   
     743        //Print("%p\n",gPrev->getLast());   
     744        //pWrite(temp->getPoly());
     745        //Print("LENGTH OF GPREV LIST: %d\n",gPrev->getLength());
     746        //Print("%d\n",gbLength);
    741747        for(j=0;j<=gPrev->getLength()-gbLength-1;j++) {
    742             Print("YES\n");
     748            //Print("YES\n");
    743749            temp        =   temp->getNext();
    744750            gbAdd->m[j] =   temp->getPoly();
    745             pWrite(temp->getPoly());
     751            //pWrite(temp->getPoly());
    746752        }
    747753        gbLength    =   gPrev->getLength();
    748754        gbPrev  =   idAdd(gbPrev,gbAdd);
    749755        }
    750         Print("GROEBNER BASIS:\n====================================================\n");
    751         idShow(gbPrev);
    752         Print("===================================================\n");
    753         Print("JA\n");
     756        int anzahl  =   1;
     757        //while(NULL != temp) {
     758        //    Print("%d. Element: ",anzahl);
     759        //    pWrite(temp->getPoly());
     760        //    Print("\n");
     761        //    temp    =   temp->getNext();
     762        //    anzahl++;
     763        //}
     764        //sleep(5);
     765        //Print("GROEBNER BASIS:\n====================================================\n");
     766        //idShow(gbPrev);
     767        //Print("===================================================\n");
     768        //Print("JA\n");
    754769    }
    755770    Print("\n\nNumber of zero-reductions:  %d\n",reductionsToZero);
    756     LNode* temp    =   gPrev->getFirst();
    757     while(NULL != temp) {
    758         pWrite(temp->getPoly());
    759         temp    =   temp->getNext();
    760     }
     771    //LNode* temp    =   gPrev->getFirst();
     772    //while(NULL != temp) {
     773    //    pWrite(temp->getPoly());
     774    //    temp    =   temp->getNext();
     775    // }
    761776    return(gbPrev);
    762777
Note: See TracChangeset for help on using the changeset viewer.